[go: up one dir, main page]

CN110020558A - A kind of safe crypto chip Testability Design structure under boundary scan design environment - Google Patents

A kind of safe crypto chip Testability Design structure under boundary scan design environment Download PDF

Info

Publication number
CN110020558A
CN110020558A CN201910278520.1A CN201910278520A CN110020558A CN 110020558 A CN110020558 A CN 110020558A CN 201910278520 A CN201910278520 A CN 201910278520A CN 110020558 A CN110020558 A CN 110020558A
Authority
CN
China
Prior art keywords
mode
logic
scan
key
reset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910278520.1A
Other languages
Chinese (zh)
Inventor
王伟征
王威
蔡烁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changsha University of Science and Technology
Original Assignee
Changsha University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Changsha University of Science and Technology filed Critical Changsha University of Science and Technology
Priority to CN201910278520.1A priority Critical patent/CN110020558A/en
Publication of CN110020558A publication Critical patent/CN110020558A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/75Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information by inhibiting the analysis of circuitry or operation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/002Countermeasures against attacks on cryptographic mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0894Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Semiconductor Integrated Circuits (AREA)
  • Storage Device Security (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

本发明公开了边界扫描设计环境下一种保护AES密码芯片免受扫描攻击的可测试性设计结构。该安全的可测试性设计结构在常规边界扫描设计结构的基础上引入了移位使能逻辑、扫描链模式切换复位逻辑和密钥隔离逻辑。移位使能逻辑用于在功能模式下禁用扫描移位操作;扫描链模式切换复位逻辑使芯片在从功能模式切换到测试模式时首先执行一次复位操作,从而保护了存储在扫描链中的机密信息;密钥隔离逻辑用于在测试模式下隔离加密密钥,从而阻止攻击者在测试模式下获取密钥信息。本发明没有引入新的输入、输出信号,仅需要很少的硬件开销,能够对芯片进行自动保护,在不折损电路可测试性的前提下,能够抵御所有潜在的基于扫描的侧信道攻击。The invention discloses a testability design structure for protecting an AES cryptographic chip from scanning attacks in a boundary scan design environment. The secure testability design structure introduces shift enable logic, scan chain mode switching reset logic and key isolation logic on the basis of conventional boundary scan design structure. The shift enable logic is used to disable the scan shift operation in functional mode; the scan chain mode switch reset logic causes the chip to first perform a reset operation when switching from functional mode to test mode, thus protecting the secret stored in the scan chain information; key isolation logic is used to isolate encryption keys in test mode, preventing attackers from obtaining key information in test mode. The present invention does not introduce new input and output signals, only requires little hardware overhead, can automatically protect the chip, and can resist all potential scan-based side channel attacks without compromising the testability of the circuit.

Description

边界扫描设计环境下一种安全的密码芯片可测试性设计结构A Secure Design Structure for Cryptographic Chip Testability in Boundary Scan Design Environment

技术领域technical field

本发明属于芯片安全领域,更具体地,涉及一种保护密码芯片免受基于扫描的非入侵攻击的安全可测试性设计结构。The invention belongs to the field of chip security, and more particularly, relates to a security testability design structure for protecting a cryptographic chip from scanning-based non-intrusion attacks.

背景技术Background technique

随着物联网、大数据等新兴技术的发展,信息安全和隐私变得越来越重要,密码算法得到了广泛应用。由于软件实现提供的数据吞吐率较低,且需要较多的计算资源,密码算法通常利用硬件模块来实现。加密算法对故障是零容忍的,因此加密硬件需要进行严格的测试。With the development of emerging technologies such as the Internet of Things and big data, information security and privacy have become more and more important, and cryptographic algorithms have been widely used. Since software implementation provides low data throughput and requires more computing resources, cryptographic algorithms are usually implemented using hardware modules. Encryption algorithms have zero tolerance for failures, so encryption hardware needs to undergo rigorous testing.

扫描设计提高了芯片内部触发器的可控制性和可观察性,把时序电路的测试转化成了组合电路的测试,给集成电路测试带来极大便利,成为当今工业上广泛应用的可测试性设计技术。如附图1(a)所示,通过在输入端添加一个2选1的多路复用器,一个触发器就变成了内部扫描单元(internal scan cell,ISC)。ISC有两个可选的输入源:数据输入(DI)和扫描输入(SI)。DI是原触发器的输入,而SI由另一个ISC的输出驱动。移位使能信号(Shift_en)决定选择DI还是SI。ISC输出既是数据输出(DO)也是扫描输出(SO)。此外,由于通常情况下测试设备的数据通道是有限的,对一个输入/输出(I/O)端口数量众多的芯片进行测试是一个巨大的挑战。边界扫描设计成功地解决了这个问题,它为每个芯片I/O配备了一个边界扫描单元(boundary scan cell,BSC)。一个BSC由两个D触发器和两个多路复用器组成,如附图1(b)所示。作为输入的BSC,输入源DI由芯片输入端口(ChipIn)驱动,数据输出DO对应于内部逻辑的原始输入(PI)。作为输出的BSC,输入源DI由内部逻辑的原始输出(PO)驱动,数据输出DO对应于芯片的输出端口(ChipOut)。传播到DO的值由工作模式选择信号(Mode_sel)决定。内部扫描链(或边界扫描链)是通过将ISC(或BSC)的SO与后续单元的SI串联而形成的移位寄存器。把扫描链中第一扫描单元的SI连接到芯片输入管脚,将最后一扫描单元的SO连接到芯片输出管脚,就可以从外部访问扫描链。当Mode_sel=0,Shift_en=0时,芯片运行在功能模式。此时,无论BSC还是ISC,DO都由DI直接驱动。当Mode_sel=0时,芯片运行在测试模式下,该模式有三个操作相位:移位、更新和捕获。在移位阶段,Shift_en=1,移位时钟脉冲应用于每个BSC和ISC的时钟输入,通过扫描移位把测试向量移入扫描链,同时把测试响应移出扫描链。在仅针对BSC的更新阶段,通过向每个BSC的UpdateClock提供时钟脉冲,将存储在D1(称为捕获触发器)中的测试数据传送到D2(称为更新触发器)。此时,D2的状态传输到了BSC的DO。在捕获阶段,Shift_en=0,对每个BSC和ISC的时钟输入施加一个捕获时钟脉冲,将DI处的响应值捕捉到ISC或BSC的D1中。The scanning design improves the controllability and observability of the internal triggers of the chip, and transforms the test of sequential circuits into the test of combinational circuits, which brings great convenience to the test of integrated circuits, and has become the testability widely used in today's industry. Design technology. As shown in Figure 1(a), by adding a 2-to-1 multiplexer at the input, a flip-flop becomes an internal scan cell (ISC). The ISC has two selectable input sources: data input (DI) and scan input (SI). DI is the input of the original flip-flop, while SI is driven by the output of another ISC. The shift enable signal (Shift_en) determines whether DI or SI is selected. The ISC output is both a data output (DO) and a scan output (SO). In addition, testing a chip with a large number of input/output (I/O) ports is a huge challenge since test equipment typically has limited data channels. The boundary-scan design successfully solves this problem by equipping each chip I/O with a boundary-scan cell (BSC). A BSC consists of two D flip-flops and two multiplexers, as shown in Figure 1(b). As the input BSC, the input source DI is driven by the chip input port (ChipIn), and the data output DO corresponds to the original input (PI) of the internal logic. As an output BSC, the input source DI is driven by the original output (PO) of the internal logic, and the data output DO corresponds to the chip's output port (ChipOut). The value propagated to DO is determined by the operating mode selection signal (Mode_sel). The inner scan chain (or boundary scan chain) is a shift register formed by concatenating the SO of the ISC (or BSC) with the SI of the subsequent cells. The scan chain can be accessed from the outside by connecting the SI of the first scan unit in the scan chain to the chip input pins and the SO of the last scan unit to the chip output pins. When Mode_sel=0 and Shift_en=0, the chip operates in functional mode. At this time, regardless of BSC or ISC, DO is directly driven by DI. When Mode_sel=0, the chip runs in test mode, which has three operation phases: shift, update and capture. In the shift phase, Shift_en=1, the shift clock pulse is applied to the clock input of each BSC and ISC, and the test vector is shifted into the scan chain by the scan shift, and the test response is shifted out of the scan chain at the same time. During the BSC-only update phase, the test data stored in D1 (called the capture flip-flop) is transferred to D2 (called the update flip-flop) by providing a clock pulse to the UpdateClock of each BSC. At this time, the state of D2 is transmitted to the DO of the BSC. In the capture phase, Shift_en=0, a capture clock pulse is applied to each BSC and the clock input of the ISC, and the response value at DI is captured into the D1 of the ISC or BSC.

在密码芯片中插入扫描链,一方面提高了它的可测试性,保证了芯片的测试质量;另一方面也给密码芯片带来了安全隐患。借助于扫描链,攻击者可以在芯片输入端加载任意的明文,然后在扫描链的输出端观察加密的中间状态。最终根据已知明文、相应的中间状态以及加密算法的知识来破解密钥。AES(高级加密标准)是一种广泛应用的加密算法,据报道,AES芯片容易被基于扫描的攻击所破解。本发明的目的在于改进现有的可测试性设计结构以保护AES芯片免受基于扫描的侧信道攻击。Inserting a scan chain into the cryptographic chip improves its testability and ensures the test quality of the chip; on the other hand, it also brings security risks to the cryptographic chip. With the help of scan chains, an attacker can load arbitrary plaintext at the input of the chip, and then observe the encrypted intermediate state at the output of the scan chain. Finally, the key is cracked based on the known plaintext, the corresponding intermediate state, and knowledge of the encryption algorithm. AES (Advanced Encryption Standard) is a widely used encryption algorithm, and AES chips are reportedly vulnerable to scan-based attacks. The purpose of the present invention is to improve the existing testability design structure to protect the AES chip from scan-based side channel attacks.

现有专利中,没找到与边界扫描设计环境下安全的密码芯片可测试性设计结构相似的专利发明。Among the existing patents, no patented invention has been found that is similar to the testability design structure of a secure cryptographic chip in a boundary scan design environment.

发明内容SUMMARY OF THE INVENTION

针对现有边界扫描技术的缺陷,本发明的目的在于提供一种安全的扫描设计方案,在不影响电路性能以及测试质量的前提下,克服基于扫描的侧信道攻击。Aiming at the defects of the existing boundary scan technology, the purpose of the present invention is to provide a safe scan design scheme, which can overcome the scan-based side channel attack without affecting the circuit performance and test quality.

为实现上述目的,本发明提供了一种边界扫描设计环境下安全的可测试性设计方案。与常规的扫描设计方案相比,提出的安全可测试性设计方案增加了扫描链复位机制、密钥隔离机制和移位使能机制。当芯片在在测试模式(Mode_sel=1)和功能模式(Mode_sel=0)之间切换时,扫描链首先进行复位,把存储的机密信息清除,从而可以阻止基于模式切换的扫描攻击。在测试模式(Mode_sel=1)下,密钥与加密模块隔离,从而可以克服仅依赖于测试模式的扫描攻击。在功能模式(Mode_sel=0)下,移位操作被禁用从而可以战胜功能模式下非法使用用移位操作的扫描攻击。In order to achieve the above object, the present invention provides a safe testability design scheme in a boundary scan design environment. Compared with the conventional scan design scheme, the proposed security testability design scheme adds a scan chain reset mechanism, a key isolation mechanism and a shift enable mechanism. When the chip switches between the test mode (Mode_sel=1) and the functional mode (Mode_sel=0), the scan chain is first reset to clear the stored confidential information, thereby preventing scan attacks based on mode switching. In test mode (Mode_sel=1), the key is isolated from the encryption module, so that scanning attacks that rely only on test mode can be overcome. In functional mode (Mode_sel=0), the shift operation is disabled Thus, it is possible to defeat the illegal use of scan attacks with shift operations in functional mode.

本发明的安全可测试性设计结构是在常规边界扫描设计的基础上加入了移位使能逻辑、扫描链模式切换复位逻辑和密钥隔离逻辑,如附图2所示。常规的扫描链是把轮密钥生成器中的密钥寄存器和轮操作单元中的轮寄存器以及芯片中的其它触发器改造成扫描单元之后串联而成。这里的轮操作单元和轮密钥生成器是AES加密芯片的核心部件。本发明的安全可测试性设计引入的安全控制逻辑描述如下:The security testability design structure of the present invention adds shift enable logic, scan chain mode switching reset logic and key isolation logic on the basis of conventional boundary scan design, as shown in FIG. 2 . The conventional scan chain is formed by transforming the key register in the round key generator, the round register in the round operation unit and other flip-flops in the chip into scanning units in series. The round operation unit and round key generator here are the core components of the AES encryption chip. The safety control logic introduced by the safety testability design of the present invention is described as follows:

1.移位使能逻辑1. Shift enable logic

为了防止攻击者在功能模式(Mode_sel=0)下非法利用移位操作(Shift_en=1)获得中间加密结果,全局(系统)移位控制信号SHIFT_EN通过一个与门后再控制每个扫描单元(包括边界扫描单元和常规扫描单元)的移位使能输入Shift_en。与门的另一个输入受工作模式选择信号Mode_sel控制,如附图3所示。这保证了当Mode_sel为0时,每个扫描单元的移位使能输入端口只能接收0,即在功能模式下禁用移位操作。In order to prevent attackers from illegally using shift operation (Shift_en=1) to obtain intermediate encryption results in functional mode (Mode_sel=0), the global (system) shift control signal SHIFT_EN passes through an AND gate and then controls each scan unit (including Shift enable input Shift_en for boundary scan cells and regular scan cells). The other input of the AND gate is controlled by the working mode selection signal Mode_sel, as shown in FIG. 3 . This ensures that when Mode_sel is 0, the shift enable input port of each scan unit can only receive 0, i.e. the shift operation is disabled in functional mode.

2.扫描链模式切换复位逻辑2. Scan chain mode switching reset logic

在传统的扫描结构中,全局(系统)复位输入(System_Reset)驱动每个扫描单元的复位端(Reset),当System_Reset=0时可以初始化芯片,如附图4(a)所示。为了在模式切换时执行复位操作,本发明提出的安全扫描结构引入了扫描链复位逻辑,包括一个D触发器、一个同或门和一个与门,如图4(b)所示。插入的D触发器存储上一个时钟周期的Mode_sel值。如果当前时钟周期的Mode_sel与上一个时钟周期的Mode_sel值相同时,同或门输出为1。此时,System_Reset决定与门的输出,也就是决定每个扫描单元的Reset值。相反,如果当前时钟周期的Mode_sel与上一个时钟周期的Mode_sel值不同时,同或门输出为0。此时,不管System_Reset取何值,与门的输出都为0,受控的扫描单元执行复位操作,从而加密信息被清除。另外,如果System_Reset为0,不管同或门的输出为何值,与门的输出也必为0,因此系统级的复位操作可以正常执行。In the traditional scan structure, the global (system) reset input (System_Reset) drives the reset terminal (Reset) of each scan unit, and the chip can be initialized when System_Reset=0, as shown in FIG. 4(a). In order to perform a reset operation during mode switching, the security scan structure proposed by the present invention introduces a scan chain reset logic, including a D flip-flop, an XOR gate and an AND gate, as shown in Figure 4(b). The inserted D flip-flop stores the Mode_sel value from the previous clock cycle. If the Mode_sel of the current clock cycle is the same as the Mode_sel value of the previous clock cycle, the output of the XOR gate is 1. At this point, System_Reset determines the output of the AND gate, that is, the Reset value of each scan unit. Conversely, if the Mode_sel value of the current clock cycle is different from the Mode_sel value of the previous clock cycle, the output of the XOR gate is 0. At this time, no matter what the value of System_Reset is, the output of the AND gate is 0, and the controlled scanning unit performs the reset operation, so that the encrypted information is cleared. In addition, if System_Reset is 0, no matter what the output of the XOR gate is, the output of the AND gate must also be 0, so the system-level reset operation can be performed normally.

3.密钥隔离逻辑3. Key isolation logic

AES轮密钥生成模块的典型结构如附图5所示,它由密钥寄存器和一些组合逻辑组成。密钥寄存器用于存储和输出生成的轮密钥。在原始的轮密钥生成模块中,密钥寄存器中每个存储单元的DI通过4选1多路复用器接收四个输入信号:加密密钥(userkey,也就是初始密钥)、前一轮密钥(roundkeyi-1,用于解密)、下一轮密钥(roundkeyi+1,用于加密)和其他输入,如附图6(a)。加密密钥在加密的开始阶段从非易失存储器中加载进来,是生成各个轮密钥的基础。多路复用器有两个地址输入(图6(a)中标记为A1和A2),用于选择当前需要存储的轮密钥。假设{A1,A2}为{0,0}、{0,1}、{1,0}和{1,1}时,分别选择userkey、roundkeyi-1、roundkeyi+1和其他输入。当加密电路通电后,{Mode_sel,Shift_en}设置为{0,0},芯片进入功能模式。首先,把{A1,A2}设置为{0,0},将初始密钥送入密钥寄存器中。在随后的时钟周期中,把{A1,A2}设置为{1,0},密钥生成器将生成并存储下一轮密钥。解密时,把{A1,A2}设置为{0,1},按相反顺序生成并存储轮密钥。The typical structure of the AES round key generation module is shown in Figure 5, which consists of a key register and some combinational logic. The key register is used to store and output the generated round key. In the original round key generation module, the DI of each storage unit in the key register receives four input signals through a 4-to-1 multiplexer: the encryption key (userkey, that is, the initial key), the previous Round key (roundkey i-1 , used for decryption), next round key (roundkey i+1 , used for encryption) and other inputs, as shown in Figure 6(a). The encryption key is loaded from non-volatile memory at the beginning of encryption and is the basis for generating each round key. The multiplexer has two address inputs (labeled A1 and A2 in Fig. 6(a)) for selecting the current round key that needs to be stored. When {A1,A2} is assumed to be {0,0}, {0,1}, {1,0} and {1,1}, select userkey, roundkey i-1 , roundkey i+1 and other inputs respectively. When the encryption circuit is powered on, {Mode_sel,Shift_en} is set to {0,0}, and the chip enters the functional mode. First, set {A1,A2} to {0,0} and send the initial key into the key register. On subsequent clock cycles, set {A1,A2} to {1,0}, the key generator will generate and store the next round of keys. When decrypting, set {A1,A2} to {0,1}, generate and store round keys in reverse order.

密钥隔离逻辑插入在轮密钥生成模块中。它通过修改多路复用器的地址输入,使初始密钥在测试阶段被禁用,如附图6(b)所示。Mode_sel通过几个逻辑门后协助A1和A2控制多路复用器。当加密电路进入功能模式(Mode_sel=0)时,插入的逻辑门不起作用,即{A1,A2}恒等于{A1',A2'}。当Mode_sel=1时,{A1,A2}为{0,0}、{0,1}、{1,0}和{1,1}对应的{A1',A2'}分别为{1,1}、{0,1}、{1,0}和{1,1},也就是这意味着,在测试模式下无法将初始密钥传递到密钥寄存器中。需要注意的是,如果初始密钥被隔离,则roundkeyi-1和roundkeyi+1不是真正的轮密钥,它们与初始密钥无关,它们仅取决于密钥寄存器中扫描单元的测试数据。The key isolation logic is inserted in the round key generation module. It makes the initial key disabled in the test phase by modifying the address input of the multiplexer, as shown in Fig. 6(b). Mode_sel assists A1 and A2 in controlling the multiplexer through several logic gates. When the encryption circuit enters the functional mode (Mode_sel=0), the inserted logic gates do not work, that is, {A1, A2} is always equal to {A1', A2'}. When Mode_sel=1, {A1, A2} are {0,0}, {0,1}, {1,0} and {1,1} corresponding to {A1', A2'} are {1,1 respectively }, {0,1}, {1,0} and {1,1}, i.e. This means that the initial key cannot be passed into the key register in test mode. It should be noted that if the initial key is isolated, then roundkey i-1 and roundkey i+1 are not real round keys, they have nothing to do with the initial key, they only depend on the test data of the scan unit in the key register.

通过本发明所构思的以上技术方案,与现有技术相比,具有以下的有益效果:Compared with the prior art, the above technical solutions conceived by the present invention have the following beneficial effects:

1、能够克服边界扫描设计环境下所有可能的基于扫描的攻击,同时未改变测试流程,因此对芯片测试没有任何影响,允许执行所有类型的测试,如固定型故障测试和时延故障测试等。1. It can overcome all possible scan-based attacks in a boundary scan design environment without changing the test process, so it has no impact on chip testing, allowing all types of tests to be performed, such as fixed-fault testing and delay-fault testing.

2、本发明提出的安全测试结构,没有增加额外的输入、输出信号,也不需要额外的测试准备时间,能够对芯片进行自动保护,且对电路设计的影响较小。2. The safety test structure proposed by the present invention does not add extra input and output signals, and does not require extra test preparation time, can automatically protect the chip, and has little impact on the circuit design.

3、面积开销低。本发明所构思的可测试性设计结构在现有可测试性结构的基础上仅增加了一个触发器和少量的逻辑门,增加的面积开销是非常低的。3. The area cost is low. The testability design structure conceived by the present invention only adds one flip-flop and a small number of logic gates on the basis of the existing testability structure, and the increased area overhead is very low.

附图说明Description of drawings

图1是内部扫描单元和边界扫描单元结构示意图。FIG. 1 is a schematic structural diagram of an internal scan unit and a boundary scan unit.

图2是本发明提出的安全可测试性设计总体框图。FIG. 2 is an overall block diagram of the security testability design proposed by the present invention.

图3是移位使能逻辑示意图。Figure 3 is a schematic diagram of the shift enable logic.

图4是带复位功能的扫描链以及增加模式切换复位功能的扫描链示意图。FIG. 4 is a schematic diagram of a scan chain with a reset function and a scan chain with a mode switching reset function added.

图5是AES轮密钥生成模块。Figure 5 is the AES round key generation module.

图6是原AES芯片的密钥寄存结构和带隔离功能的密钥寄存结构。Figure 6 shows the key registration structure of the original AES chip and the key registration structure with isolation function.

具体实施方式Detailed ways

下面结合附图对本发明进行详细描述。The present invention will be described in detail below with reference to the accompanying drawings.

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.

使用本发明的技术保护芯片时,需要芯片设计阶段插入上述安全控制逻辑。插入安全控制逻辑后,芯片的工作和测试流程如下。When using the technology of the present invention to protect the chip, the above-mentioned security control logic needs to be inserted in the chip design stage. After inserting the safety control logic, the working and testing process of the chip is as follows.

1.在上电后如果模式选择信号和移位使能信号{Mode_sel,SHIFT_EN}都设置为0时,密码芯片运行在功能模式,初始密钥可以加载到密钥寄存器中以执行加密/解密运算。1. After power-on, if the mode selection signal and shift enable signal {Mode_sel, SHIFT_EN} are both set to 0, the cryptographic chip runs in functional mode, and the initial key can be loaded into the key register to perform encryption/decryption operations .

2.在上电后如果模式选择信号和移位使能信号{Mode_sel,SHIFT_EN}设置为{0,1}时,每个扫描单元的Shift_en输入依然为0,移位操作无法进行,密码芯片运行在功能模式,初始密钥可以加载到密钥寄存器中以执行加密/解密运算。2. After power-on, if the mode selection signal and shift enable signal {Mode_sel, SHIFT_EN} are set to {0, 1}, the Shift_en input of each scanning unit is still 0, the shift operation cannot be performed, and the cryptographic chip runs In functional mode, the initial key can be loaded into the key register to perform encryption/decryption operations.

3.一旦Mode_sel从0变为1,芯片立即复位,即把扫描单元的状态清零。复位操作将删除存储在扫描链中的机密信息。随后,密码芯片工作在测试模式下。测试模式由三个操作相位(移位相位、更新相位和捕获相位)组成,并在这三个操作相位间轮换。SHIFT_EN信号用于控制操作相位之间的轮换。在移位相位,SHIFT_EN=1,扫描单元处于串行移位模式。此时在每个BSC和ISC的时钟输入上施加一定数量的Clock时钟脉冲,就可以通过扫描输入引脚将测试向量串行扫描到扫描链中,同时通过扫描输出引脚把前一个测试向量的测试响应移出。一旦测试向量被完全扫描到扫描链内,芯片进入更新相位,每个BSC的UpdateClock将应用一个时钟脉冲。在这个更新相位,存储在D1(BSC的捕获触发器)中的测试数据被输送到到D2(BSC的更新触发器),同时测试向量通过扫描单元的DO应用到组合逻辑。接下来,SHIFT_EN变为0,电路进入一个时钟周期的捕获相位。在这个捕获相位,测试响应通过DI加载到扫描链中。由于Mode_sel=0时初始密钥不能加载进来,因此在捕获相位密钥寄存器捕获的响应与初始密钥无关。这保证了从扫描链中移出的响应不包含机密信息。通过再次将SHIFT_EN设置为“1”,先前捕获的测试响应将通过扫描输出端口从扫描链中移出,同时将下一个测试向量移入到扫描链中。3. Once Mode_sel changes from 0 to 1, the chip is reset immediately, that is, the state of the scanning unit is cleared. A reset operation will delete confidential information stored in the scan chain. Subsequently, the cryptographic chip works in the test mode. The test mode consists of three operating phases (shift phase, update phase, and capture phase), and alternate among these three operating phases. The SHIFT_EN signal is used to control the rotation between operating phases. In the shift phase, SHIFT_EN=1, the scan unit is in serial shift mode. At this time, when a certain number of Clock clock pulses are applied to the clock input of each BSC and ISC, the test vector can be serially scanned into the scan chain through the scan input pin, and the previous test vector can be scanned through the scan output pin. Test response moved out. Once the test vectors are fully scanned into the scan chain, the chip enters the update phase, and one clock pulse will be applied to each BSC's UpdateClock. In this update phase, the test data stored in D1 (BSC's capture flip-flop) is fed to D2 (BSC's update flip-flop), while the test vector is applied to the combinational logic through the DO of the scan cell. Next, SHIFT_EN becomes 0 and the circuit enters the capture phase for one clock cycle. During this capture phase, the test response is loaded into the scan chain via DI. Since the initial key cannot be loaded when Mode_sel=0, the response captured in the capture phase key register is independent of the initial key. This ensures that responses removed from the scan chain do not contain confidential information. By setting SHIFT_EN to '1' again, the previously captured test response will be shifted out of the scan chain through the scan output port, while the next test vector is shifted into the scan chain.

4.在上电后如果Mode_sel首先被设为1,密码芯片即刻工作在测试模式,测试模式由移位相位、更新相位和捕获相位组成。具体操作流程与上述3相似。4. If Mode_sel is first set to 1 after power-on, the cryptographic chip will work in the test mode immediately, and the test mode consists of shift phase, update phase and capture phase. The specific operation process is similar to the above 3.

密码芯片可以自由切换工作模式。一旦收到模式切换请求,芯片立即复位。The cryptographic chip can switch the working mode freely. Once a mode switch request is received, the chip is reset immediately.

基于上述安全可测试性设计方案的详细说明,其工作原理可以概括描述如下:攻击者不能在功能模式下进行移位操作,无法通过把芯片从功能模式切换到测试模式来移出存储在扫描链中的机密信息,也无法在测试模式下获取密钥信息,因此基于扫描的非入侵时攻击实际上是不可能完成的。Based on the detailed description of the security testability design scheme above, its working principle can be summarized as follows: an attacker cannot perform a shift operation in functional mode, and cannot shift the chip from functional mode to test mode to remove the memory in the scan chain. Confidential information cannot be obtained in test mode, so a scan-based non-break-in-time attack is practically impossible.

本领域的技术人员容易理解,以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。Those skilled in the art can easily understand that the above are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention, etc., All should be included within the protection scope of the present invention.

Claims (4)

1.边界扫描设计环境下一种安全的密码芯片可测试性设计结构,其特征在于,在常规边界扫描设计的基础上引入了移位使能逻辑、扫描链模式切换复位逻辑和密钥隔离逻辑。移位使能逻辑用于在功能模式下禁用扫描移位操作;扫描链模式切换复位逻辑使芯片在从功能模式切换到测试模式时首先执行一次复位操作,从而保护了存储在扫描链中的机密信息;密钥隔离逻辑用于在测试模式下隔离加密密钥,从而阻止攻击者在测试模式下获取密钥信息。1. A safe cryptographic chip testability design structure under the boundary scan design environment is characterized in that, on the basis of conventional boundary scan design, shift enable logic, scan chain mode switching reset logic and key isolation logic are introduced . The shift enable logic is used to disable the scan shift operation in functional mode; the scan chain mode switch reset logic causes the chip to first perform a reset operation when switching from functional mode to test mode, thus protecting the secret stored in the scan chain information; key isolation logic is used to isolate encryption keys in test mode, preventing attackers from obtaining key information in test mode. 2.根据权利要求1的安全可测试性设计结构,其特征在于,移位使能逻辑受工作模式选择信号控制。如果工作模式选择信号为“0”(功能模式),移位使能逻辑禁止扫描链执行移位操作,芯片只能工作在功能模式。如果工作模式选择信号为“1”(测试模式),此时通过设定全局(系统)移位使能信号可以执行捕获和扫描移位。2. The design structure for safety testability of claim 1, wherein the shift enable logic is controlled by an operating mode selection signal. If the working mode selection signal is "0" (functional mode), the shift enable logic prohibits the scan chain from performing the shift operation, and the chip can only work in the functional mode. If the operating mode selection signal is "1" (test mode), capture and scan shifting can be performed by setting the global (system) shift enable signal at this time. 3.根据权利要求1的安全可测试性设计结构,其特征在于,扫描链模式切换复位逻辑存储前一个时钟周期的工作模式选择信号值并与当前周期的工作模式选择信号值进行比较,如果两者不同,扫描单元的清零输入端被赋为有效值,执行一次复位操作,清除扫描链中的信息。当全局(系统)复位信号为有效值时,扫描链模式切换复位逻辑允许扫描链直接清零,从而保证系统复位的正常进行。如果前后两个时钟周期的工作模式选择信号值相同且全局(系统)复位信号为无效值时,则不会执行复位操作。3. The safety testability design structure according to claim 1, wherein the scan chain mode switching reset logic stores the operating mode selection signal value of the previous clock cycle and compares it with the operating mode selection signal value of the current cycle, if the two Different, the clear input terminal of the scan unit is assigned a valid value, and a reset operation is performed to clear the information in the scan chain. When the global (system) reset signal is a valid value, the scan chain mode switching reset logic allows the scan chain to be cleared directly, thereby ensuring the normal operation of the system reset. If the working mode selection signal value of the two clock cycles before and after is the same and the global (system) reset signal is invalid, the reset operation will not be performed. 4.根据权利要求1的安全可测试性设计结构,其特征在于,密钥隔离逻辑受工作模式选择信号控制。如果工作模式选择信号为“0”(功能模式),密钥隔离逻辑允许芯片正常加载密钥,也就是不隔离密钥。如果工作模式选择信号为“1”(测试模式),密钥隔离逻辑将密钥与芯片隔离。密钥隔离逻辑插入在轮密钥生成模块中,它通过修改多路复用器的地址输入,以极低的硬件开销使加密密钥在测试阶段无法被选中,从而无法进入密钥寄存器。4. The security testability design structure according to claim 1, wherein the key isolation logic is controlled by the operation mode selection signal. If the operating mode selection signal is "0" (functional mode), the key isolation logic allows the chip to load the key normally, that is, the key is not isolated. If the operating mode select signal is "1" (test mode), the key isolation logic isolates the key from the chip. The key isolation logic is inserted in the round key generation module, which by modifying the address input of the multiplexer, makes the encryption key unselectable in the test phase with extremely low hardware overhead, so that it cannot enter the key register.
CN201910278520.1A 2019-04-09 2019-04-09 A kind of safe crypto chip Testability Design structure under boundary scan design environment Pending CN110020558A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910278520.1A CN110020558A (en) 2019-04-09 2019-04-09 A kind of safe crypto chip Testability Design structure under boundary scan design environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910278520.1A CN110020558A (en) 2019-04-09 2019-04-09 A kind of safe crypto chip Testability Design structure under boundary scan design environment

Publications (1)

Publication Number Publication Date
CN110020558A true CN110020558A (en) 2019-07-16

Family

ID=67190779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910278520.1A Pending CN110020558A (en) 2019-04-09 2019-04-09 A kind of safe crypto chip Testability Design structure under boundary scan design environment

Country Status (1)

Country Link
CN (1) CN110020558A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111046444A (en) * 2019-12-06 2020-04-21 合肥市卓怡恒通信息安全有限公司 Storage encryption system based on domestic chip platform, mode switching method thereof and computer
WO2021049991A1 (en) * 2019-09-12 2021-03-18 Fingerprint Cards Ab Biometric device with cryptographic circuitry
CN112684327A (en) * 2020-11-30 2021-04-20 海光信息技术股份有限公司 Scan chain and design method thereof and serial scan reset method based on scan chain
CN112910623A (en) * 2019-11-19 2021-06-04 硅实验室公司 Side channel attack mitigation for security devices with embedded sensors
WO2021224886A1 (en) * 2020-05-07 2021-11-11 Ozgur Sinanoglu System, method, computer-accessible medium, and circuit for crippling the oracle in logic locking
CN113702816A (en) * 2021-08-26 2021-11-26 中国电子科技集团公司第五十八研究所 Boundary scanning-based register unit design method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030204801A1 (en) * 2002-04-30 2003-10-30 Motorola, Inc. Method and apparatus for secure scan testing
US20040153801A1 (en) * 2002-09-24 2004-08-05 Yoshitaka Kayukawa Semiconductor integrated circuit and method for testing same
CN101859267A (en) * 2010-05-12 2010-10-13 宇龙计算机通信科技(深圳)有限公司 Mainboard and test method capable of protecting chip on mainboard
CN103997402A (en) * 2014-05-30 2014-08-20 中国科学院深圳先进技术研究院 Encryption chip safety performance testing method and device
CN106707139A (en) * 2017-01-03 2017-05-24 大唐微电子技术有限公司 Scan chain test device and realizing method
CN108896903A (en) * 2018-06-13 2018-11-27 天津大学 The gradually verifying type security sweep chain apparatus and method of logic-based encryption
CN109188246A (en) * 2018-09-06 2019-01-11 长沙理工大学 A kind of safe encryption chip Testability Design structure

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030204801A1 (en) * 2002-04-30 2003-10-30 Motorola, Inc. Method and apparatus for secure scan testing
US20040153801A1 (en) * 2002-09-24 2004-08-05 Yoshitaka Kayukawa Semiconductor integrated circuit and method for testing same
CN101859267A (en) * 2010-05-12 2010-10-13 宇龙计算机通信科技(深圳)有限公司 Mainboard and test method capable of protecting chip on mainboard
CN103997402A (en) * 2014-05-30 2014-08-20 中国科学院深圳先进技术研究院 Encryption chip safety performance testing method and device
CN106707139A (en) * 2017-01-03 2017-05-24 大唐微电子技术有限公司 Scan chain test device and realizing method
CN108896903A (en) * 2018-06-13 2018-11-27 天津大学 The gradually verifying type security sweep chain apparatus and method of logic-based encryption
CN109188246A (en) * 2018-09-06 2019-01-11 长沙理工大学 A kind of safe encryption chip Testability Design structure

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王伟征等: "A Low-Area Overhead Secure Scan Aichtecture Resisting Scan-Based Attacks for Crypto Chips", 《PROCEEDINGS OF THE INTERNATIONAL MULTICONFERENCE OF ENGINEERS AND COMPUTER SCIENTISTS》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021049991A1 (en) * 2019-09-12 2021-03-18 Fingerprint Cards Ab Biometric device with cryptographic circuitry
CN114391149A (en) * 2019-09-12 2022-04-22 指纹卡安娜卡敦知识产权有限公司 Biometric device with encrypted circuit
US11997199B2 (en) 2019-09-12 2024-05-28 Fingerprint Cards Anacatum Ip Ab Biometric device with cryptographic circuitry
CN112910623A (en) * 2019-11-19 2021-06-04 硅实验室公司 Side channel attack mitigation for security devices with embedded sensors
CN112910623B (en) * 2019-11-19 2023-12-26 硅实验室公司 Side channel attack mitigation for security devices with embedded sensors
CN111046444A (en) * 2019-12-06 2020-04-21 合肥市卓怡恒通信息安全有限公司 Storage encryption system based on domestic chip platform, mode switching method thereof and computer
WO2021224886A1 (en) * 2020-05-07 2021-11-11 Ozgur Sinanoglu System, method, computer-accessible medium, and circuit for crippling the oracle in logic locking
CN112684327A (en) * 2020-11-30 2021-04-20 海光信息技术股份有限公司 Scan chain and design method thereof and serial scan reset method based on scan chain
CN112684327B (en) * 2020-11-30 2023-09-05 海光信息技术股份有限公司 Scan chain and its design method and serial scan reset method based on scan chain
CN113702816A (en) * 2021-08-26 2021-11-26 中国电子科技集团公司第五十八研究所 Boundary scanning-based register unit design method
CN113702816B (en) * 2021-08-26 2024-05-10 中国电子科技集团公司第五十八研究所 Register unit design method based on boundary scanning

Similar Documents

Publication Publication Date Title
CN110020558A (en) A kind of safe crypto chip Testability Design structure under boundary scan design environment
Yang et al. Secure scan: A design-for-test architecture for crypto chips
Lee et al. Securing scan design using lock and key technique
Cui et al. Static and dynamic obfuscations of scan data against scan-based side-channel attacks
Paul et al. Vim-scan: A low overhead scan design approach for protection of secret key in scan-based secure chips
Lee et al. Securing designs against scan-based side-channel attacks
Swierczynski et al. Bitstream fault injections (BiFI)–automated fault attacks against SRAM-based FPGAs
Limaye et al. Is robust design-for-security robust enough? Attack on locked circuits with restricted scan chain access
Azar et al. From cryptography to logic locking: A survey on the architecture evolution of secure scan chains
Agrawal et al. Scan based side channel attacks on stream ciphers and their counter-measures
Cui et al. A new PUF based lock and key solution for secure in-field testing of cryptographic chips
CN109188246B (en) Testability design structure of safe encryption chip
Cui et al. Why current secure scan designs fail and how to fix them?
Atobe et al. Secure scan design with dynamically configurable connection
Yu et al. Aes design improvements towards information security considering scan attack
Wang et al. A secure DFT architecture protecting crypto chips against scan-based attacks
Luo et al. A new countermeasure against scan-based side-channel attacks
Banik et al. Improved scan-chain based attacks and related countermeasures
Sao et al. Co-relation scan attack analysis (COSAA) on AES: A comprehensive approach
Banik et al. Cryptanalysis of the double-feedback XOR-chain scheme proposed in indocrypt 2013
Chandran et al. SS-KTC: A high-testability low-overhead scan architecture with multi-level security integration
Sao et al. Security analysis of scan obfuscation techniques
Chen et al. Partial scan design against scan-based side channel attacks
Tauhidur Rahman et al. Protection of assets from scan chain vulnerabilities through obfuscation
Sao et al. DefScan: Provably defeating scan attack on AES-like ciphers

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190716