WO2008061395A1 - Aes encryption circuit for data stream executed in desequencing - Google Patents

Aes encryption circuit for data stream executed in desequencing Download PDF

Info

Publication number
WO2008061395A1
WO2008061395A1 PCT/CN2006/003151 CN2006003151W WO2008061395A1 WO 2008061395 A1 WO2008061395 A1 WO 2008061395A1 CN 2006003151 W CN2006003151 W CN 2006003151W WO 2008061395 A1 WO2008061395 A1 WO 2008061395A1
Authority
WO
WIPO (PCT)
Prior art keywords
token
field
key
unit
data
Prior art date
Application number
PCT/CN2006/003151
Other languages
French (fr)
Chinese (zh)
Inventor
Yihe Sun
Xiangyu Li
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to PCT/CN2006/003151 priority Critical patent/WO2008061395A1/en
Publication of WO2008061395A1 publication Critical patent/WO2008061395A1/en

Links

Classifications

    • 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/002Countermeasures against attacks on cryptographic mechanisms
    • H04L9/003Countermeasures against attacks on cryptographic mechanisms for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/12Details relating to cryptographic hardware or logic circuitry

Definitions

  • the invention belongs to the field of cryptographic integrated circuits and anti-differential power analysis attacks, and relates to a circuit for solving a cryptographic integrated circuit anti-differential power analysis attack problem, in particular to a data stream AES encryption circuit for out-of-order execution. . current technology
  • a power analysis attack is a hardware-oriented attack that analyzes the power consumption (or power supply current) during processing of the data to obtain data information from it.
  • the most common differential power analysis attack is used to perform statistical hypothesis testing on multiple working power consumption curve samples to find the most likely value of the key.
  • Making the execution time of each operation of the circuit random is one of the important ways to combat differential power analysis.
  • the existing timing randomness methods are divided into two types: random delay insertion and out-of-order execution.
  • Soc """Instruction Stream Variation for Uncertain Processors introduces an "indeterminate processor” technique. Both of these techniques are applied to universal cryptographic processors.
  • the "random register renaming technique” introduces random selection only in the register renaming process; the uncertainty processor mines the instruction-level parallelism inside the program, and executes the instructions that can be executed in parallel at random. The former only introduces uncertainty locally, while the uncertainty of the latter is limited to adjacent instructions and is limited by the description of the original program.
  • the data stream out-of-order execution technique of the present invention is applicable to an ASIC chip.
  • the data stream mode is an operation mode that performs operations according to data dependencies.
  • the data flow mode adopts distributed control, so the load capacitance of the internal bus is small, according to the formula of the power consumption difference: ⁇ - ⁇ - 2 ) C 2 , the power consumption difference is proportional to the load capacitance, so a small load capacitance is beneficial. Reduce power consumption differential.
  • the power consumption of the integrated circuit is related to the processed data.
  • a bit (b) in the data takes 0 or 1
  • the power consumption distribution at each moment is different, and the random process Po (t) and ? 1 (t) indicates that t represents time.
  • DPA uses the mean test to determine whether the power consumption curve sample belongs to Po (t) or Pi (t).
  • the power consumption contains noise. According to the DPA theory, the number of samples required to determine the correctness should satisfy:
  • the power consumption difference becomes i3 ⁇ 4 times the original, and accordingly, the number of samples is increased by a factor of two. Therefore
  • Out-of-order execution can increase the cost of DPA attacks, and the higher the uncertainty, the smaller the ⁇ , the larger the number of samples required.
  • a data flow pattern is a computational mode that has no control flow and has no execution order restrictions other than data dependencies. It encapsulates the processed data into tokens.
  • a token is a fixed-length binary string that conforms to a certain format, each of which has a specific meaning. For example, the following token contains three fields: data field, source address, and destination address. Their position in the token is agreed: the lower 32 bits are the data field; the 37th to the 35th and 34th bits. The 32nd bit is the 3-bit target address and source address.
  • the data flow circuit implements token passing between various operations and operations of the algorithm.
  • When all the input tokens of a manipulation arrive (that is, the operations on which the operation depends have been executed), they can be "activated” - start processing the data, and package the resulting result into a successor passed to the new token. operating.
  • Control information is also communicated through tokens—for example, the data address in the example indicates the source of the data and the destination that should be sent after processing; some control commands are also encapsulated into tokens (control tokens) that are passed to the controlled Operation.
  • the data stream circuit has no central control circuit, and the data exchange has locality. Accordingly, the data bus and the storage unit are also distributed.
  • the triggering of data operations is conditional on whether or not the operand tokens are all arrived, and is a data-driven asynchronous operation. Its operations without data dependencies have no effect on each other and naturally implement parallel execution.
  • data stream computation has parallelism and functionality (that is, each operation is relatively independent, and irrelevant operations can be performed in any order.), distributed, and asynchronous.
  • An asynchronous circuit system each part of the circuit is connected through an asynchronous communication interface, called an all-in-one transmission channel.
  • the interface between the transmission channel and the outside is called a channel port, which is an abstraction of a set of signals: it consists of a set of data buses and request and response signals.
  • An asynchronous transfer channel includes the control terminals of the data latches and latches, as shown in Figure 1. The way it works is a communication protocol called a "handshake protocol":
  • An asynchronous integrated circuit has no clock, and the handshake protocol contains two types of control signals: a request signal and an acknowledge signal.
  • the request signal initiates a job and the response signal indicates that the job is complete. These two signals complete the timing control of all the operations in the system.
  • To implement the handshake signal with the circuit it is necessary to encode the alternate request and response signals into level or level changes on the control line.
  • the following is a typical 4-phase handshake protocol (see Figure 2):
  • the rising edge of the request signal informs the receiver that the data arrives, and the receiver is ready to accept the data and raises the response signal, indicating that it is ready to start reading data at the same time, the request signal is reset by the response signal, and the falling edge of the request signal is answered again.
  • the signal is reset and ready to accept the next data.
  • the data on the transfer channel is stored in a latch. (The latch has a control terminal. When the control terminal is low, the output changes with the input.
  • the control terminal When the control terminal is high, the data of the output remains unchanged.)
  • the control of the latch The terminal In the asynchronous transmission channel of the 4-phase handshake, the control of the latch The terminal is connected to the response signal, that is, the data of the sender is latched into the latch when the response signal is raised, and the data of the input terminal can be accepted after the communication process ends.
  • a timing control circuit called C unit In the asynchronous circuit, a timing control circuit called C unit is often used. This circuit has 2 inputs and 1 output, and generally has a reset terminal. When both inputs are all 1, the output is 1; Both inputs are all
  • Anti-DPA security based on streaming and cryptographic chips
  • the data flow mode does not explicitly define the execution order, so the execution order has maximum flexibility. Functionality makes out-of-order execution more convenient. The load of the distributed bus is small, and the corresponding power consumption characteristics are small. Asynchrony makes data Streaming is easier to implement in asynchronous circuits, and Simon Moore's paper "Balanced Self-Checking Asynchronous Logic for Smart Card Applications" discusses asynchronous circuits in implementing cryptographic chips. Aspects have advantages. Therefore, the present invention utilizes the above features of the data stream to implement an AES integrated circuit implementation of the data stream.
  • AES is the new Advanced Encryption Standard specification developed by the National Institute of Standards and Technology (NIST). This standard began public collection in 1997 to replace DES. In 2002, it was finally determined to adopt 128.
  • the Rijndael algorithm with a plain packet length supports three key lengths: 128 bits, 192 bits, and 256 bits.
  • the present invention can implement three key length AES encryption algorithms.
  • the Rijndael algorithm supports packet lengths of any 32-bit span between 128 bits and 256 bits, but the AES standard only supports 128-bit plaintext lengths, 128, 192 or 256-bit key lengths.
  • the operation of the AES algorithm is defined on the finite field GF ( 28 ).
  • the so-called GF (2 8 ) refers to a set of values from (00) 16 to (FF) I6 and defines the number field of addition and multiplication.
  • GF ( 2 8 ) addition is an exclusive OR (XOR) operation.
  • a column of states is called a "status word.”
  • the cryptographic key is a 4 ⁇ 3 ⁇ 4 matrix, which is allowed by the AES standard: the values are 4, 6, and 8, and the corresponding columns (4 bytes) are called "key words.”
  • the state word and the key word are used as basic operations in the invention, that is, the data field of each token is composed of a status word or a key word, and these two types of tokens are respectively referred to as Status token and key token.
  • All transformations of the Rijndael algorithm are state-based transformations.
  • the AES transformation is implemented by multiple iterations of the round function, and the number of iterations is different depending on the length of the key.
  • the iteration round is denoted by N", and Nk is equal to 4, 6, and 8 corresponding to NT" are 10, 12, and 14, respectively.
  • the byte substitution operation is a reversible non-linear byte substitution operation. This conversion is performed for each byte in the packet, and the operation of the byte follows a substitution table, that is, the S box. For a byte, take the first 4 bits as the X coordinate and the last 4 bits as the y coordinate, you can find a corresponding item in the S box to replace the original data. This is what Srd ⁇ does.
  • the contents of the S box are as follows:
  • the column mix replaces the column status word with a value obtained by multiplying a constant matrix by the status word.
  • the transformation relationship is expressed in the form of a matrix operation as shown in Equation 1.
  • ⁇ , ⁇ 2 which are the bytes of the 0th row to the 3rd row in turn, the 4 bytes of the obtained result are b 0 , bi, b 2 , b in order.
  • Key expansion is the process of extending an initial cryptographic key into a round key.
  • the extended keys are arranged in an extended order.
  • the Rijndael algorithm requires 4 ⁇ 4 round key bytes per round. Each column of 4 bytes is called an extended key word, and the round key of the ith round is the 4th of the extended key sequence. 'Column to 4' + 1) - 1 column gives, the total number of extended keys is 4 (N/-+1) words.
  • the key extension function depends on the value of:
  • the first M: column of the extended key sequence is the cryptographic key (or initial key), and the subsequent columns are determined recursively from the previous columns. The recursive function depends on the position of the column.
  • the column is a bitwise XOR of the ZM column and the ⁇ ⁇ -1 column; otherwise, the / column is the /-: column and column A bitwise XOR of a nonlinear function (represented by the letter f).
  • This non-linear function can be implemented in the following way: Srd is applied to the 4 bytes of the column, and a cyclic shift of the bytes in the column is added, and a round constant is added. This round constant is independent of: and is defined by a recursion rule in GF(2 8 ) -
  • the multiplication 2 operation here is also an operation in the finite field GF (2 8 ).
  • the Zth column is also a bitwise XOR of a nonlinear function of the column and the -1 column.
  • This nonlinear function is the 4 words that apply Srd to the column. On the section, it is indicated by the letter g .
  • the content of the data stream calculation is the processing of the token, including the creation (transmission), parsing, processing, and temporary storage of the token and the matching of the tokens.
  • the tokens of each operand often do not arrive at the same time, so a temporary storage unit is needed to temporarily store the arrived token, and then "match" all the arrived tokens.
  • the (or more) ready operand tokens are packaged into new tokens that are transmitted to the processing unit.
  • the present invention employs a new circuit for token matching, referred to as a token temporary-match-transmit structure, represented by HMF.
  • the out-of-order execution control is implemented in the HMF structure.
  • the circuit randomly selects one of the transmissions, if only one or a group of tokens is successfully matched. Then send a token that matches successfully.
  • Each of the arithmetic unit and ciphertext output unit in the present invention has its own temporary storage-matching-emission structure.
  • the key expansion can be iteratively implemented using the arithmetic structure shown in FIG.
  • This structure contains continuous XOR operations and nonlinear transformations f and g, we will lose 5
  • the continuous-OR operation of the -4 output is implemented by the circuit shown in Figure 8, and is named KeySch operation, where /, k 2 , k, , ⁇ and f are input key words, y 3 , y 2 , y x , : F. Is the output key word.
  • Nk The specific implementation algorithm for different values of Nk is shown in Figure 9, where the operation marked with * is the operation starting at each iteration.
  • the result of the segment KeySch calculation is taken as the low segment of the new packet.
  • the extended key named in this paper to generate the intermediate key word is the transformed key word
  • the transformed key words for generating f and g respectively are the transformed key word 1 and the transformed key word 2.
  • the nonlinear transformation of the key extension is also performed in the round function execution unit, and the Srd operation unit is shared.
  • the token processing flow of the above key expansion method is as shown in FIG. 10a. After the initial key is saved to the cache unit, it is checked first. If the key is found, it is forwarded to the "round transform loop", and after the corresponding nonlinear transformation, f or g, the result is written to the key. Intermediate key word unit in the memory. On the other hand, in the key conversion ring, the tokens in the key buffer are repeatedly checked, and the token group to be executed by the KeySch operation is subjected to a KeySch operation, and the result is written back to the corresponding address of the key buffer unit. If it is found that the key expansion has been completed, the stop condition is that the token round of the round change ring reaches the last round.
  • the processing flow of the state token in the present invention is as shown in Fig. 10b.
  • a list of tokens first performs an AddKey operation with the corresponding round key sequence, and then checks the round of the resulting token. If the round is equal to Nr, the token data is cached in the output buffer unit, when the output buffer unit is full.
  • the operation ends; if the round is less than Nr, it is checked whether the token completing the AddKey operation can constitute a new token that performs the MixCol operation (known by the AES algorithm, the MkCol operation of a column state depends on 4 columns) The AddKey result.), if the match is successful, the relevant 4 status bytes are repackaged into a new status word token, and the Srd and MixCol operations are performed in sequence. The addresses of the four status words are reversed according to their relationship in the same column after ShiftRow. So the token being sent is the result of ShiftRow. For the last round of tokens, only the Srd operation is performed. The result state after the round transformation is executed is returned to the status token temporary storage unit, and a new round of calculation is started. Summary of the invention
  • the present invention is a data stream mode AES encryption integrated circuit structure with out-of-order execution characteristics and capable of resisting differential power analysis attacks. This structure processes one data packet at a time, and the next packet can be processed after the previous packet is processed.
  • the data stream AES encryption circuit of the out-of-order execution of the present invention is mainly characterized in that the circuit structure is implemented on a data stream encryption application specific integrated circuit, and the circuit structure complies with the advanced data encryption standard using the Rijndael algorithm as the final algorithm. Recorded as AES, using the data stream mode to achieve out-of-order encryption, the circuit structure contains:
  • the transmission channel is the data transmission interface between the two components.
  • the transmitted data is the corresponding numbered token, including a token input data bus, a data output bus and input request and response signals, and output requests and responses.
  • Signal, the interface of the transmission channel and the external is a channel port;
  • the input unit is an interface between the chip core and the external, and realizes the function of inputting the plaintext and the key according to the timing required by the protocol and sending the plaintext to the kernel part through the 4# transmission channel, and writing the key into the initial key memory.
  • the reset signal InterR S t_ and the initial key placement signal load required for each unit of the kernel in the circuit structure are generated;
  • the token transmitted by the 4# channel is named as token 4 and includes a 32-bit data. Domain, a 2-bit column field;
  • c channel switching unit Switch is a switching switch of 2 transmission channel input-2 transmission channel output, in addition to receiving input signal WK from working status register, when WK), the channel switching unit is in idle state, receiving the input After clearing the plaintext data sent by the unit via the 4# channel, the data is repackaged into a status word token and sent to the 5# channel, and the token transmitted by the 5# channel is named as token 5 A 32-bit data field, a 4-bit color field representing a round and a 2-bit address field.
  • the data field of token 5 directly copies the data field of token 4, token 5
  • the token is repackaged into a token and sent to the 5# channel, and the key token is repackaged into a token and sent to channel 6; the token transmitted by the 3# channel is named token 3 including one 1 person
  • the attribute field and a 32-bit data field When the attribute field is equal to 0, it is a status word token. It also includes a 1-bit operator field, a 2-bit column field, and a 4-bit color field.
  • the data field When packaged into token 5, the data field directly replicates the data field of token 3, the color field directly replicates the color field of token 3, and the address domain directly replicates the column domain of token 3, when the token 3 attribute domain is equal to 1
  • token 6 When it is a key word token, it also includes a 1-bit fadd bit and 6 bits of data that are not of interest.
  • the token sent to the 6# channel, named token 6, is the intermediate key word described below.
  • the token including a 32-bit data field and a 1-bit address field, is packaged into token 6, the data field of token 3 is directly copied to the data field of token 6, and the fadd domain is copied to token 6.
  • the initial key storage is a 256-bit register set, receives a clock signal and input cryptographic key data from the input unit, and directly receives the cryptographic key from the input unit; e.
  • AK temporary storage Unit which is a token temporary storage unit to be executed, including a key word memory, State word memory and token parsing and packing circuit, wherein the key word memory has 8 key word storage units, 2 intermediate key word storage units, and two 5-bit internal memories: BLOCKH and BLOCKL and a 2-bit state
  • the register KES has a 3-bit address in the storage area of the key word, and the address space represented by the binary is 000-111, and sequentially stores the extended key words of the sequence number modulo key group number Nk equal to 0-7, and the high segment is 100-111.
  • each of the storage records includes a 32-bit data field, a round conversion flag bit, and an extension flag bit;
  • the data stored in the unit of the key word memory having an address equal to Nlc-1 is called Transform key word 1, when Nk is not equal to 4, the record data whose address is equal to 3 is called transform key word 2, and when Nk is equal to 4, the transform key word 2 is record data whose address is equal to 7;
  • the state word storage area has 2
  • the bit address the address space represented by the binary is 00-11, and sequentially stores the 0-3th column in the state, and each record includes a 32-bit data field and a 4-bit color field;
  • the intermediate key word storage area There is an address space: 0-1, in turn Storing an intermediate key word from channel port 6, which is a calculation result of a nonlinear function defined in the AES key expansion algorithm, each storage record including a 32-bit data field;
  • Each memory location of the temporary memory location of the memory and intermediate key word memory area corresponds to a "full/
  • the flag When the cell is written, the flag is set to 1, indicating full, and the flag is read after the data is read. Set to 0, indicating null; the "full/empty" flag of each memory location of the key word memory is set to 1 when the unit round conversion bit and the extension bit are both equal to 0, and both bits are equal to 1 is set to 0, indicating null; the BLOCKH stores the "packet value" of the high segment key word, BLOCKL stores the "packet value” of the low segment key word, and the "packet value” refers to all round extended key sequences After the Nk groups are grouped, the sequence number of the obtained group is expanded by the initial key, and the total length of the extended key is 4 (Nr+l), and Nr is the number of iteration rounds;
  • the AK register unit has three input channel ports: channel 5 port receives token 5 and writes The word storage area, the address written is the value of the address field of the token 5, the data field and the color field of the status word record are equal to the data
  • the key word area, the write address is the value of the address field of the token 6, the data field of the write record is equal to the data field of the token 6, and the channel 9 port receives the new extended key word token and writes the key word.
  • a storage area in addition, the key word storage area further has a set port connected to the output end of the initial key register, 256 bits wide, and the load signal is used as a signal;
  • the AK register unit has Two output channel ports; the channel 7 port sends an operand token for the AddKey operation or the conversion key word forwarding, and the channel 10 port transmits the operand token for the key expansion operation;
  • the channel 9 port transmitted token includes four 32-bit data fields k 0 -k 3 , a 5-bit BLOCK field and a 1-bit part field, part equal to 0
  • k 0 -k 3 are sequentially written into the unit of the key word storage area address 000-011
  • the address is represented by binary
  • the BLOCK value of the token 9 is assigned to BLOCKL
  • the round transformation flag bits of all the low-level units are simultaneously
  • the extension flag bit is reset to 0, part is equal to 1
  • k Q -k 3 is sequentially written into the unit of the address word storage area binary representation of 100-111
  • the BLOCK value of the token 9 is assigned to BLOCKH
  • the round transform flag bit and the extended flag bit of all the high segment units are reset to 0;
  • the token sent by the port 7 port is named token 7. It includes two 32-bit data fields datal and data2, and a 1-bit attribute field. The value of the attribute field is equal to the following AorT signal when transmitting. Value: When AorT is equal to 0, the AddKey operation is performed. Token 7 is a status word token. It also includes a 4-bit color field and a 2-bit column field. When packing, copy the value of the ssel signal described below.
  • the data field of the stored record is copied to the data2 field of token 7, the response signal of the channel 7 port will read the status word record, and the rounded bit of the read key word record will be changed to 1; when AorT is equal to 1
  • the token 7 is a key token, and includes a 1-bit operator field, a 1-bit fadd field, and 4 bits of unintentional data in addition to the data field and the attribute domain.
  • the token sent by the channel 10 port is named token 10, and includes a 32-bit intermediate key field, four 32-bit key fields k Q -k 3 , a 5-bit BLOCK field, and A 1-bit step field, the step field of the token 10 is equal to the value of the step signal when the token is sent, and the intermediate key field of the token 10 when the step signal is equal to 0 when the token is sent.
  • the extension bit of the word is set to 1.
  • the intermediate key word field of the token 10 is equal to the recorded data of the address equal to 1 in the intermediate key word storage area, the token 10
  • the value of the BLOCK field is equal to the value of the BLOCKH register, and the response signal of the channel 10 port sets the extension bits of all key words in the high section of the key storage area to 1;
  • the state is represented by binary code
  • the initial state binary code of KES is 00, that is, the state of preparation/calculation, after performing the transformation key word 1 forwarding in this state
  • KES binary coding When it is changed to 01, the state in which the f-transformation is performed is performed.
  • the state of the ES changes to 11
  • the state in which the calculation g is prepared the transformation key is executed in the state of 11.
  • KES status change after word 2 operation 10 enter the state of performing g transformation, and when the key is read in 10 state for key expansion, the state of KES changes to 00;
  • a working status register transmitting a WK signal to the input unit, transmitting a WK signal to the channel switch unit Switch, receiving an OK signal from a Matcher OK unit described below; and resetting the WK when the OK signal rises;
  • the Matcher II matching unit checks the status word storage area and the key word storage area in the AK register unit, and finds that the ready status word-key word pair or the ready conversion key is randomly selected one of them.
  • the address selection signal is transmitted to the AK register unit, and then the token transmission signal fetch_II is triggered.
  • the selection signal includes an AddKey status word read address marked for ssel, and a key word read address labeled ksd.
  • the signal labeled AOTT indicating the operation to be performed by the transmitting token - 0 indicates the AddKey operation, 1 indicates the conversion key word forwarding, and is labeled Trans;
  • the input of the Matcher II matching unit includes: the status word of the AK register unit
  • the observation signal of the memory area and the key word storage area including the color bit and flag bits of the status word record, the round conversion flag bit and the extended flag bit of the key word record, the flag field, BLOCKL and BLOCKH, KES, and The number of key grouping columns Nlc;
  • the "ready” means: calculating the sequence numbers of all observed status words and key words, looking for the same sequence number and flag is 1.
  • fetch_II a word-key pair, or detecting and finding a corresponding transform key word according to the KES state; when the fetch_II signal arrives, triggering the AK temporary storage unit to send the token to the 7# channel; when being sent The status word is cleared, or the KES status changes, then fetch-II is reset;
  • Matcher K matching unit checking the observation signal of the key word storage area and the intermediate key word storage area: round transformation flag bit and extension flag bit, flag and KES state; when KES is in key extension state, and corresponding key
  • the key extended read address marked as step becomes the corresponding value: 1 is the high segment extension, 0 is the low segment extension, and triggers the token transmit signal fetch — K
  • the AK register unit packs the corresponding data of the key area and the BLOCK value into a token waiting for transmission according to the step signal, and when the fetchJ signal comes, triggers the AK temporary storage unit to send the token through the channel 10;
  • the following exp-stop signal is valid, and the Matcher K matching unit stops working.
  • the key expansion operation unit which is marked with Key Schedule, receives and parses the token from channel 10, and is packaged into an inclusion after the following Key Schedule processing.
  • the token of the new extended key is sent via channel 9, and the processing of the Key Schedule contains the following operations:
  • the result of adding 1 to the BLOCK field of the token 10 is taken as the BLOCK value of the token 9; ⁇ 13.
  • the AddKey operation that is, the round key addition operation defined by the AES algorithm acts on a column of states; the token sent via the channel 8 is named as token 8, and includes a 32-bit data field and a 1-bit attribute field.
  • the attribute field is a status word token, and also includes a 4-bit color field and a bit column field.
  • the attribute field is equal to 1
  • it is a key token and also includes a 1-bit operand field.
  • a 1-bit fadd field when packing, the result of bitwise XOR of the data1 and data2 of the token 7 is the result of the token 8, and the remaining fields of the token 7 are directly copied to the domain of the same name in the token 8.
  • the token transmitted by channel 11, named token 11, includes a 32-bit data field and a 2-bit column field.
  • token 11 When packing, the data field of token 8 is directly copied to the data field of token 11, The column field of the card 8 is directly copied to the column field of the token 11;
  • token 1 is a status word token, including a 32-bit data field, a 4-bit color field, and a
  • the 2-bit column field is packed with a 1-bit operator field and a 1-bit attribute field
  • the data field and the column field of token 8 are directly copied to the domain of the same name in token 1, and the color field of token 8 is added.
  • the result after 1 is the color field of token 1, the attribute field of token 1 is equal to 0, and if the color field of token 8 is equal to Nr-1, the operator field of token 1 is marked as Srd operation, otherwise token 1 Operator field flag bit SM operation;
  • the token 1 sent by channel 1 is a transformed key word token, including a 32-bit data field, a 1-bit operator field, and a 1-bit fadd. Domain and 5 bits of data that are not of interest.
  • the fields of token 8 are directly copied to the domain of the same name in token 1;
  • the output temporary storage unit is a ciphertext rearrangement temporary storage unit, which is composed of a 4 ⁇ 32-bit storage unit and a token parsing circuit, and the unit receives the denseness carried by the result token of the out-of-order arrival of the channel 11.
  • the text data is temporarily stored, and the written address is the column field of the token 11, and the written data is the data field of the token 11, and the corresponding secret is output after receiving the read address signal of the output unit described below.
  • a status word to the following output unit each of the storage units of the temporary storage unit corresponds to a flag The "full/empty" flag bit, when the unit is written, the flag is set to 1, indicating full. When the data is read, the flag is reset, indicating that it is empty;
  • the unit is an interface between the chip and the external, and realizes a function of outputting the ciphertext according to a required timing, and the output is sequentially generated from 00 to 11 every time it detects that the OK signal is high level a read address of the temporary storage unit, the address is a binary representation, the secret text of the output temporary storage unit is read, and the ciphertext packet is output according to the output protocol;
  • Matcher OK matching unit check all the flag signals in the output temporary storage unit, when all the flags are 1, it means that all the secret words have arrived, then the end signal OK becomes high, at the notification station
  • the working state memory is also notified to the output unit to read the ciphertext status word of the output temporary storage unit, and when the flag is reset, the OK signal becomes a low potential;
  • the EU register unit is composed of a key word storage area and two identical state storage areas, which are sequentially labeled as key store, storeO, and storel; wherein, the key store stores the key expansion conversion key word,
  • a storage record consists of a 32-bit data field, a 1-bit fadd field, and a 1-bit operator field.
  • storeO/storel stores the 0th to 3rd columns in the "state" before the row shift, and each column stores
  • the unit is further divided into 4 lines, and the record of the 0th line includes an 8-bit data field, a 4-bit color field, and a 1-bit operator field, and the records of the 1st line to the 3rd line contain an 8-bit field.
  • the unit has a transmission channel port, receiving station
  • the round update channel switch unit sends a token 1 via channel 1, from which the token type is parsed: a status token or a key token, a write address and a record data, and writes the record to the corresponding storage unit; an output
  • the transmission channel port is connected to channel 2, and outputs the corresponding status word or conversion key word according to the read address input by the Matcher I matching unit, the storeO/storel selection signal, and the state/transform key selection signal, together with other control signals.
  • each of the above three temporary storage areas corresponds to a "full/empty" flag bit labeled flag, and flag is set when the unit is written. , indicates full, flag is reset after data is read, indicating empty;
  • the token resolution method is: when the attribute field of the token 1 is 0, it is a status word token, the write address is the column field of the token 1, and the data of the 0th line of the record is written.
  • the field is the 7 to 0 bit of the token 1 data field, the color field of the 0th line is the color field of the token 1, the operator field of the 0th line is the operator field of the token 1, and the first line of the record is written.
  • the data to the third row are respectively 15 bits to 8 bits, 23 bits to 16 bits, and 31 to 24 bits of the token 1 data field; when the attribute field of the token 1 is 1, it is a key token.
  • the data field of the token 1 is copied to the data field of the transformed key word storage record, and the fadd field and the operator field of the token 1 are directly copied to the variable Change the key word to store the record in the same name field;
  • the token sent via channel 2 is named token 2, and its packing method is: when the state/transform key selection signal is equal to 0, token 2 is a state word token, attribute The field is equal to 0, the 7 to 0 bits of the data field are the data fields of the 0th row of the address equal to the read address of the Matcher I matching unit input, and the 15 to 8 bits of the data field are the row shifts defined by the AES algorithm.
  • the calculated address is equal to the data field of the first row of the read address, and the 23 to 16 bits of the data field are the data after the row shift operation defined by the AES algorithm is equal to the data recorded in the second row of the read address.
  • the 31 to 24 bits of the data field are the data fields of the third row of the read address after the row shift operation defined by the AES algorithm, and the color field and the operator field of the token 2 are equal to the address respectively.
  • the color field and the operator field of the 0th line of the read address, the column field of the token 2 is the value of the read address; when the state/transform key selection signal is equal to 0, the token 2 is Key from token, domain equal to 1,
  • According domain is a domain key stored in the transformation data records, fadd operator domain and domain are fadd operator domain and transform domain key stored records;
  • the Matcher I matching unit checks the token information in the key store and storeO/storel, finds the ready status word or finds the transformation key after considering the row shift transformation, and randomly selects one, and sends the address information to the EU temporary storage. a unit, and triggering a trigger signal of the channel 2 port by a fetch_I signal, and transmitting the token 2 of the EU temporary storage unit to the EU operation unit; the input of the Matcher I matching unit includes the EU temporary a signal of the observation port of the memory unit, a response signal of the channel 2 port, and a random signal of the control selection; meanwhile, outputting the fetch_I token transmission signal to the EU register unit;
  • the global memory stores the key grouping number Nk, the number of iterations Nr, and outputs Nk to the EU register, the following EU operation unit, the Matcher II unit, and the key extension operation unit, and updates the channel switching unit to the wheel.
  • the EU operation unit receives the token 2 from the channel 2, and after parsing, performs corresponding calculation on the data domain according to the attribute domain and the operator domain of the token 2 and the number of key grouping columns Nk, and the operation result is packaged into the token 3
  • the data field is sent through channel 3.
  • the token 3 has a 1-bit attribute field in addition to the data field, and its value is equal to the attribute field value of the token 2: when the attribute field is equal to 0,
  • the status word token there is also a 4-bit color field and a 2-bit column field; when the attribute field is equal to 1, it is a key word token, there is also a 1-bit fadd field, and 5 bits do not care.
  • Data when packaged, the fadd field of token 2 is directly copied to the fadd field of token 3; the calculation for the token data field includes:
  • the Srd-MkCol operation is performed when the attribute field of the token 2 is equal to 0 and the operator field is the SM tag, that is, the Srd table lookup operation defined by the AES algorithm is performed on each byte of the data field, and then The 4-byte result vector is left-multiplied by a 4 ⁇ 4 constant matrix, wherein the constant matrix is a constant matrix corresponding to the column mixing operation defined in the AES algorithm;
  • the direct forwarding operation is performed when the attribute field of the token 2 is equal to 1 and the operator field of the status token is 1 and Nk is less than or equal to 6, that is, the data field of the token 2 is directly copied to the token 3 Data field; the operation when the token 2 attribute field is equal to 1 and the operator field is 1 is the operation of the above g transform under Nk and equal to 6;
  • a Matcher II random control code generating circuit randomly generates a 3-bit random selection code for controlling an arbitration circuit in the Matcher II matching unit, and generates a new random control code each time fetch-II falls;
  • a Matcher I random control code generating circuit Randomly generating a 3-bit random selection code for controlling the arbitration circuit in the Matcher I matching unit, and generating a new random control code each time fetch_I falls;
  • the above-mentioned Matcher II unit and the AK temporary storage unit constitute an AddKey operation unit.
  • the token temporary storage-matching-transmitting structure referred to as the HMF structure
  • the Matcher I unit and the EU temporary storage unit constitute the HMF structure of the EU computing unit
  • the key storage area of the Matcher K and AK temporary storage unit constitutes the HMF of the KeySchedule unit.
  • the structure, the Matcher OK and the output temporary storage unit constitute an output HMF structure;
  • the HMF structure has the following characteristics:
  • U2 Contains a token temporary storage unit, implemented by the register file, the write port uses the asynchronous handshake protocol; the write address and write data are parsed by the input token, and the write clock is triggered by the request signal of the input channel port; The address is determined by the selection signal output by the matching unit described below, and the output data changes instantaneously with the read address; the output data port and the read address port are connected to the data port of the output channel port of the HMF via a token packing circuit described below; internal storage The unit corresponds to a "full/empty" flag indicating whether the record exists. Only when the record is "empty", the address can be written, the full-empty flag of all cells and the data of the domain associated with the following matching conditions are recorded.
  • the observed signal can be read by the following matching unit; the output data can be packed by the following token Logic read; the full-empty flag bit is generated by a c-unit, one end of the c-unit is connected to the write clock corresponding to the record, and the other input is connected to the inverted signal of the recorded clear signal signal; The clock is generated by the write response of the write port by the write address, and the clear signal of each record is generated by the read signal of the HMF output channel port by the read address;
  • U3. Contains a matching unit, which is composed of two parts: matching logic and selection logic circuit.
  • the observation signal input matching logic circuit of each record of the temporary storage unit calculates the matching result value according to the Boolean expression corresponding to the matching condition, and the matching result is successful. Is 1, otherwise equal to 0; each matching result signal is output to the input of the selection logic through the primary C unit as a request signal, and the other input of the c unit is connected to the OR signal of all request signals, only the request When the signal is all 0, the matching result equal to 1 can be passed to the selection logic circuit.
  • the request signal When there is a valid request in the request signal, the request signal is 1, and the established matching result generated after it cannot pass the C unit; After the token is sent, the request is reset, and the C unit is turned on for the established matching result; the selection logic of the Matcher I and Matcher II units is an arbitration logic circuit, and the request signal of each detected token group is randomized.
  • the selection circuit of the Matcher K unit is to calculate the step signal corresponding to the request for successful matching;
  • the Matcher OK has no selection circuit;
  • the request sequence output by the selection unit of the matching unit is output as a token through the latch a selection signal; selecting the corresponding request signal according to the selection of the selection signal to become a token transmission trigger signal, such as the fetch_II, fetch_I, fetch_K signal; u4.
  • the token transmission trigger signal passes the length a control terminal that triggers the latch of the selection signal after the delay of the longest time required to select the circuit output is stable, latches the latch, and simultaneously triggers a request signal for transmitting the token;
  • the request signal and the selection signal The sum signal of the control signal of the stored device is the request signal of the HMF output channel port;
  • the token packing circuit is a combined circuit whose input is the output data and the read address of the token temporary storage unit, and the output thereof is in accordance with the output channel order Data defined by the card; a reset response signal of the temporary storage unit will latch the selection signal
  • a control terminal to reset the latch is turned on, re-select signal matching with the change in output select logic unit.
  • the asynchronous handshake protocol is used for all transmission channels; the data processing and token packing of all the arithmetic units are implemented by the combinational logic circuit; the channel switching unit Switch, the initial key register, the AK register unit, The Matcher K matching unit and the key expansion operation unit together constitute a key extension ring, and the channel switching unit Switch, the Matcher II matching unit, the AddKey operation unit, the round update channel switch unit, the EU register unit, the Matcher I matching unit, The EU arithmetic unit constitutes a wheel change ring, and the ring is connected by a transmission channel, and the ring is connected by a switch unit Switch.
  • Verilog and circuit and simulation of the final streamer circuit The verilog test covers all known answer verifications provided by the AES standard official website, all passed.
  • the following test is performed on the experimental chip: In the case where all bits of the key are equal to 0 and all bits of the key are equal to 1, respectively, the same 128-bit plaintext packet is encrypted, and the sequential control code is randomly generated, and in each case, each acquisition 40
  • the power consumption curve is used to obtain the absolute difference curve of the samples of the two groups of samples; the two power consumption curves obtained by encrypting the all-zero key and the all-one key under the same sequence control code are used to obtain the absolute difference curves of the samples.
  • the two differential curves are shown in Figure 11. In the figure, it is determined that the maximum power consumption difference obtained by sequential execution is larger than the maximum power consumption difference obtained by out-of-order execution.
  • the maximum power consumption difference obtained by the experimental execution sequence is approximately equal to 0.059 W, and the maximum power consumption difference obtained by out-of-order execution is approximately equal to 0.030 W. , is 50% of the former.
  • the kernel's throughput rate ranges from 59M to 63Mbps, and the energy consumption of encrypting a packet is 52.9nJ (less than the energy consumption of similarly announced chips).
  • Figure 1 4 phase handshake protocol transmission channel.
  • Figure 2 4 phase asynchronous handshake protocol.
  • Figure 3 4 phase handshake protocol asynchronous transmission channel implementation circuit.
  • Figure 10 Flow chart of the AES implementation algorithm of the present invention (a) Key token processing flow; (b) State token exit flow. Figure 11 Power consumption differential curve for all 0 keys and all 1 keys UES-128.
  • Figure 12 is a block diagram.
  • Figure 13 Input module circuit structure.
  • FIG. 15 Schematic diagram of the HMF structure.
  • FIG 16 The basic structure of the token register (4 units).
  • Figure 18 4 select 1 arbiter circuit (a) R-boxO (b) R-boxl (c) overall circuit.
  • Figure 19 is a logic diagram of the transmit circuit.
  • FIG. 24 Transfer relationship of token 1 to EU temporary storage unit (a) Status token (b) Key token.
  • Figure 25 EU temporary storage unit stores the transfer relationship recorded to token 2 (a) status token (b) key token.
  • Figure 26 Transfer relationship from token 2 to token 3 (a) status token (b) key token.
  • Figure 27 Flow of various operations of the EU unit: (a) Srd operation (b) SM operation (c) RC operation.
  • Figure 28 Transfer relationship between token 3 to token 5 and token 3 to token 6 (a) token 3 to token 5 (b) token 3 to token 6.
  • Figure 33 Transfer relationship from token 7 to token 8.
  • Figure 34 Transfer relationship between token 8 to token 1 and token 11 (a) ciphertext token transmission (b) status token round update (C) key token forwarding.
  • the input and output data buses are all 32 bits.
  • the input and output modules are easily embedded in the synchronous circuit system by means of a synchronous circuit.
  • the key column number (Nlc) and the initial key are first sent to the chip's internal setup register and initial key register via the data input bus before starting the encryption.
  • the plaintext packet is then sent to the chip.
  • the encryption operation is then initiated by an external signal.
  • the ciphertext status word is first stored in the output register. When the entire ciphertext packet is generated, the end signal (OK) goes high and the resulting data can be read from the data output bus.
  • the data in the initial key register is rewritten to the internal key register.
  • each module in the THDFAES04 structure is exactly the same as that described in the present invention, and two asynchronous pipeline loops of "round change loop” and "key extension loop” Composition.
  • Each transmission channel in the figure is marked with a number, and each channel transmits a fixed token format, which is the corresponding token number.
  • a global register storing the WK, the Nk and the Nr is further included, and there are two identical and independent random control code generating circuits in the circuit, respectively, and random control codes are provided for the arbitration circuits of the Matcher I and the Matcher II respectively. , named random sequence control sequence register I and incoming random sequence control sequence register II.
  • the specific implementation of each component in the implementation is as follows - 5.1 transmission channel and channel port:
  • the transmission channel is indicated by a hollow wide arrow and the arrow indicates the direction of data transmission.
  • the data transmitted is the corresponding numbered token.
  • THDFAES04 uses the asynchronous transmission channel of the 4-phase bundled data handshake protocol.
  • Figure 13 is a circuit diagram of the input module, wherein the CKIN signal is an input clock, and the external input signal further includes an input data bus, a start signal, a reset signal, an address signal, and an enable signal.
  • the reset signal resets the entire chip.
  • the control circuit controls the input data distribution logic according to the input address, and stores the input data into the corresponding register:
  • the plaintext is stored in the plaintext buffer, which is a serial input, parallel output shift register, which can store 32-bit plaintext data;
  • the key is stored in the initial key register of the kernel portion; the Nk value is stored in the Nk register; the random sequence control sequence is stored in the random sequence control sequence register I and the incoming random sequence control sequence register II of the kernel portion, respectively.
  • the control circuit includes a counter for recording the current plaintext number, and the output of the plaintext buffer is connected to the packing logic circuit, the lower 2 bits of the counter are used as the column field of the token 4, and the output of the plaintext buffer is used as the data field of the token 4.
  • the trigger channel 4 port sends the token 4 output from the packet circuit to channel 4.
  • the start signal triggers the load signal to place the data in the initial key register into the key storage area of the AK register unit, and the load signal triggers the WK signal to go high.
  • the InterRst-signal of the invention is generated by the control circuit.
  • the output module is a synchronous circuit.
  • the input signal includes the data output of the output temporary storage unit, the OK signal and the external reading clock CKOUT.
  • the output port includes the output data bus, the 2-bit read address of the output temporary storage unit and the read erase. In addition to the signal (OUTACK:).
  • Figure 14 is a circuit diagram of the output module.
  • the control circuit triggers the cpl signal after receiving the rising edge of OK, causing the address accumulator to start working - adding 1 every 2 clock cycles from 0, the output of the address accumulator is Is the read address of the output buffer unit, the output buffer is a shift register for the parallel input serial output, and the ren signal is its set control terminal. Ren is valid before each address change. When ren is valid, the output of the output buffer unit is placed in the output buffer on the falling edge, then ren is reset, and the rising edge of each CKOUT serially outputs the output buffer data to the output data port. . Each time the ren signal is reset, a positive pulse of the OUTACK signal is triggered, and the record in the output buffer unit is cleared.
  • the initial key register is a 256-bit register bank that holds the key written by the input module. Its clock terminal is the load signal.
  • rand is the random selection code described in the invention, referred to herein as a sequential control code.
  • the solid wide arrow in the figure indicates the transmission path between the HMF and the outside.
  • WA and WD represent the write address and input data port of the scratchpad, and RA and RD represent the read address and the output data port, respectively.
  • the way it works is: The externally entered token is first stored in the scratchpad. Each token record in the scratchpad has a corresponding "full/empty" flag (flag), which is set to 1 when data is written. The high level of the CLR signal after reading out clears the record pointed to by RA. (The corresponding flag bit is reset). CLR_done is the acknowledge signal of the CLR signal, and its falling edge indicates that the flag reset is complete.
  • Tags thereby calculating their matching function (propositional formula of matching condition) as the matching result of the invention.
  • Fetch is the token emission trigger signal of the invention.
  • Select is the selection signal of the invention, address is the read address of the token temporary storage unit of the invention, and data is the output data of the token temporary storage unit of the invention.
  • the packet is sent to the execution unit as a new token.
  • the response signal from the execution unit triggers the clear drive CLR port, at which point the transmit circuit enters the idle state again.
  • the transmitting circuit does not process the new transmission request during the transmitting operation.
  • FIG. 16 is a schematic diagram of a 4-cell register with only one memory cell drawn. Each group of cells consists of a set of registers and a flag flag circuit.
  • the rising edge of the register clock (elk) sets flag to 1 when clr is 0.
  • the positive pulse of the clear signal (clr) resets the flag when elk is 0.
  • WA and WD are parsed by the input token, and reqin and ackin represent the write request and write acknowledge signal for the input channel port, respectively.
  • the request can only be accepted when the flag signal is 0, and the data is written to the register after the write request is accepted.
  • the output data is directly output through the primary multiplexer (MUX), and the RD changes instantaneously with the RA.
  • the selection of the CLR signal by the RA triggers the clr signal of the corresponding unit.
  • the CLR_done falls as a flag for the end of the record clearing process.
  • Figure 17 is a basic 4 request matching unit structure consisting of a matching logic portion, a request arbitration portion, and a selection hold-request blocking circuit.
  • the matching logic part implements the matching function calculation, which is implemented by the combination circuit, and the calculation result is sent to the arbiter through the C unit to become the request signal.
  • the arbiter in THDFAES04 uses the R-box circuit in the May D. paper, as shown in Figure 18, which is a 4-to-1 arbitration logic. 10 ⁇ 13 indicates the input request, and A0 and A1 are the serial numbers of the selected request.
  • the time when the scratchpad reads and writes data is uncertain.
  • the signal of the observation port may change at any time, and the output of the arbiter also changes continuously. Therefore, it is necessary to synchronize the select signal and the token data to ensure the output channel.
  • the output data of the transmitting circuit is stable when the request signal is valid. Therefore, a select latch is provided at the output of the arbiter.
  • the C unit and the 4 input OR gates in the figure constitute a feedback blocking circuit.
  • the blocking circuit makes the arbiter output stable after a certain period of time. After the fetch rises, the same delay is used to resample the select to avoid "adventure".
  • Figure 19 is a logic diagram and main signal waveform diagram of the transmitting circuit portion.
  • the registers R and C are the receiving channels of the token; the shaded circuit is the generation circuit of the address latch signal lock; req and ack are the request and response signals of the output channel port, respectively, ackout is the next stage circuit Response signal.
  • the remaining signals correspond to Figure 15; are delay units for delay matching.
  • the initial state of all timing elements in the circuit is all 0, and the rising edge of fetch becomes the fetch_d signal after the delay of (select stable time).
  • the rising edge of fetch_d first triggers the lock signal, latching the sequence number of the valid request.
  • Req is output by the lock gate.
  • the lock signal remains at the ⁇ level for the time between the rising edge of req and the falling edge of clr-ack.
  • the AK temporary storage unit port includes: three input channel ports, channel 5 ports receive status word tokens; channel 6 ports receive non-linearly transformed intermediate key words f, g tokens; channel 9 ports receive new extended keys Word; There are two output channel ports: Channel 7 port sends the AddKey operand token (Token 7); Channel 10 port sends the key extended operand token. The packing function of each token is shown in the token transmission part. In addition, there are also number ports: including initial key input bus, load, WK signals.
  • the key word storage area has eight key word record storage units and two intermediate key word storage units.
  • the address space of the key word storage space is (000) 2 -(111) 2 .
  • the intermediate key word part has a 1-bit address, and the address space is 0-1; and / and ⁇ are stored in order.
  • KES is used to control the timing of key expansion, and its state machine is shown in Figure 20. Corresponding each time The state of the KES changes when the key word is fig transformed and the key is read for key expansion. Its initial state is 00, which is the state of preparation for calculation.
  • the record format of the key word part and the intermediate key word part is as follows:
  • It contains two write ports, which are the write port of the key word and the intermediate key word, respectively, including the write data bus and the write address; two read ports, corresponding to the data fields of the token 7 and the token 10, respectively. It contains the data bus and the read address.
  • the bus width of the data field corresponding to the token 7 is 32 bits
  • the read address is the kse of the Matoherll
  • the bus width of the data field corresponding to the token 10 is 160 bits
  • the read address is the step from the MatcherK. Signal, read one key segment and one intermediate key word at a time.
  • the write signal of the key word port will reset the op written to the record; the acknowledge signal of channel 7 will read the round change position of the key word record 1, and the acknowledge signal of channel 10 will read the extended position of the record 1.
  • the status word memory area has 4 status word storage units:
  • the status word area has a write port, including the data bus (width 36), write address, write signal; a set port, connected to the output of the initial key register, 256 bits wide, with the load signal as the set signal; A read port, the read address is connected to the ssel signal of the Matcher II, and the data bus is 36 bits, which is connected to the datal and color field data inputs of channel 7.
  • AorT is 1, the status word indicated by ssel is output.
  • AorT 0, 0 is output.
  • Matcherll It checks the status area and key area in the AK scratchpad.
  • the observation signal read by Matcher II includes the color field and flag flag of the status word record, and the op field of the key word.
  • the matching condition expression is shown in the following token transmission relationship part; its arbitration logic is divided into two levels, the first level. Select one from the request that satisfies the AddKey operation condition. The second level selects whether to perform the AddKey operation or the transfer key conversion.
  • the random control code of the arbiter in the above matching unit is provided by the random sequence control sequence register 1.
  • the key extension HMF structure of the token register shares the key area of the AK temporary storage unit with the HMF structure of the AddKey.
  • its register also includes the intermediate key unit of the AK temporary storage unit.
  • the matcher's observation signals include: the op field of the key word, the flag flag of the intermediate key word, KES, BLOCKL, and BLOCKH; the matching condition is shown in the following token transfer relationship part; the output request selection signal is the segment mark step, and the packing logic is based on Step, the corresponding data of the key area and the BLOCK value are packaged into the token 10 to be sent, and the specific packing logic is seen in the token transmission relationship part; since the key expansion operation does not have multiple token groups to be executed at the same time, There is no arbitration circuit inside; the token transmit signal is fetch_k; when Wk is 0, that is, inactive, the rising edge of the l oa d signal writes the data in the initial key register to the key word area.
  • the EU temporary storage unit contains a transformation key word storage unit key store and two identical state storage units storeO, store 1.
  • the first line (row address is 0) storage record (HDR) format is as follows:
  • storeO and storel each contain a read port and a write port, each with its own address and data bus.
  • the write port has another write signal.
  • the input signal also has a ping-pong selection signal pp from Matcher I.
  • the address of each row is the same when writing, and there is an address offset circuit inside.
  • the circuit input is external (from Matcherl) to output the read address of each row, and the address of each row is equal to the external row minus the corresponding row displacement constant.
  • the read ports of the two registers are connected to the transmit circuit via a multiplexer.
  • the state of storeO and storel is determined by the pp signal, pp is 0 multiplexer selects the output of storeO; pp is the output of storel for 1 multiplexer.
  • the EU temporary storage unit has an input transmission channel port connected to channel 1; an output transmission channel port connected to channel 2, and the token packing function is shown in the token transmission relationship portion.
  • the function of the EU temporary storage unit is to receive the token 1 sent from channel 1, from which the token type (state token or key token), write address and record data are parsed, and the record is written into the corresponding storage unit.
  • pp, s_f, raddr output corresponding state word or transformation key word, together with other control information is packaged into token 2; fetch-I signal triggers the request signal of 2# channel port, and sends the packaged token to Channel 2.
  • Matcher I internally includes two identical state token matching units and one key token matching unit.
  • the matching result of storeO (corresponding to the matched signal in Fig. 17)
  • the matching result of matchedO and storel is matched to the generating circuit of the ping-pong control signal pp, and the generating circuit of pp is as shown in Fig. 21.
  • the observation signal of storeO/storel includes: the flag bit of each unit, and the color field and op field of each HDR; the output request selection signal includes the read address raddr (2 bits) of storeO/storel; the specific matching condition is seen in token transmission.
  • the relationship portion; the arbitration circuit inside the state matching unit is a 4-to-1 circuit as shown in FIG.
  • Matcherl There is also a 2-to-1 arbitration circuit in Matcherl, which randomly selects one from the request of the state matching unit and the request of the key matching unit, and the corresponding operation selection signal is s_f; the corresponding token transmission signal is fetch_I.
  • the output temporary storage unit is a ciphertext rearrangement temporary storage unit, and the storage unit described above is composed of four sets of 4-byte registers. It has an input channel port: connected to the transmission channel 11; other input signals have a 2-bit read address from the output module and a clear signal OUTACK (corresponding to the CLR signal in Figure 16), and other output signals are lost. Out data (32 bits) and 4-bit flag flag signal. A typical circuit configuration same as FIG. 16, but which does not generate a reset acknowledge signal (CLR- d 0ne). The address bit of the output data bus of channel 11 is directly connected to the write address of the temporary storage unit, and the data bit is directly connected to the data input bus of the temporary storage unit.
  • CLR- d 0ne reset acknowledge signal
  • the input signal is the four flag signals of the output temporary storage unit, and the output is the OK signal.
  • OK is equal to 4 and the signal 'and'.
  • the KeySchedule unit has an input channel port (connected to channel 10), an output channel port (connected to channel 9), and a circuit structure in which the input channel port-logic portion-output channel port is cascaded. It enters token 10, which is processed by the logical section to output token 9 from the output channel port.
  • the specific functions of the logical part are shown in the "Token Transfer Protocol Part" below.
  • the AddKey unit has an input channel port (connected to channel 7), an output channel port (connected to channel 8), and a circuit structure in which the input channel port-logic portion-output channel port is cascaded. It enters token 7, which is processed by the logical part to output token 8 from the output channel port.
  • the specific functions of the logical part can be found in the "Token Transmission Protocol Part" below.
  • the EU unit has an input channel port (connected to channel 2), an output channel port (connected to channel 3), and a circuit structure in which the input channel port-logic portion-output channel port is cascaded. It enters token 2, which is processed by the logical part to output token 3 from the output channel port.
  • the specific functions of the logic section can be found in the "License Transmission Protocol Part" below.
  • the Switch is a 2-channel input-2 channel output switch.
  • the two input channel open ports are the 3# channel port from the wheel change wheel and the 4# channel port from the input module.
  • the circuit structure is shown in Figure 22. The arrow indicates the asynchronous transmission channel.
  • the DEMUX and MUX in the figure are also the asynchronous control unit DEMUX.
  • the data of the transmitted Key is equal to 1
  • the acknowledge signal is connected to the DEMUX control channel port.
  • the other data lines and request-response signals of channel 3 are connected to the data input channel port of the DEMUX; the control terminal of the MUX is the WK signal.
  • Figure 23 is a circuit configuration of the wheel updating unit.
  • the first level DEMUX is the same as that of FIG. 22. If the attribute field of token 8 is equal to 1, the token is directly copied to channel 1. If it is equal to 0, the second level DEMUX is passed. If the color field of the input token is equal to Nr, Then copy part of the token to channel 11, and check the column field of the token (that is, the exp_stop? element in the figure).
  • the random sequence control sequence of THDFAES04 adopts an external input method, and the random sequence control sequence register I in FIG. 12 corresponds to the Matcher I random control code generating circuit in the invention, which is a ring shift register, which is externally external before the operation starts.
  • the input data port inputs a random sequence into the random sequence control sequence register I; during the working process, the data in the register is cyclically shifted - each time the falling edge of fetch_I is shifted once, and the output connection of the primary register is connected. Go to the random code input of Matcher I.
  • the random sequence control sequence of THDFAES04 adopts an external input method, and the random sequence control sequence register II in FIG. 12 corresponds to the Matcher II random control code generating circuit in the invention, and its circuit is the same as the random sequence control sequence register I, each fetch – The falling edge of II is shifted once and the output data is connected to the random code input of Matcher II.
  • Token 1
  • AorT(l) 0/1 Execute AddKey or change key word forwarding, 0—AddKey, 1-transform key word forwarding
  • Fig. 24 (a) The mapping relationship of each domain is as shown in Fig. 24 (a), in which the lowest byte (7th to 0th bit) to the highest byte (31st to 24th bits) of the data field of token 1 are sequentially written separately.
  • the token In the storage unit of the 0th row to the 3rd row; if the key field of the token 1 is equal to 1, the token is written in the key store of the EU temporary storage unit, and the mapping relationship between each domain of the token 1 and the KR domain is as shown in the figure 24 (b) is shown.
  • This EU temporary storage unit records to token 2
  • Matclir I matches the data in storeO or storel.
  • the matching condition is: There are column i, which satisfies: the first row, the i-th column, the second row, the i-Cl column, the third row, the i-C2 column, the fourth
  • the storage records in row i-C3 are all "full", and the corresponding matching unit outputs, that is, the read addresses of storeO and storel are equal to i. It also matches the transform key words in the key store.
  • the matching condition is: The FR record is "full". When more than one data meets the above conditions, a random transmission is selected.
  • the mapping relationship between token 2 and token 3 is shown in Figure 26.
  • the data field of token 2 is calculated by the EU unit, and the result is used as the data field of token 3.
  • mapping relationship between the domains of the token 4 and the domains of the token 5 is as shown in FIG. SR in today's token 5->AK temporary storage unit
  • the content of the token 5 is stored in the state temporary storage area of the AK temporary storage unit, and the storage address is the address of the token 5, and the mapping relationship between the other domains and the various domains of the SR is as shown in FIG.
  • the data of the token 6 is stored in the intermediate key word storage area of the AK temporary storage unit, and the address is its address field.
  • the mapping relationship between the other domains and the KR domains is as shown in FIG.
  • the AddKey matching condition is: There is a pair of status tokens (represented by SR[i]) and a key token (represented by KR[j]) whose storage addresses are respectively i And j, satisfy:
  • mapping relationship between the token 7 and each domain of the token 8 is as shown in FIG.
  • the result of bitwise XOR of datal and data2 of token 7 is used as the data field of token 8.
  • the BLOCK value of token 9 is assigned to BLOCKH, and both bits of the op field of the high segment temporary storage unit are reset to 0 at the same time.
  • Matcher matches the data in the key temporary storage area of the AK temporary storage unit.
  • the present invention has the advantages of being resistant to power analysis attacks, redundant operations, and fewer redundant circuits, thereby achieving low power consumption in the field of information security, particularly in the field of cryptographic chip implementation security.
  • the invention can be applied to smart cards, such as ID cards, financial cards, pay TV cards, digital mobile certificates, mobile personal terminals, such as PDAs, mobile phones, portable computers, etc. In the field of application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)

Abstract

A Rijindael encryption circuit for data stream executed in desequencing is disclosed. The circuit belongs to cipher integrated circuit in the field of resisting analytical attack of difference power. The circuit structure integrated in a chip contains an input part and an output part to accomplish cryptographic-key expansion and cryptographic-key expansion loop including a channel switch unit, an initial cryptographic-key register, a AK temporary storage unit of arithmetic unit for cryptographic-key expansion, and a matching check unit. A circle transforming loop for converting circled cryptographic-key includes a switch unit for circled updating channel, an AddKey arithmetic unit, an EU arithmetic unit, an AK temporary storage unit and a relevant check unit. Using bit-by-bit hybrid operation, row shift operation, column hybrid transforming operation and circled iterated operation between the circled cryptographic-key and the state information obtains cipher text, which is output through the output part. Compared with the prior state, the invention lowers 50% difference power consumption so as to raise difficulty of attack.

Description

乱序执行的数据流 AES加密电路  Outgoing data flow AES encryption circuit
技术领域 Technical field
本发明属于密码集成电路、抗差分功耗分析攻击的领域, 其涉及一种用于解决密码 集成电路抗差分功耗分析攻击问题的电路, 特别是涉及一种乱序执行的数据流 AES加 密电路。 现有技术  The invention belongs to the field of cryptographic integrated circuits and anti-differential power analysis attacks, and relates to a circuit for solving a cryptographic integrated circuit anti-differential power analysis attack problem, in particular to a data stream AES encryption circuit for out-of-order execution. . current technology
随着智能卡、付费电视卡等密钥存储数据安全集成电路的广泛应用,功耗分析攻击, 特别是差分功耗分析攻击(DPA)开始出现,并迅速成为数据存储密码芯片的重要烕胁。 功耗分析攻击是通过分析芯片处理数据过程中的功耗变化(或电源电流变化)以从中获 得数据信息的面向硬件的攻击手段。其中, 应用最普遍的差分功耗分析攻击对多条工作 功耗变化曲线样本进行统计假设检验以找到密钥最可能的取值。使得电路各个操作的执 行时刻具有随机性是对抗差分功耗分析的重要途径之一。现有的时序随机性方法又分为 随机延时插入和乱序执行两种。前者运算执行的顺序固定, 但是在各步运算之间会随机 地插入延时; 后者则是将执行先后顺序无关的运算以随机的顺序执行, 相对于前者它的 执行时刻具有更高的不确定性。 目前公布的乱序执行技术有: 随机寄存器重命名技术一 一参见: May, D., H. L. Muller等的论文 "Random register renaming to foil DPA, Paris, France, Springer-Verlag. " (《随机化寄存器重命名以抵挡差分功耗分析攻击》),还有 "Irwin, J" D. Page,等 2002年发表的论文 " Instruction stream mutation for non-deterministic processors, San Jose, CA, USA, IEEE Comput. Soc. " (《不确定性处理器的指令流变异》) 介绍了一种 "不确定处理器"技术。 这两项技术都应用于通用密码处理器。 "随机寄存 器重命名技术"只在寄存器重命名环节上引入了随机选择; 不确定性处理器则是挖掘程 序内部的指令级并行性, 将可并行执行的指令随机地串行执行。前者只在局部引入不确 定性, 后者的不确定性则局限于相邻的指令之间, 且受原程序描述的限制。本发明的数 据流乱序执行技术则适用于专用集成电路密码芯片。数据流模式是一种根据数据依赖关 系执行运算的运算模式, 它不附加任何其它执行顺序的限制, 因此能够挖掘算法本身的 最大并行性, 能够控制执行顺序在较大的空间中变化。 而且数据流模式采用分布控制, 因此内部总线的负载电容小, 根据功耗差分的公式: Δ - ^ - 2)C 2, 功耗差分的大 小与负载电容成正比, 因此小的负载电容有利于降低功耗差分。下面介绍数据流及乱序 执行抗差分功耗分析攻击的基本原理: With the widespread use of key storage data security integrated circuits such as smart cards and pay TV cards, power analysis attacks, especially differential power analysis attacks (DPA), have emerged and quickly become an important threat to data storage crypto chips. A power analysis attack is a hardware-oriented attack that analyzes the power consumption (or power supply current) during processing of the data to obtain data information from it. Among them, the most common differential power analysis attack is used to perform statistical hypothesis testing on multiple working power consumption curve samples to find the most likely value of the key. Making the execution time of each operation of the circuit random is one of the important ways to combat differential power analysis. The existing timing randomness methods are divided into two types: random delay insertion and out-of-order execution. The order of execution of the former is fixed, but the delay is randomly inserted between the operations of the steps; the latter is performed in a random order in which the execution order is independent, and its execution time is higher than the former. Certainty. The currently published out-of-order execution techniques are: Random register renaming techniques. See: May, D., HL Muller et al., "Random register renaming to foil DPA, Paris, France, Springer-Verlag."("Randomized registers Renamed to counter differential power analysis attacks), and "Irwin, J" D. Page, et al., 2002""Directive stream mutation for non-deterministic processors, San Jose, CA, USA, IEEE Comput. Soc """Instruction Stream Variation for Uncertain Processors" introduces an "indeterminate processor" technique. Both of these techniques are applied to universal cryptographic processors. The "random register renaming technique" introduces random selection only in the register renaming process; the uncertainty processor mines the instruction-level parallelism inside the program, and executes the instructions that can be executed in parallel at random. The former only introduces uncertainty locally, while the uncertainty of the latter is limited to adjacent instructions and is limited by the description of the original program. The data stream out-of-order execution technique of the present invention is applicable to an ASIC chip. The data stream mode is an operation mode that performs operations according to data dependencies. It does not attach any other execution order restrictions, so it can mine the maximum parallelism of the algorithm itself, and can control the execution order to change in a large space. Moreover, the data flow mode adopts distributed control, so the load capacitance of the internal bus is small, according to the formula of the power consumption difference: Δ - ^ - 2 ) C 2 , the power consumption difference is proportional to the load capacitance, so a small load capacitance is beneficial. Reduce power consumption differential. The following describes the basic principles of data flow and out-of-order execution of anti-differential power analysis attacks:
1 . 乱序执行对抗差分功耗分析攻击 集成电路的功耗与被处理的数据相关,数据中某位(b)取 0或 1时对应的各时 刻的功耗分布不同, 分别用随机过程 Po (t)和?1 (t)表示, 其中 t表示时间。 DPA 利用均值检验判断得到的功耗曲线样本属于 Po (t)还是 Pi (t), 设计算 b的时刻, t,对应的功耗均值差为 s = |PQ(0- (0,被测功耗中含有噪声。,则根据 DPA理论, 判断正确所需的样本数 Ν应满足: 1. Out-of-order execution against differential power analysis attacks The power consumption of the integrated circuit is related to the processed data. When a bit (b) in the data takes 0 or 1, the power consumption distribution at each moment is different, and the random process Po (t) and ? 1 (t) indicates that t represents time. DPA uses the mean test to determine whether the power consumption curve sample belongs to Po (t) or Pi (t). When designing b, t, the corresponding power consumption mean difference is s = |P Q (0- (0, measured) The power consumption contains noise. According to the DPA theory, the number of samples required to determine the correctness should satisfy:
2σ 、2  2σ, 2
Ν >  Ν >
ε J  ε J
对于乱序执行的集成电路, 计算 b的操作有可能在多个时刻随机出现。 现假设 该操作在时刻 t执行的概率为 , 则 t时刻的功耗均值 = A + (l- 其 中, ^是 t时刻执行的其它操作的平均功耗, 假设与 b的取值无关。 对应的功耗 差分 For integrated circuits that are executed out of order, the operation of calculating b may occur randomly at multiple times. Now assume that the probability that the operation is performed at time t is, then the power consumption mean at time t = A + (l- where ^ is the average power consumption of other operations performed at time t, assuming that it is independent of the value of b. Power difference
■P,  ■P,
PbP0 + (i - pb)Polher - Lft + d ]P b P 0 + (i - p b )P olher - Lft + d ]
Figure imgf000005_0001
即功耗差分变成了原来的 i¾倍, 相应地, 样本数就提高到原来的 倍。 因此
Figure imgf000005_0002
Figure imgf000005_0001
That is, the power consumption difference becomes i3⁄4 times the original, and accordingly, the number of samples is increased by a factor of two. therefore
Figure imgf000005_0002
乱序执行可以提高 DPA攻击的成本, 且不确定度越高, 即 ^越小, 所需样本数越 大。 Out-of-order execution can increase the cost of DPA attacks, and the higher the uncertainty, the smaller the ^, the larger the number of samples required.
据流工作模式  Flow mode
首先介绍数据依赖关系的概念。 对于一个算法, 存在一系列操作, 假设操作 A 的输出是操作 B的输入, 则 B与 A就存在数据依赖关系, B必须在 A执行后才能 执行。  First introduce the concept of data dependencies. For an algorithm, there is a series of operations. Assuming that the output of operation A is the input of operation B, then B and A have data dependencies, and B must be executed after A is executed.
数据流模式是一种没有控制流, 除了数据依赖关系之外没有其它执行顺序限制 的计算模式。 它将被处理的数据封装成令牌, 一个令牌是服从一定格式的定长二进 制串, 每一位有特定的含义。 例如, 如下一个令牌就包含了数据域、 源地址、 目标 地址 3个域, 它们在令牌中的位置是约定的: 低 32位是数据域; 第 37位到第 35 位和第 34位到第 32位分别是 3位的目标地址和源地址。  A data flow pattern is a computational mode that has no control flow and has no execution order restrictions other than data dependencies. It encapsulates the processed data into tokens. A token is a fixed-length binary string that conforms to a certain format, each of which has a specific meaning. For example, the following token contains three fields: data field, source address, and destination address. Their position in the token is agreed: the lower 32 bits are the data field; the 37th to the 35th and 34th bits. The 32nd bit is the 3-bit target address and source address.
目标地址 I源地址 I 数据  Destination address I source address I data
37 35 34 32 31 0 数据流电路实现算法的各个操作和操作之间的令牌传递。 当一个操纵的所有输 入令牌都到达 (即该操作所依赖的运算都已经执行) 则可以被 "激活"——开始处 理数据, 并将产生的结果打包成新的令牌传给它的后继操作。 控制信息也通过令牌 传达——例如例子中的数据地址就指示了数据的来源和处理后应该发送的目的地; 一些控制命令也被封装成令牌 (控制令牌), 传递给被控制的运算。 37 35 34 32 31 0 The data flow circuit implements token passing between various operations and operations of the algorithm. When all the input tokens of a manipulation arrive (that is, the operations on which the operation depends have been executed), they can be "activated" - start processing the data, and package the resulting result into a successor passed to the new token. operating. Control information is also communicated through tokens—for example, the data address in the example indicates the source of the data and the destination that should be sent after processing; some control commands are also encapsulated into tokens (control tokens) that are passed to the controlled Operation.
数据流电路没有中央控制电路, 数据交换具有局域性, 相应地, 数据总线和存 储单元也是分布式的。 数据运算的触发是以操作数令牌是否全部到达为条件的, 属 于数据驱动的异步工作。 它没有数据依赖关系的操作彼此没有影响, 自然地实现并 行执行。  The data stream circuit has no central control circuit, and the data exchange has locality. Accordingly, the data bus and the storage unit are also distributed. The triggering of data operations is conditional on whether or not the operand tokens are all arrived, and is a data-driven asynchronous operation. Its operations without data dependencies have no effect on each other and naturally implement parallel execution.
综上所述, 数据流计算具有并行性、 函数性 (即每个操作相对独立, 且无关操 作可以按任意顺序执行。)、 分布性、 异步性的特点。  In summary, data stream computation has parallelism and functionality (that is, each operation is relatively independent, and irrelevant operations can be performed in any order.), distributed, and asynchronous.
步电路和异歩通道:  Step circuit and different channel:
一个异步电路系统, 各部分电路之间通过异步的通讯接口连接, 称为异歩传输 通道。 传输通道与外部的接口称为通道端口, 其是对一组信号的抽象: 包括一组数 据总线和请求、 应答信号。 一个异步传输通道包括数据锁存器和锁存器的控制端电 路, 结构如图 1。 其工作方式是一种称为 "握手协议" 的通信协议:  An asynchronous circuit system, each part of the circuit is connected through an asynchronous communication interface, called an all-in-one transmission channel. The interface between the transmission channel and the outside is called a channel port, which is an abstraction of a set of signals: it consists of a set of data buses and request and response signals. An asynchronous transfer channel includes the control terminals of the data latches and latches, as shown in Figure 1. The way it works is a communication protocol called a "handshake protocol":
异步集成电路没有时钟, 握手协议包含两种控制信号: 请求 (request) 信号和 应答 (acknowledge)信号。 请求信号启动一个工作, 应答信号表示工作完成。 这两 个信号可以完成系统中所有运算的时序控制。 用电路实现握手信号, 需要把交替出 现的请求和应答信号编码成控制线上的电平或电平变化, 下面以常用的一种 4相位 握手协议为例 (见图 2):  An asynchronous integrated circuit has no clock, and the handshake protocol contains two types of control signals: a request signal and an acknowledge signal. The request signal initiates a job and the response signal indicates that the job is complete. These two signals complete the timing control of all the operations in the system. To implement the handshake signal with the circuit, it is necessary to encode the alternate request and response signals into level or level changes on the control line. The following is a typical 4-phase handshake protocol (see Figure 2):
请求信号的上升沿通知接收方有数据到达, 接收方准备好接受数据后升高应答 信号, 表示准备就绪, 同时开始读取数据, 请求信号又被应答信号复位, 请求信号 的下降沿再把应答信号复位, 准备接受下一个数据。 其中传输通道上的数据存储在 一个锁存器中。 (锁存器有一个控制端, 当控制端为低电平时输出随输入变化, 当控 制端为高时输出端的数据保持不变。)在 4相位握手的异步传输通道中,锁存器的控 制端与应答信号相连, 即当应答信号升高后将发送方的数据锁存入锁存器, 待一次 通信过程结束后才可以接受输入端的数据。  The rising edge of the request signal informs the receiver that the data arrives, and the receiver is ready to accept the data and raises the response signal, indicating that it is ready to start reading data at the same time, the request signal is reset by the response signal, and the falling edge of the request signal is answered again. The signal is reset and ready to accept the next data. The data on the transfer channel is stored in a latch. (The latch has a control terminal. When the control terminal is low, the output changes with the input. When the control terminal is high, the data of the output remains unchanged.) In the asynchronous transmission channel of the 4-phase handshake, the control of the latch The terminal is connected to the response signal, that is, the data of the sender is latched into the latch when the response signal is raised, and the data of the input terminal can be accepted after the communication process ends.
在异步电路中经常用到一种称为 C单元的时序控制电路, 此种电路有 2个输入 1个输出,一般还有一个复位端, 当两个输入全为 1时, 输出为 1 ; 当两个输入全为 In the asynchronous circuit, a timing control circuit called C unit is often used. This circuit has 2 inputs and 1 output, and generally has a reset terminal. When both inputs are all 1, the output is 1; Both inputs are all
0时输出 0; 当两个输入不同时, 输出保持原来的状态。 由 C单元实现的 4相位握 手协议的异步传输通道如图 3所示。 0 is output 0; when the two inputs are different, the output remains in its original state. The asynchronous transmission channel of the 4-phase handshake protocol implemented by the C unit is shown in Fig. 3.
据流与密码芯片的抗 DPA安全性  Anti-DPA security based on streaming and cryptographic chips
数据流方式不显式定义执行顺序, 因此执行顺序具有最大的灵活性。 函数性使 得乱序执行更加方便。 分布式总线的负载小, 相应的功耗特征小。 异步性使得数据 流方式更易于以异步电路实现, 而在 Simon Moore的论文 "Balanced Self-Checking Asynchronous Logic for Smart Card Applications" (《用于智能卡的平衡自检查异歩逻 辑》)中论述了异步电路在实现密码芯片方面具有优势。因此本发明利用数据流的上 述特点, 实现了一个数据流的 AES集成电路实现方案。 The data flow mode does not explicitly define the execution order, so the execution order has maximum flexibility. Functionality makes out-of-order execution more convenient. The load of the distributed bus is small, and the corresponding power consumption characteristics are small. Asynchrony makes data Streaming is easier to implement in asynchronous circuits, and Simon Moore's paper "Balanced Self-Checking Asynchronous Logic for Smart Card Applications" discusses asynchronous circuits in implementing cryptographic chips. Aspects have advantages. Therefore, the present invention utilizes the above features of the data stream to implement an AES integrated circuit implementation of the data stream.
5. 数据流 AES的基本工作原理 5. Data flow The basic working principle of AES
( 1 ) Rijndael算法和 AES加密标准:  (1) Rijndael algorithm and AES encryption standard:
AES是美国国家标准与技术研究所(NIST)制定的新的对称分组加密高级数据 加密标准 (Advanced Encryption Standard) 规范, 此标准于 1997年开始公开征集以 取代 DES,在 2002年最终确定为采用 128位明文分组长度的 Rijndael算法,密钥长 度支持 128位、 192位和 256位三种。 本发明可以实现 3种密钥长度的 AES加密算 法。  AES is the new Advanced Encryption Standard specification developed by the National Institute of Standards and Technology (NIST). This standard began public collection in 1997 to replace DES. In 2002, it was finally determined to adopt 128. The Rijndael algorithm with a plain packet length supports three key lengths: 128 bits, 192 bits, and 256 bits. The present invention can implement three key length AES encryption algorithms.
i. AES算法设计原理  i. AES algorithm design principle
Rijndael算法支持 128位到 256位之间任意 32位跨度的分组长度, 但 AES标准仅 支持 128位的明文长度, 128、 192或 256位的密钥长度。  The Rijndael algorithm supports packet lengths of any 32-bit span between 128 bits and 256 bits, but the AES standard only supports 128-bit plaintext lengths, 128, 192 or 256-bit key lengths.
AES算法的运算是定义在有限域 GF ( 28 )上的。 所谓的 GF ( 28 ), 是指由从 (00)16 到 (FF)I6的数值集合, 并定义了加法和乘法的数域。 GF ( 28 ) 加法就是异或 (XOR) 操作。 GF ( 28 ) 的乘法可以按下面方法计算: 首先, 任何值乘 (01)16等于其自身; 对于 乘 (02)16, 则当被乘的值小于 (80)16时, 结果是该值左移 1位, 否则结果就是先左移 1位, 再与 (lb)16异或的结果。 它防止了 "域溢出"并保持乘法的乘积在范围以内。 与 (03)16相 乘, 可以将 (03)16分解为 2的幂之和, g bX (03)16 = bX ((02)16 + (01)16) = (bX (02)16) + (bX (01)16)。 The operation of the AES algorithm is defined on the finite field GF ( 28 ). The so-called GF (2 8 ) refers to a set of values from (00) 16 to (FF) I6 and defines the number field of addition and multiplication. GF ( 2 8 ) addition is an exclusive OR (XOR) operation. The multiplication of GF ( 2 8 ) can be calculated as follows: First, any value multiplied by (01) 16 is equal to itself; for multiplication (02) 16 , then when the multiplied value is less than (80) 16 , the result is the value Move 1 bit to the left, otherwise the result is to shift left by 1 bit and then XOR with (lb) 16 . It prevents "domain overflow" and keeps the product of multiplication within the range. And multiplying (03) 16, it may be (03) 16 is decomposed into the sum of powers of 2, g bX (03) 16 = bX ((02) 16 + (01) 16) = (bX (02) 16) + (bX (01) 16 ).
ii. 加密流程  Ii. Encryption process
Rijndael算法的数据处理单元为字节, 一个明文分组信息被分为 4 XN6个字节, 对于 AES标准 Nb=4, 它们按顺序被放入一个 4 X )的矩阵中, 这个矩阵被称为 "状态 ( State) "。 状态的一列称为 一个 "状态字"。密码密钥则是一个 4 ΧΛ¾的矩阵, AES标准允许的 :值是 4、 6和 8, 相应的各列 (4个字节)称为 "密钥字"。 根据乱序执行的需要, 发明中以状态字和密钥字作为基本操作数, 即每个令牌的数据域都是由状态字或密钥字组成的, 将这两类令牌分别称为状态令牌和密钥令牌。  The data processing unit of the Rijndael algorithm is byte, and a plaintext grouping information is divided into 4 XN6 bytes. For the AES standard Nb=4, they are put into a 4×) matrix in order. This matrix is called “ State ("). A column of states is called a "status word." The cryptographic key is a 4 ΧΛ 3⁄4 matrix, which is allowed by the AES standard: the values are 4, 6, and 8, and the corresponding columns (4 bytes) are called "key words." According to the need of out-of-order execution, the state word and the key word are used as basic operations in the invention, that is, the data field of each token is composed of a status word or a key word, and these two types of tokens are respectively referred to as Status token and key token.
Rijndael算法所有的变换都是基于状态的变换。 AES变换是通过轮函数的多次迭代实现的, 根 据密钥长度的不同, 迭代次数也不同。 迭代轮次用 N"表示, Nk等于 4、 6、 8所对应的 NT"分别是 10、 12和 14。  All transformations of the Rijndael algorithm are state-based transformations. The AES transformation is implemented by multiple iterations of the round function, and the number of iterations is different depending on the length of the key. The iteration round is denoted by N", and Nk is equal to 4, 6, and 8 corresponding to NT" are 10, 12, and 14, respectively.
加密算法的流程可用图 4表示。 其中, 虚线框内的操作组成一个轮变换函数。  The flow of the encryption algorithm can be represented by Figure 4. Among them, the operations in the dashed box constitute a round transformation function.
下面来解释图中各模块的意义:  The following explains the meaning of each module in the figure:
iii. 轮密钥混合一 AddKey 对应图中的" +"操作,它是将与当前的状态各字节与对应的轮密钥的对应字节按位异或 (XOR)。 iv.字节代换运算一 Srd Iii. Round key mixing an AddKey Corresponding to the "+" operation in the figure, it is XORed with the corresponding byte of the current state and the corresponding byte of the corresponding round key. Iv. Byte substitution operation - Srd
字节代换运算是一个可逆的非线性字节代换操作, 这种变换要对分组中的每个字节进行, 对字 节的操作遵循一个代换表, 即 S盒。 对于一个字节, 取其前 4位作为 X座标, 后 4位作为 y座标, 即可在 S盒中査找到一个对应项来替换原来的数据。 这就是 Srd〇所完成的功能。 S盒的内容如下 所示:  The byte substitution operation is a reversible non-linear byte substitution operation. This conversion is performed for each byte in the packet, and the operation of the byte follows a substitution table, that is, the S box. For a byte, take the first 4 bits as the X coordinate and the last 4 bits as the y coordinate, you can find a corresponding item in the S box to replace the original data. This is what Srd〇 does. The contents of the S box are as follows:
Figure imgf000008_0001
Figure imgf000008_0001
v. 行位移变换一 ShiftRow  v. Line displacement transformation - ShiftRow
行变换是将状态的每一行进行循环左移, AES标准中第 0行至第 3行的移动的字节数依次用 Co, d, C2, C3表示。 它们依次等于 0、 1、 2、 3, 图 5给出了 )=4的 ShiftRow作用效果。 The row transformation is to rotate each row of the state to the left, and the number of bytes of the 0th to the 3rd row of the AES standard is sequentially expressed by Co, d, C 2 , and C 3 . They are in turn equal to 0, 1, 2, 3, and Figure 5 shows the ShiftRow effect of =4.
vi. 列混合变换一 MixCol  Vi. Column blending one MixCol
列混合用一个常数矩阵乘以状态字所得的值代替该列状态字。 变换关系用矩阵运算的形式表示 如式 1所示。 式 1中 αι, α2, 依次是第 0行到第 3行的字节, 所得的结果的 4个字节依次是 b0, bi, b2, b The column mix replaces the column status word with a value obtained by multiplying a constant matrix by the status word. The transformation relationship is expressed in the form of a matrix operation as shown in Equation 1. In the formula 1, αι , α 2 , which are the bytes of the 0th row to the 3rd row in turn, the 4 bytes of the obtained result are b 0 , bi, b 2 , b in order.
X '02 03 01 01、一"0 X '02 03 01 01, one " 0
01 02 03 01 αλ 01 02 03 01 α λ
( 1 ) ( 1 )
01 01 02 03 01 01 02 03
、03 01 01 02y 需要申明的是, 此矩阵运算中的加法和乘法都为有限域 GF ( 2s ) 中的加法和乘法。 03 01 01 02 y It should be stated that the addition and multiplication in this matrix operation are addition and multiplication in the finite field GF ( 2 s ).
vii. 密钥扩展 KeyExpansion  Vii. Key Extension KeyExpansion
密钥扩展是将初始的密码密钥扩展为轮密钥的过程。扩展密钥按扩展顺序排列, Rijndael算法每 轮需要 4X4个轮密钥字节, 每列 4个字节称为一个扩展密钥字, 第 i轮的轮密钥由扩展密钥序列的 第 4ζ'列到第 4 ' + 1) - 1列给出, 扩展密钥的总数为 4 (N/-+1 ) 个字。 密钥扩展函数依赖于 :的值: 扩展密钥序列的前 M:列是密码密钥 (或称初始密钥), 后面的 各列由先前的各列按递归方式确定。 递归函数依赖于列的位置, 如果 ζ'不是 :的倍数, 则第 列是 第 Z-M列与第 Ζ·-1列的逐位异或; 否则, 第 /列是第 /- :列与第 列的一个非线性函数 (用字母 f 表示) 的逐位异或。 这个非线性函数可以通过以下方式来实现: 将 Srd作用在列的 4个字节, 附加 一个列内字节的循环移位, 增加一个轮常量。 这个轮常量独立于 :, 而且被 GF(28)中的一个递归规 则所定义-Key expansion is the process of extending an initial cryptographic key into a round key. The extended keys are arranged in an extended order. The Rijndael algorithm requires 4×4 round key bytes per round. Each column of 4 bytes is called an extended key word, and the round key of the ith round is the 4th of the extended key sequence. 'Column to 4' + 1) - 1 column gives, the total number of extended keys is 4 (N/-+1) words. The key extension function depends on the value of: The first M: column of the extended key sequence is the cryptographic key (or initial key), and the subsequent columns are determined recursively from the previous columns. The recursive function depends on the position of the column. If ζ 'is not a multiple of :, the column is a bitwise XOR of the ZM column and the Ζ ·-1 column; otherwise, the / column is the /-: column and column A bitwise XOR of a nonlinear function (represented by the letter f). This non-linear function can be implemented in the following way: Srd is applied to the 4 bytes of the column, and a cyclic shift of the bytes in the column is added, and a round constant is added. This round constant is independent of: and is defined by a recursion rule in GF(2 8 ) -
RC[l]=x° (即 01 ) RC[l]=x° (ie 01)
RC[2]=x (即 02)  RC[2]=x (ie 02)
RC x ' RCLj-l^x*-1 , j>2 RC x ' RCLj-l^x*- 1 , j>2
这里的乘 2运算也是有限域 GF ( 28 ) 内的运算。 The multiplication 2 operation here is also an operation in the finite field GF (2 8 ).
对于服 >6的情况, 当 / m0cH4时, 第 Z列也是第 列与第 -1列的一个非线性函数的逐位 异或, 这个非线性函数是将 Srd作用在列的 4个字节上, 用字母 g表示。 For the case of >6, when / m 0 cH4, the Zth column is also a bitwise XOR of a nonlinear function of the column and the -1 column. This nonlinear function is the 4 words that apply Srd to the column. On the section, it is indicated by the letter g .
( 2 ) 令牌的暂存 -匹配 -发射 (HMF ) :  (2) Temporary storage of the token - Match - Launch (HMF):
数据流计算的内容就是对于令牌的处理, 具体包括令牌的创建(发射)、 解析、 处理, 以及令牌的暂存和各个令牌的匹配。 对于多个操作数的操作, 各个操作数的 令牌往往不是同时到达, 因此需要一个暂存单元把到达的令牌暂存起来, 然后对所 有已到达的令牌进行 "匹配", 当发现一对(或多个)就绪的操作数令牌就打包成新 的令牌发射到处理单元。  The content of the data stream calculation is the processing of the token, including the creation (transmission), parsing, processing, and temporary storage of the token and the matching of the tokens. For the operation of multiple operands, the tokens of each operand often do not arrive at the same time, so a temporary storage unit is needed to temporarily store the arrived token, and then "match" all the arrived tokens. The (or more) ready operand tokens are packaged into new tokens that are transmitted to the processing unit.
本发明采用了一种新的电路实现令牌匹配, 称为令牌暂存 -匹配 -发射结构, 用 HMF表示。 所述的乱序执行控制即在 HMF结构中实现, 当暂存单元中同时有多个 或多组匹配成功的令牌时, 电路从中随机选取一个发送, 如果只有一个或一组令牌 匹配成功则发送匹配成功的令牌。  The present invention employs a new circuit for token matching, referred to as a token temporary-match-transmit structure, represented by HMF. The out-of-order execution control is implemented in the HMF structure. When there are multiple or more sets of successfully matched tokens in the temporary storage unit, the circuit randomly selects one of the transmissions, if only one or a group of tokens is successfully matched. Then send a token that matches successfully.
在本发明中的每个运算单元和密文输出单元都有各自的一个暂存-匹配-发射结 构。  Each of the arithmetic unit and ciphertext output unit in the present invention has its own temporary storage-matching-emission structure.
( 3 ) 一种特殊的密钥扩展结构- 如果把第(1 )小节中所述的轮密钥序列每 M个字分为一组,称为"密钥分组", 则各密钥分组间的计算关系可用图 6表示, 图中的 "+"是逐位异或运算, kj, i=0 , 1, …, 4 ( Nr + l ) , j=0 , 1 , ■··, M:-l表示第 个密钥分组的第 _/列密钥字, ][和8 (3) A special key extension structure - if each round of the round key sequence described in subsection (1) is grouped into a group called "key grouping", then each key grouping The calculation relationship can be represented by Figure 6. The "+" in the figure is a bitwise XOR operation, kj, i=0, 1, ..., 4 (Nr + l ), j=0, 1 , ■··, M: -l indicates the _/column key word of the first key group, ][and 8
Nk  Nk
是密钥扩展中的非线性变换。 为了叙述方便, 本文把扩展密钥的中间结果 /和 g命 名为中间密钥字。 如图 6所示, 每个密钥分组可以分为两部分: 序号在前的 4个密 钥字为低段(图中右侧部分), 其余的(Λ%-4)个密钥字属于高段(图中左侧部分), 当 Μ=4时, 每个密钥分组只有低段部分的计算。 由此, 密钥扩展可用图 7所示的 运算结构迭代实现。 此结构中包含连续异或运算与非线性变换 f和 g, 我们将 5输 入- 4输出的连续异或运算用图 8所示的电路实现,并命名为 KeySch运算,其中 / , k2 , k、, ^和 f是输入密钥字, y3, y2 , yx , : F。是输出密钥字。 Is a nonlinear transformation in key expansion. For convenience of description, the intermediate result / and g of the extended key are named as intermediate key words. As shown in FIG. 6, each key grouping can be divided into two parts: the first four key words of the serial number are low (the right part in the figure), and the remaining (Λ%-4) key words belong to The high segment (left part of the figure), when Μ = 4, each key group has only the calculation of the low segment. Thus, the key expansion can be iteratively implemented using the arithmetic structure shown in FIG. This structure contains continuous XOR operations and nonlinear transformations f and g, we will lose 5 The continuous-OR operation of the -4 output is implemented by the circuit shown in Figure 8, and is named KeySch operation, where /, k 2 , k, , ^ and f are input key words, y 3 , y 2 , y x , : F. Is the output key word.
Nk不同取值时的具体实现算法如图 9所示, 其中标有 *的运算是每次迭代起始 的运算。 Nk>4时, 低段 KeySch计算的结果作为新分组的低段, 高段 KeySch计算 的结果作为新分组的高段; Nk=4时, 低段 KeySch计算的结果作为新分组的高段, 高段 KeySch计算的结果作为新分组的低段。 Nk=6时, 的结果直接参与 KeySch 运算, 没有经过 g变换, 但是为了统一表示, 我们也用 g来表示, 在这种情况下 g 的含义是直接复制。  The specific implementation algorithm for different values of Nk is shown in Figure 9, where the operation marked with * is the operation starting at each iteration. When Nk>4, the result of the low-level KeySch calculation is taken as the low section of the new group, and the result of the high-level KeySch calculation is taken as the high section of the new group; when Nk=4, the result of the low-level KeySch calculation is the high section of the new group, high The result of the segment KeySch calculation is taken as the low segment of the new packet. When Nk=6, the result directly participates in the KeySch operation, without the g transform, but for the unified representation, we also use g to represent, in which case the meaning of g is directly copied.
为了叙述方便, 本文中命名产生中间密钥字的扩展密钥为变换密钥字, 分别称 产生 f和 g的变换密钥字为变换密钥字 1和变换密钥字 2。  For convenience of description, the extended key named in this paper to generate the intermediate key word is the transformed key word, and the transformed key words for generating f and g respectively are the transformed key word 1 and the transformed key word 2.
本发明中将密钥扩展的非线性变换也放在轮函数执行单元中执行, 共享 Srd 运算单元。 上述密钥扩展方法的令牌处理流程如图 10 a所示。 初始密钥保存到缓 存单元后, 首先进行检査, 如果发现变换密钥字则将其转发到 "轮变换环"中, 经过相应的非线性变换, f或 g, 结果写入到密钥暂存器中的中间密钥字单元。 另 一方面,密钥变换环中对密钥缓存器中的令牌反复检验,发现待执行 KeySch运算 的令牌组即对它们执行 KeySch操作,结果写回密钥缓存单元相应的地址。如果发 现密钥扩展已经完成则停止, 其中的停机条件是轮变换环的令牌轮次达到了最后 一轮。  In the present invention, the nonlinear transformation of the key extension is also performed in the round function execution unit, and the Srd operation unit is shared. The token processing flow of the above key expansion method is as shown in FIG. 10a. After the initial key is saved to the cache unit, it is checked first. If the key is found, it is forwarded to the "round transform loop", and after the corresponding nonlinear transformation, f or g, the result is written to the key. Intermediate key word unit in the memory. On the other hand, in the key conversion ring, the tokens in the key buffer are repeatedly checked, and the token group to be executed by the KeySch operation is subjected to a KeySch operation, and the result is written back to the corresponding address of the key buffer unit. If it is found that the key expansion has been completed, the stop condition is that the token round of the round change ring reaches the last round.
(4) 轮函数部分  (4) Round function part
本发明中状态令牌的处理流程如图 10 b所示。一列状态的令牌首先与对应的 轮密钥列执行 AddKey运算, 随后检验结果令牌的轮次, 如果轮次等于 Nr, 则将 令牌数据缓存在输出缓存单元中, 当输出缓存单元写满后则将密文输出, 运算结 束; 如果轮次小于 Nr, 则检査完成 AddKey运算的令牌能否组成执行 MixCol运 算的新令牌 (由 AES算法知, 一列状态的 MkCol运算依赖于 4列的 AddKey结 果。), 如果匹配成功则把相关的 4个状态字节重新打包成一个新的状态字令牌, 依次执行 Srd和 MixCol运算。 这 4个状态字的地址是按照它们经过 ShiftRow之 后在同一列的关系逆推而得。所以被发送的令牌是 ShiftRow后的结果。对于最后 一轮的令牌则只执行 Srd运算。 轮变换执行后的结果状态被返回到状态令牌暂存 单元, 开始执行新的一轮计算。 发明内容  The processing flow of the state token in the present invention is as shown in Fig. 10b. A list of tokens first performs an AddKey operation with the corresponding round key sequence, and then checks the round of the resulting token. If the round is equal to Nr, the token data is cached in the output buffer unit, when the output buffer unit is full. After the ciphertext is output, the operation ends; if the round is less than Nr, it is checked whether the token completing the AddKey operation can constitute a new token that performs the MixCol operation (known by the AES algorithm, the MkCol operation of a column state depends on 4 columns) The AddKey result.), if the match is successful, the relevant 4 status bytes are repackaged into a new status word token, and the Srd and MixCol operations are performed in sequence. The addresses of the four status words are reversed according to their relationship in the same column after ShiftRow. So the token being sent is the result of ShiftRow. For the last round of tokens, only the Srd operation is performed. The result state after the round transformation is executed is returned to the status token temporary storage unit, and a new round of calculation is started. Summary of the invention
本发明的目的是提供一种用于解决密码集成电路抗差分功耗分析攻击问题的电路, 特别是一种乱序执行的数据流 AES加密电路。 为达成上述目的, 本发明是一个具有乱序执行特点, 能够抵抗差分功耗分析攻击的 数据流模式 AES加密集成电路结构。 这一结构一次处理一个数据分组, 待前一个分组 处理完毕, 才可以处理下一个分组。 It is an object of the present invention to provide a circuit for solving the problem of a cryptographic integrated circuit against differential power analysis attack, and more particularly to a data stream AES encryption circuit that performs out-of-order execution. In order to achieve the above object, the present invention is a data stream mode AES encryption integrated circuit structure with out-of-order execution characteristics and capable of resisting differential power analysis attacks. This structure processes one data packet at a time, and the next packet can be processed after the previous packet is processed.
本发明的乱序执行的数据流 AES加密电路, 其主要特点在于, 该电路结构是在一 个数据流加密专用集成电路上实现的, 该电路结构遵从以 Rijndael算法为最终算法的高 级数据加密标准, 记为 AES, 使用数据流模式实现乱序加密, 该电路结构含有:  The data stream AES encryption circuit of the out-of-order execution of the present invention is mainly characterized in that the circuit structure is implemented on a data stream encryption application specific integrated circuit, and the circuit structure complies with the advanced data encryption standard using the Rijndael algorithm as the final algorithm. Recorded as AES, using the data stream mode to achieve out-of-order encryption, the circuit structure contains:
a. 传输通道, 是两个部件间的数据传输接口, 所传输的数据是相应编号的令牌, 其中包括一个令牌输入数据总线、 一个数据输出总线和输入请求与应答信号、 输出请求与应答信号, 该传输通道与外部的接口就是通道端口;  a. The transmission channel is the data transmission interface between the two components. The transmitted data is the corresponding numbered token, including a token input data bus, a data output bus and input request and response signals, and output requests and responses. Signal, the interface of the transmission channel and the external is a channel port;
b. 输入单元, 是芯片内核与外部的接口, 实现把明文和密钥按照协议要求的时序 输入并通过 4#传输通道将明文送入内核部分、 把密钥写入初始密钥存储器的 功能,同时产生该电路结构中内核的各个单元所需的复位信号 InterRSt_和初始 密钥置入信号 load; 所述的 4#通道传输的令牌, 命名为令牌 4包括一个 32位 的数据域, 一个 2位的 column域; b. The input unit is an interface between the chip core and the external, and realizes the function of inputting the plaintext and the key according to the timing required by the protocol and sending the plaintext to the kernel part through the 4# transmission channel, and writing the key into the initial key memory. At the same time, the reset signal InterR S t_ and the initial key placement signal load required for each unit of the kernel in the circuit structure are generated; the token transmitted by the 4# channel is named as token 4 and includes a 32-bit data. Domain, a 2-bit column field;
c 通道开关单元 Switch,是一个 2传输通道输入 -2传输通道输出的交换开关,此 外还接收来自工作状态寄存器的输入信号 WK, 当 WK )时,该通道开关单元 处于空闲状态, 接收所述输入单元经 4#通道送来的明文数据, 经过解析后, 把其中的数据重新打包成状态字令牌, 发送给 5#通道, 所述的 5#通道传输的 令牌, 命名为令牌 5包括一个 32位的数据域, 一个 4位的表示轮次的 color 域和一个 2位的地址域, 根据令牌 4打包时, 令牌 5的数据域直接复制令牌 4 的数据域,令牌 5的 color域设为 0,令牌 5的地址域复制令牌 4的 column域; 当 WK=1时, 处于工作状态, 把 3#通道发来的令牌解析后, 根据不同的类型, 把状态字令牌重新打包成一个令牌发给 5#通道, 把密钥字令牌重新打包成一 个令牌发送给通道 6; 所述的 3#通道传输的令牌, 命名为令牌 3包括一个 1位 的属性域和一个 32位的数据域, 当属性域等于 0时, 是状态字令牌, 还包括 一个 1位的操作符域、一个 2位的 column域、一个 4位的 color域, 把它重新 打包成令牌 5时, 其中的数据域直接复制令牌 3的数据域, color域直接复制 令牌 3的 color域, 地址域直接复制令牌 3的 column域, 当令牌 3属性域等于 1时, 是密钥字令牌, 还包括一个 1位的 fadd位和 6位不关心的数据, 所述发 送到 6#通道的令牌, 命名为令牌 6, 是下述的中间密钥字令牌, 包括一个 32 位的数据域和一个 1位的地址域, 把它打包成令牌 6时, 令牌 3的数据域直接 复制到令牌 6的数据域, fadd域复制到令牌 6的地址域;  c channel switching unit Switch, is a switching switch of 2 transmission channel input-2 transmission channel output, in addition to receiving input signal WK from working status register, when WK), the channel switching unit is in idle state, receiving the input After clearing the plaintext data sent by the unit via the 4# channel, the data is repackaged into a status word token and sent to the 5# channel, and the token transmitted by the 5# channel is named as token 5 A 32-bit data field, a 4-bit color field representing a round and a 2-bit address field. When packing according to token 4, the data field of token 5 directly copies the data field of token 4, token 5 The color field is set to 0, the address field of token 5 is copied to the column field of token 4; when WK=1, it is in working state, after parsing the token sent from channel 3, according to different types, the state is The token is repackaged into a token and sent to the 5# channel, and the key token is repackaged into a token and sent to channel 6; the token transmitted by the 3# channel is named token 3 including one 1 person The attribute field and a 32-bit data field. When the attribute field is equal to 0, it is a status word token. It also includes a 1-bit operator field, a 2-bit column field, and a 4-bit color field. When packaged into token 5, the data field directly replicates the data field of token 3, the color field directly replicates the color field of token 3, and the address domain directly replicates the column domain of token 3, when the token 3 attribute domain is equal to 1 When it is a key word token, it also includes a 1-bit fadd bit and 6 bits of data that are not of interest. The token sent to the 6# channel, named token 6, is the intermediate key word described below. The token, including a 32-bit data field and a 1-bit address field, is packaged into token 6, the data field of token 3 is directly copied to the data field of token 6, and the fadd domain is copied to token 6. Address field
d. 初始密钥存储器是一个 256位的寄存器组,从所述输入单元接收时钟信号和输 入的密码密钥数据, 把来自所述输入单元的密码密钥直接接收存入; e. AK暂存器单元, 是待执行 AddKey运算的令牌暂存单元,包括密钥字存储器、 状态字存储器以及令牌解析和打包电路,其中,密钥字存储器有 8个密钥字存 储单元,2个中间密钥字存储单元、两个 5位内部存储器: BLOCKH和 BLOCKL 及一个 2位状态寄存器 KES,该密钥字存储区有 3位地址,二进制表示的地址 空间是 000-111,依次存储序号模密钥分组列数 Nk等于 0-7的扩展密钥字,高 段为 100-111, 低段为 000-011, 每条存储记录包括一个 32位的数据域、 一个 轮变换标记位和一个扩展标记位; 所述密钥字存储器中地址等于 Nlc-1的单元 存储的数据称为变换密钥字 1, Nk不等于 4时地址等于 3的记录数据称为变 换密钥字 2, Nk等于 4时的变换密钥字 2是地址等于 7的记录数据; 该状态 字存储区有 2位地址, 二进制表示的地址空间是 00-11, 依次存储状态中的第 0-3列, 每条记录包括一个 32位的数据域、 一个 4位的 color域; 该中间密钥 字存储区, 有一位地址空间: 0-1, 依次存储从通道端口 6来的中间密钥字, 该中间密钥字是 AES密钥扩展算法中定义的非线性函数的计算结果, 每条存 储记录包括一个 32位的数据域; 所述的状态字存储器和中间密钥字存储区的 暂存单元的每个存储单元都对应一个标记为 flag的 "满 /空"标记位, 当单元 写入时 flag置 1, 表示满, 当数据读出后 flag置 0, 表示空; 所述密钥字存储 器的每个存储单元的 "满 /空"标志在该单元轮变换位和扩展位都等于 0时被 置 1表示满, 在这两个位都等于 1时被置 0, 表示空; 该 BLOCKH存储高段 密钥字的 "分组值", BLOCKL存储低段密钥字的 "分组值", 所述 "分组值" 是指所有轮扩展密钥序列按所述 Nk个一组分组后, 所得到的组的序号, 该扩 展密钥由初始密钥扩展而成,该扩展密钥的总长为 4 (Nr+l ), Nr为迭代轮数; 该 AK暂存器单元有三个输入通道端口:通道 5端口接收令牌 5并写入状态字 存储区, 写入的地址是令牌 5的地址域的值, 状态字记录的数据域和 color域 分别等于令牌 5的数据域和 color域, 通道 6端口接收令牌 6, 写入中间密钥 字区, 写入地址是令牌 6的地址域的值, 写入记录的数据域等于令牌 6的数据 域, 通道 9端口接收新的扩展密钥字令牌并写入密钥字存储区, 另外, 密钥字 存储区还有一个置数端口, 与所述初始密钥寄存器的输出端相连, 256位宽, 由所述 load信号作置入信号; 该 AK暂存器单元有两个输出通道端口; 通道 7 端口发送作 AddKey运算或变换密钥字转发用的操作数令牌, 通道 10端口发 送密钥扩展运算用的操作数令牌; d. The initial key storage is a 256-bit register set, receives a clock signal and input cryptographic key data from the input unit, and directly receives the cryptographic key from the input unit; e. AK temporary storage Unit, which is a token temporary storage unit to be executed, including a key word memory, State word memory and token parsing and packing circuit, wherein the key word memory has 8 key word storage units, 2 intermediate key word storage units, and two 5-bit internal memories: BLOCKH and BLOCKL and a 2-bit state The register KES has a 3-bit address in the storage area of the key word, and the address space represented by the binary is 000-111, and sequentially stores the extended key words of the sequence number modulo key group number Nk equal to 0-7, and the high segment is 100-111. The lower segment is 000-011, and each of the storage records includes a 32-bit data field, a round conversion flag bit, and an extension flag bit; the data stored in the unit of the key word memory having an address equal to Nlc-1 is called Transform key word 1, when Nk is not equal to 4, the record data whose address is equal to 3 is called transform key word 2, and when Nk is equal to 4, the transform key word 2 is record data whose address is equal to 7; the state word storage area has 2 The bit address, the address space represented by the binary is 00-11, and sequentially stores the 0-3th column in the state, and each record includes a 32-bit data field and a 4-bit color field; the intermediate key word storage area, There is an address space: 0-1, in turn Storing an intermediate key word from channel port 6, which is a calculation result of a nonlinear function defined in the AES key expansion algorithm, each storage record including a 32-bit data field; Each memory location of the temporary memory location of the memory and intermediate key word memory area corresponds to a "full/empty" flag bit labeled flag. When the cell is written, the flag is set to 1, indicating full, and the flag is read after the data is read. Set to 0, indicating null; the "full/empty" flag of each memory location of the key word memory is set to 1 when the unit round conversion bit and the extension bit are both equal to 0, and both bits are equal to 1 is set to 0, indicating null; the BLOCKH stores the "packet value" of the high segment key word, BLOCKL stores the "packet value" of the low segment key word, and the "packet value" refers to all round extended key sequences After the Nk groups are grouped, the sequence number of the obtained group is expanded by the initial key, and the total length of the extended key is 4 (Nr+l), and Nr is the number of iteration rounds; The AK register unit has three input channel ports: channel 5 port receives token 5 and writes The word storage area, the address written is the value of the address field of the token 5, the data field and the color field of the status word record are equal to the data field and the color field of the token 5, respectively, and the channel 6 port receives the token 6, which is written in the middle. The key word area, the write address is the value of the address field of the token 6, the data field of the write record is equal to the data field of the token 6, and the channel 9 port receives the new extended key word token and writes the key word. a storage area, in addition, the key word storage area further has a set port connected to the output end of the initial key register, 256 bits wide, and the load signal is used as a signal; the AK register unit has Two output channel ports; the channel 7 port sends an operand token for the AddKey operation or the conversion key word forwarding, and the channel 10 port transmits the operand token for the key expansion operation;
el. 所述的通道 9端口传输的令牌, 命名为令牌 9, 包括 4个 32位的数据域 k0-k3、 一个 5位的 BLOCK域和一个 1位的 part域, part等于 0则 k0-k3 依次写入密钥字存储区地址为 000-011的单元, 所述地址用二进制表示, 令牌 9的 BLOCK值赋给 BLOCKL, 同时将所有低段单元的轮变换标记 位和扩展标记位复位为 0, part等于 1则 kQ-k3依次写入密钥字存储区二 进制表示的地址为 100-111的单元, 令牌 9的 BLOCK值赋给 BLOCKH, 同时将所有高段单元的轮变换标记位和扩展标记位复位为 0; El. The channel 9 port transmitted token, named token 9, includes four 32-bit data fields k 0 -k 3 , a 5-bit BLOCK field and a 1-bit part field, part equal to 0 Then k 0 -k 3 are sequentially written into the unit of the key word storage area address 000-011, the address is represented by binary, the BLOCK value of the token 9 is assigned to BLOCKL, and the round transformation flag bits of all the low-level units are simultaneously And the extension flag bit is reset to 0, part is equal to 1 then k Q -k 3 is sequentially written into the unit of the address word storage area binary representation of 100-111, and the BLOCK value of the token 9 is assigned to BLOCKH, At the same time, the round transform flag bit and the extended flag bit of all the high segment units are reset to 0;
e2. 所述通道 7端口发送的令牌,命名为令牌 7,包括 2个 32位的数据域 datal 和 data2、 一个 1位的属性域, 属性域的值等于发送时下述的 AorT信号 的取值: 当 AorT等于 0时, 执行 AddKey操作, 令牌 7是状态字令牌, 它还包括一个 4位的 color域、 一个 2位的 column域, 打包时, 把下述 的 ssel信号的值复制到它的 column域、 地址等于 ssel的状态字存储记录 的数据域复制到令牌 7的 datal域、 该状态记录的 color域复制到令牌 7 的 color域, 地址等于下述 ksel值的密钥存储记录的数据域复制到令牌 7 的 data2域, 通道 7端口的应答信号将读取的状态字记录情空, 把读取的 密钥字记录的轮变换位变成 1 ; 当 AorT等于 1时, 执行变换密钥字转发 操作, 令牌 7是密钥令牌, 除数据域和属性域外还包括一个 1位的操作 符域、一个 1位的 fadd域与 4位不关心的数据, 打包时, datal域等于 0, 地址等于下述 ksel值的密钥存储记录的数据域复制到它的 data2域; ksel 等于 Nk-1时, 转发变换密钥字 1, fadd等于 0, 操作符域等于 0, 表示此 令牌将执行下述 f变换, Nk等于 4时, 若 ksel等于 7, 则表示转发变换 密钥字 2, fadd域等于 1, 操作符域等于 0, 表示此令牌将执行下述 f变 换, 若 Nk不等于 4且 ksel等于 3, 则表示转发变换密钥字 2, fadd等于 1, 操作符域等于 1 , 表示此令牌将执行下述 g变换; 通道 7端口的应答 信号将读取的状态字记录清空; E2. The token sent by the port 7 port is named token 7. It includes two 32-bit data fields datal and data2, and a 1-bit attribute field. The value of the attribute field is equal to the following AorT signal when transmitting. Value: When AorT is equal to 0, the AddKey operation is performed. Token 7 is a status word token. It also includes a 4-bit color field and a 2-bit column field. When packing, copy the value of the ssel signal described below. The data field to its column field, the address equal to the ssel's status word storage record is copied to the datal field of token 7, the color field of the status record is copied to the color field of token 7, and the address is equal to the key of the following ksel value The data field of the stored record is copied to the data2 field of token 7, the response signal of the channel 7 port will read the status word record, and the rounded bit of the read key word record will be changed to 1; when AorT is equal to 1 When performing the transform key word forwarding operation, the token 7 is a key token, and includes a 1-bit operator field, a 1-bit fadd field, and 4 bits of unintentional data in addition to the data field and the attribute domain. When dat The al domain is equal to 0, the data field of the key storage record whose address is equal to the ksel value described below is copied to its data2 field; when ksel is equal to Nk-1, the forwarding transform key word 1, fadd is equal to 0, and the operator field is equal to 0. Indicates that this token will perform the following f-transformation. When Nk is equal to 4, if ksel is equal to 7, it means forwarding the translation key word 2, the fadd field is equal to 1, and the operator field is equal to 0, indicating that this token will perform the following f Transformation, if Nk is not equal to 4 and ksel is equal to 3, it means forwarding the transformation key word 2, fadd is equal to 1, the operator field is equal to 1, indicating that the token will perform the following g transformation; the response signal of the channel 7 port will be read The status word record taken is cleared;
e3. 所述通道 10端口发送的令牌命名为令牌 10, 包括一个 32位的中间密钥 字域、 4个 32位的密钥字域 kQ-k3、 一个 5位的 BLOCK域和一个 1位的 step域, 打包时令牌 10的 step域等于令牌发送时所述的 step信号的值, 当令牌发送时刻所述 step信号等于 0时,令牌 10的中间密钥字域等于中 间密钥字存储区中地址等于 0的记录的数据, 令牌 10的 BLOCK域的值 等于所述 BLOCKL寄存器的值, 通道 10端口的应答信号把密钥存储区 低段的 4个密钥字的扩展位都置成 1,当令牌发送时刻所述 step信号等于 1时, 令牌 10的中间密钥字域等于中间密钥字存储区中地址等于 1的记 录的数据, 令牌 10的 BLOCK域的值等于所述 BLOCKH寄存器的值, 通道 10端口的应答信号把密钥存储区高段的所有密钥字的扩展位都置成 1; E3. The token sent by the channel 10 port is named token 10, and includes a 32-bit intermediate key field, four 32-bit key fields k Q -k 3 , a 5-bit BLOCK field, and A 1-bit step field, the step field of the token 10 is equal to the value of the step signal when the token is sent, and the intermediate key field of the token 10 when the step signal is equal to 0 when the token is sent. Equal to the recorded data in the intermediate key word storage area whose address is equal to 0, the value of the BLOCK field of the token 10 is equal to the value of the BLOCKL register, and the response signal of the channel 10 port is the 4 keys of the lower part of the key storage area. The extension bit of the word is set to 1. When the step signal is equal to 1 at the time of token transmission, the intermediate key word field of the token 10 is equal to the recorded data of the address equal to 1 in the intermediate key word storage area, the token 10 The value of the BLOCK field is equal to the value of the BLOCKH register, and the response signal of the channel 10 port sets the extension bits of all key words in the high section of the key storage area to 1;
e4. 该 KES控制密钥扩展的时序, 状态都采用二进制编码表示, KES的初始 状态二进制编码是 00, 即准备计算/的状态, 在此状态下执行变换密钥 字 1转发后, KES二进制编码变为 01, 进入执行 f变换的状态, 在 01状 态下读取低段密钥进行密钥扩展时, ES的状态变化为 11, 处于准备计 算 g的状态, 在 11的状态下执行变换密钥字 2操作后, KES的状态变化 为 10,进入执行 g变换的状态,在 10状态下读取髙段密钥进行密钥扩展 时, KES的状态变化为 00; E4. The timing of the KES control key extension, the state is represented by binary code, the initial state binary code of KES is 00, that is, the state of preparation/calculation, after performing the transformation key word 1 forwarding in this state, KES binary coding When it is changed to 01, the state in which the f-transformation is performed is performed. When the low-segment key is read in the 01 state to perform key expansion, the state of the ES changes to 11, the state in which the calculation g is prepared, and the transformation key is executed in the state of 11. KES status change after word 2 operation 10, enter the state of performing g transformation, and when the key is read in 10 state for key expansion, the state of KES changes to 00;
工作状态寄存器,向所述输入单元发送 WK信号,向所述通道开关单元 Switch 发送 WK信号, 接收来自下述 Matcher OK单元的 OK信号; 当 OK信号上升 时 WK复位; a working status register, transmitting a WK signal to the input unit, transmitting a WK signal to the channel switch unit Switch, receiving an OK signal from a Matcher OK unit described below; and resetting the WK when the OK signal rises;
Matcher II匹配单元,检査 AK暂存器单元中的状态字存储区和密钥字存储区, 发现就绪的状态字-密钥字对或就绪的变换密钥则随机选取其中之一, 把相应 的地址所选择信号传送给所述 AK 暂存器单位, 随后触发令牌发射信号 fetch— II , 所述的选择信号包括标记为了 ssel的 AddKey状态字读地址、 标记 为 ksd的密钥字读地址、 标记为 AOTT的表示发送令牌将执行的操作的信号- 0表示 AddKey运算, 1表示变换密钥字转发, 标记为 Trans; 该 Matcher II匹 配单元的输入包括: AK暂存器单元的状态字存储区和密钥字存储区的观测信 号, 其中包括状态字记录的 color位与 flag位, 密钥字记录的轮变换标记位和 扩展标记位、 flag域, BLOCKL和 BLOCKH, KES, 另外还有密钥分组列数 Nlc; 所述的 "就绪"是指: 计算所有被观测状态字和密钥字的序列号, 寻找 序列号相同且 flag都为 1的状态字 -密钥字对, 或者根据 KES状态检测并发现 相应的变换密钥字; 所述 fetch—II信号到来, 则触发所述 AK暂存单元把令牌 发送给 7#通道; 当被发送的状态字被清空, 或者 KES状态改变, 则 fetch一 II 复位;  The Matcher II matching unit checks the status word storage area and the key word storage area in the AK register unit, and finds that the ready status word-key word pair or the ready conversion key is randomly selected one of them. The address selection signal is transmitted to the AK register unit, and then the token transmission signal fetch_II is triggered. The selection signal includes an AddKey status word read address marked for ssel, and a key word read address labeled ksd. The signal labeled AOTT indicating the operation to be performed by the transmitting token - 0 indicates the AddKey operation, 1 indicates the conversion key word forwarding, and is labeled Trans; the input of the Matcher II matching unit includes: the status word of the AK register unit The observation signal of the memory area and the key word storage area, including the color bit and flag bits of the status word record, the round conversion flag bit and the extended flag bit of the key word record, the flag field, BLOCKL and BLOCKH, KES, and The number of key grouping columns Nlc; the "ready" means: calculating the sequence numbers of all observed status words and key words, looking for the same sequence number and flag is 1. a word-key pair, or detecting and finding a corresponding transform key word according to the KES state; when the fetch_II signal arrives, triggering the AK temporary storage unit to send the token to the 7# channel; when being sent The status word is cleared, or the KES status changes, then fetch-II is reset;
Matcher K匹配单元, 检查密钥字存储区和中间密钥字存储区的观测信号: 轮 变换标记位和扩展标记位、 flag和 KES状态; 当 KES处于密钥扩展状态下, 且相应的密钥字段和中间密钥字段已准备就绪则把标记为 step 的密钥扩展读 地址变为相应的值: 1为高段扩展, 0为低段扩展,并触发令牌发射信号 fetch— K, 所述的 AK暂存器单元根据 step信号把密钥区的相应数据以及 BLOCK值打包 成令牌等待发送, 当 fetchJ 信号来到时, 触发所述 AK暂存单元把该令牌经 通道 10发出;如果下述的 exp— stop信号有效, Matcher K匹配单元则停止工作; 密钥扩展运算单元, 用 Key Schedule标记, 接收并解析来自通道 10的令牌, 经过下述 Key Schedule处理后打包成内含所述新的扩展密钥的令牌经通道 9 发出, 所述的 Key Schedule的处理含有以下运算:  Matcher K matching unit, checking the observation signal of the key word storage area and the intermediate key word storage area: round transformation flag bit and extension flag bit, flag and KES state; when KES is in key extension state, and corresponding key When the field and intermediate key fields are ready, the key extended read address marked as step becomes the corresponding value: 1 is the high segment extension, 0 is the low segment extension, and triggers the token transmit signal fetch — K, The AK register unit packs the corresponding data of the key area and the BLOCK value into a token waiting for transmission according to the step signal, and when the fetchJ signal comes, triggers the AK temporary storage unit to send the token through the channel 10; The following exp-stop signal is valid, and the Matcher K matching unit stops working. The key expansion operation unit, which is marked with Key Schedule, receives and parses the token from channel 10, and is packaged into an inclusion after the following Key Schedule processing. The token of the new extended key is sent via channel 9, and the processing of the Key Schedule contains the following operations:
Π. 把所述令牌 10的中间密钥字域和 kQ-k3域作为输入, 执行 KeySch运算- 中间密钥字与 kQ逐位异或, 结果输出作为令牌 9的 1 域, 并与令牌 10 的1^逐位异或, 结果输出作为令牌 9的 ki, 并与令牌 10的1 逐位异或, 结果输出作为令牌 9的 1 ,并与令牌 10的 k3逐位异或,结果输出作为令 牌 9的 k3 ; 把. Taking the intermediate key field and the k Q -k 3 field of the token 10 as input, performing a KeySch operation - the intermediate key word is XORed with k Q , and the result is output as the 1 field of the token 9 And XOR bit by bit with token 10, the result is output as ki of token 9, and XORed with 1 of token 10, the result is output as 1 of token 9, and with k of token 10 3 bitwise XOR, the result is output as k 3 of token 9 ;
12. 把所述令牌 10的 BLOCK域加 1后的结果作为令牌 9的 BLOCK值; π 13. 当 Nk=4时,把所述令牌 10的 step域的逻辑反作为所述令牌 9的 part域, 如果 Nk>4,则把所述令牌 10的 step域直接复制到所述令牌 9的 part域; AddKey运算单元, 在接收并解析通道 7发来的操作数令牌后, 对其中的数据 执行 AddKey运算后, 打包成轮密钥混合令牌, 经通道 8发送, 所述 AddKey 运算即 AES算法定义的轮密钥加法操作作用于状态的一列; 所述经通道 8发 送的令牌, 命名为令牌 8, 包括一个 32位的数据域和一个 1位的属性域, 当 属性域等于 0时, 是状态字令牌, 还包括一个 4位的 color域和一个 位的 column域, 当属性域等于 1时, 是密钥令牌, 还包括一个 1位的操作数域和 一个 1位的 fadd域, 打包时, 把令牌 7的 datal与 data2逐位异或的结果作为 令牌 8的结果, 令牌 7的其余域直接复制到令牌 8中与之同名的域中; 轮更新通道开关单元, 对来自通道 8的令牌进行轮次检査, 若是状态字令牌且 轮次已经达到迭代轮次 Nr, 则经通道 11转发到下述输出暂存单元; 否则, 把 其轮次加 1经通道 1转发到下述 EU暂存器单元执行后续处理; 若到达的令牌 轮次为 Nr, 且上述与其相加的扩展密钥属于密钥分组的高段, 即表示密钥扩 展已经完成,则触发 exp— stop信号;若是密钥字令牌则直接由通道 1转发到下 述 EU暂存器单元执行后续处理; 所述令牌处理包括如下 3情况: 12. The result of adding 1 to the BLOCK field of the token 10 is taken as the BLOCK value of the token 9; π 13. When Nk=4, the logical reverse of the step field of the token 10 is used as the part field of the token 9, and if Nk>4, the step field of the token 10 is directly copied to the The part field of the token 9; after receiving and parsing the operand token sent by the channel 7, the AddKey operation unit performs the AddKey operation on the data therein, and then packs it into a round key hybrid token, which is sent through the channel 8. The AddKey operation, that is, the round key addition operation defined by the AES algorithm acts on a column of states; the token sent via the channel 8 is named as token 8, and includes a 32-bit data field and a 1-bit attribute field. When the attribute field is equal to 0, it is a status word token, and also includes a 4-bit color field and a bit column field. When the attribute field is equal to 1, it is a key token and also includes a 1-bit operand field. And a 1-bit fadd field, when packing, the result of bitwise XOR of the data1 and data2 of the token 7 is the result of the token 8, and the remaining fields of the token 7 are directly copied to the domain of the same name in the token 8. In the wheel; update the channel switch unit, perform a round check on the token from channel 8, if The status word token and the round has reached the iteration round Nr, then it is forwarded to the following output temporary storage unit via channel 11; otherwise, its round plus 1 is forwarded via channel 1 to the following EU register unit for subsequent processing If the arrived token is Nr, and the above-mentioned extended key belongs to the high segment of the key packet, indicating that the key extension has been completed, the exp_stop signal is triggered; if it is the key word token Directly forwarded by channel 1 to the following EU register unit to perform subsequent processing; the token processing includes the following three cases:
Id. 通道 11传输的令牌, 命名为令牌 11, 包括一个 32位的数据域和一个 2 位的 column域, 打包时, 令牌 8的数据域直接复制到令牌 11的数据域, 令牌 8的 column域直接复制到令牌 11的 column域; Id. The token transmitted by channel 11, named token 11, includes a 32-bit data field and a 2-bit column field. When packing, the data field of token 8 is directly copied to the data field of token 11, The column field of the card 8 is directly copied to the column field of the token 11;
k2. 当令牌 8的属性域为 0时, 所述通道 1发送的令牌, 命名为令牌 1, 是状 态字令牌, 包括一个 32位的数据域、 一个 4位的 color域、 一个 2位的 column域一个 1位的操作符域和一个 1位的属性域打包时, 令牌 8的数 据域和 column域直接复制到令牌 1中同名的域中,令牌 8的 color域加 1 后的结果作为令牌 1的 color域,令牌 1的属性域等于 0,若令牌 8的 color 域等于 Nr-1, 则令牌 1的操作符域标记为 Srd操作, 否则令牌 1的操作 符域标记位 SM操作; K2. When the attribute field of token 8 is 0, the token sent by channel 1 is named token 1, which is a status word token, including a 32-bit data field, a 4-bit color field, and a When the 2-bit column field is packed with a 1-bit operator field and a 1-bit attribute field, the data field and the column field of token 8 are directly copied to the domain of the same name in token 1, and the color field of token 8 is added. The result after 1 is the color field of token 1, the attribute field of token 1 is equal to 0, and if the color field of token 8 is equal to Nr-1, the operator field of token 1 is marked as Srd operation, otherwise token 1 Operator field flag bit SM operation;
k3. 如果令牌 8的属性域等于 1,所述通道 1发送的令牌 1是变换密钥字令牌, 包括一个 32位的数据域、 一个 1位的操作符域、 一个 1位的 fadd域和 5 位不关心的数据, 打包时, 令牌 8的各域分别直接复制到令牌 1 中同名 的域中; K3. If the attribute field of token 8 is equal to 1, the token 1 sent by channel 1 is a transformed key word token, including a 32-bit data field, a 1-bit operator field, and a 1-bit fadd. Domain and 5 bits of data that are not of interest. When packing, the fields of token 8 are directly copied to the domain of the same name in token 1;
输出暂存单元, 是一个密文重排的暂存单元, 由一个 4 X 32 比特的存储单元 和令牌解析电路组成, 该单元接收通道 11来的乱序到达的结果令牌所携带的 密文数据并暂存, 写入的地址是所述令牌 11的 column域, 写入的数据是所述 令牌 11的数据域, 在接收到下述输出单元的读地址信号后输出对应的密文状 态字到下述输出单元; 所述的暂存单元的每个存储单元都对应一个标记为 flag 的"满 /空"标记位, 当单元写入时 flag置 1,表示满, 当数据读出后 flag复位, 表示空; The output temporary storage unit is a ciphertext rearrangement temporary storage unit, which is composed of a 4×32-bit storage unit and a token parsing circuit, and the unit receives the denseness carried by the result token of the out-of-order arrival of the channel 11. The text data is temporarily stored, and the written address is the column field of the token 11, and the written data is the data field of the token 11, and the corresponding secret is output after receiving the read address signal of the output unit described below. a status word to the following output unit; each of the storage units of the temporary storage unit corresponds to a flag The "full/empty" flag bit, when the unit is written, the flag is set to 1, indicating full. When the data is read, the flag is reset, indicating that it is empty;
m. 输出单元, 该单元是所述芯片与外部的接口、实现把密文按要求的时序输出的 功能,每当其检测到所述 OK信号为高电平时则从 00到 11依次产生上述输出 暂存单元的读出地址, 所述地址为二进制表示, 读入上述输出暂存单元的密文 字, 并按按照输出协议输出密文分组; m. an output unit, the unit is an interface between the chip and the external, and realizes a function of outputting the ciphertext according to a required timing, and the output is sequentially generated from 00 to 11 every time it detects that the OK signal is high level a read address of the temporary storage unit, the address is a binary representation, the secret text of the output temporary storage unit is read, and the ciphertext packet is output according to the output protocol;
n. Matcher OK匹配单元, 检査所述输出暂存单元中的所有 flag信号, 当所有的 flag 都为 1则表示全部密文字都已到达, 则把结束信号 OK变成高电位, 在通 知所述工作状态存储器的同时也通知所述输出单元读取所述输出暂存单元的 密文状态字, 当 flag被复位后, OK信号变为低电位; n. Matcher OK matching unit, check all the flag signals in the output temporary storage unit, when all the flags are 1, it means that all the secret words have arrived, then the end signal OK becomes high, at the notification station The working state memory is also notified to the output unit to read the ciphertext status word of the output temporary storage unit, and when the flag is reset, the OK signal becomes a low potential;
0. EU暂存器单元, 由一个密钥字存储区和两个完全相同的状态存储区组成, 依 次标记为 key store、 storeO和 storel; 其中, key store存储密钥扩展的变换密 钥字, 一条存储记录包括一个 32位的数据域、 一个 1位的 fadd域和一个 1位 的操作符域, storeO/storel依次存储行移位之前 "状态" 中的第 0-第 3列, 每 列存储单元又分为 4行, 第 0行的记录包括 1个 8位的数据域、 一个 4位的 color域和一个 1位的操作符域, 第 1行至第 3行的记录包含一个 8位的数据 域; 所述两个状态存储单元按照乒乓式读写的流水线方式工作: 根据输入令牌 的轮次标记, 当轮次为偶数时写入 storeO, storel中的数据必是前一轮的状态, 从 storel中读取数据处理; 当令牌的轮次为奇数, 则写入 storel,store0必是前 一轮状态的待处理数据, 从 storeO中读取数据处理; 该 EU暂存器单元设有一 个传输通道端口, 接收所述轮更新通道开关单元经通道 1发出的令牌 1, 从中 解析出令牌类型: 状态令牌还是密钥令牌、 写地址和记录数据, 并把记录写入 相应的存储单元中;一个输出传输通道端口,与通道 2相连,根据下述 Matcher I 匹配单元输入的读地址、 storeO/storel 选择信号以及状态 /变换密钥选择信号 输出相应的状态字或变换密钥字, 与其他控制信号一起打包成令牌, 经通道 2 发送给下述 EU运算单元; 上述 3个暂存区的每个存储单元都对应一个标记为 flag的 "满 /空"标记位, 当单元写入时 flag置 1, 表示满, 当数据读出后 flag 复位, 表示空; 0. The EU register unit is composed of a key word storage area and two identical state storage areas, which are sequentially labeled as key store, storeO, and storel; wherein, the key store stores the key expansion conversion key word, A storage record consists of a 32-bit data field, a 1-bit fadd field, and a 1-bit operator field. storeO/storel stores the 0th to 3rd columns in the "state" before the row shift, and each column stores The unit is further divided into 4 lines, and the record of the 0th line includes an 8-bit data field, a 4-bit color field, and a 1-bit operator field, and the records of the 1st line to the 3rd line contain an 8-bit field. Data field; the two state storage units work in a pipeline mode of ping-pong type reading and writing: according to the round mark of the input token, when the round is even, the storeO is written, and the data in the storel must be the state of the previous round. Read data processing from storel; when the token round is odd, write to storel, sto re 0 must be the pending data of the previous round state, read data processing from storeO; the EU register The unit has a transmission channel port, receiving station The round update channel switch unit sends a token 1 via channel 1, from which the token type is parsed: a status token or a key token, a write address and a record data, and writes the record to the corresponding storage unit; an output The transmission channel port is connected to channel 2, and outputs the corresponding status word or conversion key word according to the read address input by the Matcher I matching unit, the storeO/storel selection signal, and the state/transform key selection signal, together with other control signals. Packaged into tokens, sent to the following EU operation unit via channel 2; each of the above three temporary storage areas corresponds to a "full/empty" flag bit labeled flag, and flag is set when the unit is written. , indicates full, flag is reset after data is read, indicating empty;
ol. 所述的令牌解析方法是: 当所述令牌 1的属性域为 0时, 是状态字令牌, 写入地址是令牌 1的 column域, 写入记录的第 0行的数据域是令牌 1数 据域的 7至 0位, 第 0行的 color域是令牌 1的 color域, 第 0行的操作 符域是令牌 1的操作符域, 写入记录的第 1行到第 3行的数据分别依次 是令牌 1数据域的 15位至 8位、 23位至 16位和 31至 24位; 当所述令 牌 1的属性域为 1时, 是密钥令牌, 令牌 1的数据域复制到所述变换密 钥字存储记录的数据域, 令牌 1的 fadd域和操作符域直接复制到所述变 换密钥字存储记录的同名域中; The token resolution method is: when the attribute field of the token 1 is 0, it is a status word token, the write address is the column field of the token 1, and the data of the 0th line of the record is written. The field is the 7 to 0 bit of the token 1 data field, the color field of the 0th line is the color field of the token 1, the operator field of the 0th line is the operator field of the token 1, and the first line of the record is written. The data to the third row are respectively 15 bits to 8 bits, 23 bits to 16 bits, and 31 to 24 bits of the token 1 data field; when the attribute field of the token 1 is 1, it is a key token. The data field of the token 1 is copied to the data field of the transformed key word storage record, and the fadd field and the operator field of the token 1 are directly copied to the variable Change the key word to store the record in the same name field;
02. 所述的经通道 2发送的令牌被命名为令牌 2, 它的打包方法是: 当所述的 状态 /变换密钥选择信号等于 0时, 令牌 2是状态字令牌, 属性域等于 0, 数据域的 7到 0位是地址等于所述的 Matcher I匹配单元输入的读地址的 第 0行记录的数据域,数据域的 15到 8位是经过 AES算法定义的行移位 运算后的地址等于所述读地址的第 1行记录的数据域,数据域的 23到 16 位是经过 AES算法定义的行移位运算后的地址等于所述读地址的第 2行 记录的数据域, 数据域的 31到 24位是经过 AES算法定义的行移位运算 后的地址等于所述读地址的第 3行记录的数据域, 令牌 2的 color域和操 作符域分别是地址等于所述读地址的第 0行记录的 color域和操作符域, 令牌 2的 column域是所述读地址的值;当所述的状态 /变换密钥选择信号 等于 0时, 令牌 2是密钥自令牌, 属性域等于 1, 数据域是变换密钥存储 记录的数据域, fadd域和操作符域分别是变换密钥存储记录的 fadd域和 操作符域;  02. The token sent via channel 2 is named token 2, and its packing method is: when the state/transform key selection signal is equal to 0, token 2 is a state word token, attribute The field is equal to 0, the 7 to 0 bits of the data field are the data fields of the 0th row of the address equal to the read address of the Matcher I matching unit input, and the 15 to 8 bits of the data field are the row shifts defined by the AES algorithm. The calculated address is equal to the data field of the first row of the read address, and the 23 to 16 bits of the data field are the data after the row shift operation defined by the AES algorithm is equal to the data recorded in the second row of the read address. Domain, the 31 to 24 bits of the data field are the data fields of the third row of the read address after the row shift operation defined by the AES algorithm, and the color field and the operator field of the token 2 are equal to the address respectively. The color field and the operator field of the 0th line of the read address, the column field of the token 2 is the value of the read address; when the state/transform key selection signal is equal to 0, the token 2 is Key from token, domain equal to 1, According domain is a domain key stored in the transformation data records, fadd operator domain and domain are fadd operator domain and transform domain key stored records;
Matcher I匹配单元, 检查 key store和 storeO/storel中的令牌信息, 在考虑行移 位变换之后发现就绪的状态字或者发现变换密钥则随机选取一个,把地址信息 送给所述 EU暂存器单元,并通过 fetch— I信号触发通道 2端口的触发信号,把 所述 EU暂存单元的令牌 2发送给所述 EU运算单元; 所述 Matcher I 匹配单 元的输入包括来自所述 EU暂存器单元的观测端口的信号, 通道 2端口的应答 信号以及所述控制选择的随机信号; 同时, 向 EU暂存器单元输出所述 fetch— I 令牌发送信号;  The Matcher I matching unit checks the token information in the key store and storeO/storel, finds the ready status word or finds the transformation key after considering the row shift transformation, and randomly selects one, and sends the address information to the EU temporary storage. a unit, and triggering a trigger signal of the channel 2 port by a fetch_I signal, and transmitting the token 2 of the EU temporary storage unit to the EU operation unit; the input of the Matcher I matching unit includes the EU temporary a signal of the observation port of the memory unit, a response signal of the channel 2 port, and a random signal of the control selection; meanwhile, outputting the fetch_I token transmission signal to the EU register unit;
全局存储器, 存储密钥分组列数 Nk, 迭代轮数 Nr, 其中, 向 EU暂存器、 下 述 EU运算单元、 Matcher II两个单元和密钥扩展运算单元输出 Nk, 向轮更新 通道开关单元输出 Nr, The global memory stores the key grouping number Nk, the number of iterations Nr, and outputs Nk to the EU register, the following EU operation unit, the Matcher II unit, and the key extension operation unit, and updates the channel switching unit to the wheel. Output Nr,
EU运算单元, 接收来自通道 2的令牌 2, 解析后根据令牌 2的属性域和操作 符域以及所述密钥分组列数 Nk对数据域执行相应的计算, 操作结果打包到令 牌 3的数据域中通过通道 3发送; 其中, 所述令牌 3除数据域外, 还有一个 1 位的属性域, 其值等于所述令牌 2的属性域值: 当属性域等于 0时, 是状态字 令牌, 还有一个 4位的 color域和一个 2位的 column域; 当属性域等于 1时, 是密钥字令牌, 还有一个 1位的 fadd域, 还有 5位不关心的数据, 打包时, 令牌 2的 fadd域直接复制到令牌 3的 fadd域中; 所述对于令牌数据域的计算 包括:  The EU operation unit receives the token 2 from the channel 2, and after parsing, performs corresponding calculation on the data domain according to the attribute domain and the operator domain of the token 2 and the number of key grouping columns Nk, and the operation result is packaged into the token 3 The data field is sent through channel 3. The token 3 has a 1-bit attribute field in addition to the data field, and its value is equal to the attribute field value of the token 2: when the attribute field is equal to 0, The status word token, there is also a 4-bit color field and a 2-bit column field; when the attribute field is equal to 1, it is a key word token, there is also a 1-bit fadd field, and 5 bits do not care. Data, when packaged, the fadd field of token 2 is directly copied to the fadd field of token 3; the calculation for the token data field includes:
rl. Srd操作, 当令牌 2的属性域等于 0且操作符域为所述的 Srd标记时或当 令牌 2的属性域等于 1且操作符域为 1且所述密钥分组列数 Nk大于 6时 执行, 即对数据域的每个字节执行 AES算法定义的 Srd査表操作; 所述 令牌 2属性域等于 1且操作符域为 1时的操作即是上述的 g变换在 Nk大 于 6时的操作; Rl. Srd operation, when the attribute field of token 2 is equal to 0 and the operator field is the Srd flag or when the attribute field of token 2 is equal to 1 and the operator field is 1 and the key grouping number is Nk Executed when greater than 6, that is, performing an ARS algorithm-defined Srd lookup table operation for each byte of the data field; The operation when the Token 2 attribute field is equal to 1 and the operator field is 1 is the operation of the g conversion described above when Nk is greater than 6.
r2. Srd-MkCol操作, 当令牌 2的属性域等于 0且操作符域为所述的 SM标 记时执行,即先对数据域的每个字节执行 AES算法定义的 Srd査表操作, 再对 4个字节的结果向量左乘一个 4X4的常数矩阵, 其中所述的常数矩 阵为 AES算法中定义的列混合操作对应的常数矩阵; R2. The Srd-MkCol operation is performed when the attribute field of the token 2 is equal to 0 and the operator field is the SM tag, that is, the Srd table lookup operation defined by the AES algorithm is performed on each byte of the data field, and then The 4-byte result vector is left-multiplied by a 4×4 constant matrix, wherein the constant matrix is a constant matrix corresponding to the column mixing operation defined in the AES algorithm;
r3. Srd-循环移位 -轮常量相加计算,是上述的 f变换当令牌 2的属性域等于 1 且所述密钥令牌的操作符域为 0 时执行, 即先对数据域的每个字节执行 AES算法定义的 Srd査表操作, 再将 4个字节的结果循环左移 8位, 最 后,所得结果的低 8位与一个 8位的轮常量 RC逐位异或;所述轮常量初 值为 0, 每执行一次轮常量加法运算后, 其值乘以 2, 所述乘 2操作是定 义在 GF (28) 域上的; R3. Srd-cyclic shift-round constant addition calculation is the above-mentioned f-transformation when the attribute field of token 2 is equal to 1 and the operator field of the key token is 0, that is, the data field first Each byte performs the Srd lookup table operation defined by the AES algorithm, and then shifts the result of 4 bytes to the left by 8 bits. Finally, the lower 8 bits of the obtained result are XORed with an 8-bit round constant RC; The initial value of the round constant is 0. After each round of constant addition, the value is multiplied by 2, and the multiplied 2 operation is defined on the GF (2 8 ) domain;
r4. 直接转发操作,当令牌 2的属性域等于 1且所述状态令牌的操作符域为 1 且 Nk小于等于 6时执行,即令牌 2的数据域直接复制到所述令牌 3的数 据域; 所述令牌 2属性域等于 1且操作符域为 1 时的操作即是上述的 g 变换在 Nk下与等于 6时的操作; R4. The direct forwarding operation is performed when the attribute field of the token 2 is equal to 1 and the operator field of the status token is 1 and Nk is less than or equal to 6, that is, the data field of the token 2 is directly copied to the token 3 Data field; the operation when the token 2 attribute field is equal to 1 and the operator field is 1 is the operation of the above g transform under Nk and equal to 6;
Matcher II随机控制码产生电路, 随机产生控制所述 Matcher II匹配单元中仲 裁电路的 3位随机选择码, 每次 fetch— II下降时产生一个新的随机控制码; Matcher I随机控制码产生电路, 随机产生控制所述 Matcher I匹配单元中仲裁 电路的 3位随机选择码, 每次 fetch— I下降时产生一个新的随机控制码; 上述的 Matcher II单元与 AK暂存单元构成了 AddKey运算单元的令牌暂存- 匹配 -发射结构, 简称为 HMF结构, Matcher I单元与 EU暂存单元构成了 EU 运算单元的 HMF 结构, Matcher K 与 AK暂存单元的密钥存储区构成了 KeySchedule单元的 HMF 结构, Matcher OK与输出暂存单元构成了输出的 HMF结构; 所述 HMF结构具有如下特征: a Matcher II random control code generating circuit randomly generates a 3-bit random selection code for controlling an arbitration circuit in the Matcher II matching unit, and generates a new random control code each time fetch-II falls; a Matcher I random control code generating circuit, Randomly generating a 3-bit random selection code for controlling the arbitration circuit in the Matcher I matching unit, and generating a new random control code each time fetch_I falls; the above-mentioned Matcher II unit and the AK temporary storage unit constitute an AddKey operation unit. The token temporary storage-matching-transmitting structure, referred to as the HMF structure, the Matcher I unit and the EU temporary storage unit constitute the HMF structure of the EU computing unit, and the key storage area of the Matcher K and AK temporary storage unit constitutes the HMF of the KeySchedule unit. The structure, the Matcher OK and the output temporary storage unit constitute an output HMF structure; the HMF structure has the following characteristics:
ul . 包含一个输入通道端口, 也是下述令牌暂存单元的写端口; 包含一个输 出通道端口; Ul. Contains an input channel port, which is also the write port of the token temporary storage unit described below; contains an output channel port;
u2. 包含一个令牌暂存单元, 由寄存器堆实现, 写端口采用异步握手协议; 写 地址和写入数据由输入令牌解析得出, 写入时钟由输入通道端口的请求 信号触发; 读端口的地址由下述匹配单元输出的选择信号决定, 输出数 据随读地址即时变化; 输出数据端口和读地址端口经过下述令牌打包电 路与所述 HMF的输出通道端口的数据端口相连; 内部存储单元对应有表 示记录是否存在的 "满 /空"标志位, 只有记录为 "空" 时该地址才能被 写入, 所有单元的满空标志位和记录与下述匹配条件相关的域的数据组 成观测信号, 可被下述匹配单元读取; 所述输出数据可被下述令牌打包 逻辑读取; 所述满空标志位由一个 c单元产生, 该 c单元的一端接对应 记录的写入时钟, 另一输入端接记录的清空信号信号的反信号; 所述各 个记录的写入时钟由写端口的接收应答信号经过写地址选择产生, 所述 各个记录的清空信号由所述 HMF输出通道端口的应答信号经读地址选择 产生; U2. Contains a token temporary storage unit, implemented by the register file, the write port uses the asynchronous handshake protocol; the write address and write data are parsed by the input token, and the write clock is triggered by the request signal of the input channel port; The address is determined by the selection signal output by the matching unit described below, and the output data changes instantaneously with the read address; the output data port and the read address port are connected to the data port of the output channel port of the HMF via a token packing circuit described below; internal storage The unit corresponds to a "full/empty" flag indicating whether the record exists. Only when the record is "empty", the address can be written, the full-empty flag of all cells and the data of the domain associated with the following matching conditions are recorded. The observed signal can be read by the following matching unit; the output data can be packed by the following token Logic read; the full-empty flag bit is generated by a c-unit, one end of the c-unit is connected to the write clock corresponding to the record, and the other input is connected to the inverted signal of the recorded clear signal signal; The clock is generated by the write response of the write port by the write address, and the clear signal of each record is generated by the read signal of the HMF output channel port by the read address;
u3. 包含一个匹配单元, 由匹配逻辑和选择逻辑电路两部分组成, 暂存单元 各个记录的观测信号输入匹配逻辑电路中按照匹配条件对应的布尔表达 式算出各自的匹配结果值, 匹配成功则值为 1, 否则等于 0; 每个匹配结 果信号通过一级 C单元输出到所述选择逻辑的输入端成为请求信号, 所 述 c单元的另一输入端与所有请求信号的或信号相连, 只有请求信号全 为 0时等于 1 的匹配结果才能传递到选择逻辑电路, 当请求信号中存在 有效请求, 即为 1 的请求信号, 在它之后产生的成立的匹配结果就无法 通过 C单元; 请求对应的令牌被发送后, 请求复位, C单元对成立的匹 配结果导通; 所述 Matcher I和 Matcher II单元的选择逻辑是一个仲裁逻 辑电路, 对每个被检测的令牌组的请求信号进行随机选择, 输出的是选 中请求的序号,并由此产生令牌暂存器的读地址;所述的 Matcher K单元 的选择电路是计算匹配成功的请求对应的所述 step信号; 所述 Matcher OK没有选择电路;匹配单元的选择电路输出的请求序号通过锁存器输出 成为令牌的选择信号; 根据所述选择信号的选择选择对应的所述的请求 信号成为令牌发射触发信号, 如所述的 fetch— II、 fetch— I、 fetch_K信号; u4. 令牌发射触发信号经过长度等于选择电路输出稳定所需的最长时间的延 时后触发所述选择信号的锁存器的控制端将锁存器锁存, 同时触发发送 令牌的请求信号; 上述请求信号和上述选择信号所存器的控制信号的与 信号是上述 HMF输出通道端口的请求信号;令牌打包电路是一个组合电 路, 其输入是上述令牌暂存单元的输出数据和读地址, 其输出是符合输 出通道令牌定义的数据; 所述暂存单元的复位应答信号将所述选择信号 的锁存器的控制端复位, 使锁存器导通, 选择信号重新随所述匹配单元 的选择逻辑电路输出变化。  U3. Contains a matching unit, which is composed of two parts: matching logic and selection logic circuit. The observation signal input matching logic circuit of each record of the temporary storage unit calculates the matching result value according to the Boolean expression corresponding to the matching condition, and the matching result is successful. Is 1, otherwise equal to 0; each matching result signal is output to the input of the selection logic through the primary C unit as a request signal, and the other input of the c unit is connected to the OR signal of all request signals, only the request When the signal is all 0, the matching result equal to 1 can be passed to the selection logic circuit. When there is a valid request in the request signal, the request signal is 1, and the established matching result generated after it cannot pass the C unit; After the token is sent, the request is reset, and the C unit is turned on for the established matching result; the selection logic of the Matcher I and Matcher II units is an arbitration logic circuit, and the request signal of each detected token group is randomized. Select, output the serial number of the selected request, and generate the token register Reading the address; the selection circuit of the Matcher K unit is to calculate the step signal corresponding to the request for successful matching; the Matcher OK has no selection circuit; the request sequence output by the selection unit of the matching unit is output as a token through the latch a selection signal; selecting the corresponding request signal according to the selection of the selection signal to become a token transmission trigger signal, such as the fetch_II, fetch_I, fetch_K signal; u4. the token transmission trigger signal passes the length a control terminal that triggers the latch of the selection signal after the delay of the longest time required to select the circuit output is stable, latches the latch, and simultaneously triggers a request signal for transmitting the token; the request signal and the selection signal The sum signal of the control signal of the stored device is the request signal of the HMF output channel port; the token packing circuit is a combined circuit whose input is the output data and the read address of the token temporary storage unit, and the output thereof is in accordance with the output channel order Data defined by the card; a reset response signal of the temporary storage unit will latch the selection signal A control terminal to reset the latch is turned on, re-select signal matching with the change in output select logic unit.
在上述各单元中, 所有传输通道都釆用异步握手协议; 所有运算单元的数据处理 和令牌打包由组合逻辑电路实现; 所述通道开关单元 Switch, 初始密钥寄存器、 AK暂 存器单元、 Matcher K匹配单元、 密钥扩展运算单元共同构成了密钥扩展环, 而通道开 关单元 Switch、 Matcher II匹配单元、 AddKey运算单元、 轮更新通道开关单元、 EU暂 存器单元, Matcher I匹配单元、 EU运算单元构成轮变换环, 环内用传输通道相连, 环 间用开关单元 Switch相连。  In each of the above units, the asynchronous handshake protocol is used for all transmission channels; the data processing and token packing of all the arithmetic units are implemented by the combinational logic circuit; the channel switching unit Switch, the initial key register, the AK register unit, The Matcher K matching unit and the key expansion operation unit together constitute a key extension ring, and the channel switching unit Switch, the Matcher II matching unit, the AddKey operation unit, the round update channel switch unit, the EU register unit, the Matcher I matching unit, The EU arithmetic unit constitutes a wheel change ring, and the ring is connected by a transmission channel, and the ring is connected by a switch unit Switch.
本发明的仿真结果如下- a) 功能验证: The simulation results of the present invention are as follows - a) Functional verification:
对最终的流片电路进行 verilog和电路及仿真。 其中 verilog测试涵盖了 AES标准 官方网站提供的全部已知答案验证, 全部通过。  Verilog and circuit and simulation of the final streamer circuit. The verilog test covers all known answer verifications provided by the AES standard official website, all passed.
b) 安全性估计:  b) Security estimate:
对实验芯片进行下述测试: 分别在密钥所有位等于 0和密钥所有位等于 1的情况 下, 对同一个 128位的明文分组加密, 顺序控制码随机产生, 两种情况下各采集 40条 功耗曲线, 求出两组样本的样本绝对差分曲线; 另取相同顺序控制码下用全 0密钥和全 1密钥加密所得的两条功耗曲线, 求出它们的绝对差分曲线, 两条差分曲线如图 11 所 示。 图中确定顺序执行所得的最大功耗差分大于乱序执行所得的最大功耗差分, 实验确 定顺序执行所得的最大功耗差分约等于 0.059W, 乱序执行所得的最大功耗差分约等于 0.030W, 是前者的 50%。  The following test is performed on the experimental chip: In the case where all bits of the key are equal to 0 and all bits of the key are equal to 1, respectively, the same 128-bit plaintext packet is encrypted, and the sequential control code is randomly generated, and in each case, each acquisition 40 The power consumption curve is used to obtain the absolute difference curve of the samples of the two groups of samples; the two power consumption curves obtained by encrypting the all-zero key and the all-one key under the same sequence control code are used to obtain the absolute difference curves of the samples. The two differential curves are shown in Figure 11. In the figure, it is determined that the maximum power consumption difference obtained by sequential execution is larger than the maximum power consumption difference obtained by out-of-order execution. The maximum power consumption difference obtained by the experimental execution sequence is approximately equal to 0.059 W, and the maximum power consumption difference obtained by out-of-order execution is approximately equal to 0.030 W. , is 50% of the former.
c) 其它指标  c) Other indicators
实验芯片 128位密钥情况下内核的吞吐率范围为 59M~63Mbps, 加密一个分组的 能量消耗为 52.9nJ (低于国际公布的同类芯片的能耗)。 附图说明  In the case of a 128-bit key, the kernel's throughput rate ranges from 59M to 63Mbps, and the energy consumption of encrypting a packet is 52.9nJ (less than the energy consumption of similarly announced chips). DRAWINGS
图 1 4相位握手协议传输通道。 Figure 1 4 phase handshake protocol transmission channel.
图 2 4相位异步握手协议。 Figure 2 4 phase asynchronous handshake protocol.
图 3 4相位握手协议异步传输通道实现电路。 Figure 3 4 phase handshake protocol asynchronous transmission channel implementation circuit.
图 4 Rijndael的轮变换定义。 Figure 4 Rijndael's round transformation definition.
图 5 ShiftRow图解 (128位)。 Figure 5 ShiftRow diagram (128 bit).
图 6 Rijndael算法的密钥分组间的计算关系。 Figure 6 The calculation relationship between the key groups of the Rijndael algorithm.
图 7 Rijndael密钥扩展结构。 Figure 7 Rijndael key extension structure.
图 8 KeySch单元逻辑图。 Figure 8 KeySch unit logic diagram.
图 9 密钥扩展实现方法流程图 (a) Nk=4(b)Nk=6 (c) Nk=8。 Figure 9 Flow chart of key expansion implementation method (a) Nk=4(b)Nk=6 (c) Nk=8.
图 10 本发明的 AES实现算法流程 (a)密钥令牌处理流程; (b)状态令牌出来流程。 图 11 全 0密钥与全 1密钥的功耗差分曲线 UES-128。 Figure 10 Flow chart of the AES implementation algorithm of the present invention (a) Key token processing flow; (b) State token exit flow. Figure 11 Power consumption differential curve for all 0 keys and all 1 keys UES-128.
图 12 结构图。 Figure 12 is a block diagram.
图 13 输入模块电路结构。 Figure 13 Input module circuit structure.
图 14 输出模块电路结构。 Figure 14 Output module circuit structure.
图 15 HMF结构示意图。 Figure 15 Schematic diagram of the HMF structure.
图 16 令牌暂存器基本结构 (4单元)。 Figure 16 The basic structure of the token register (4 units).
图 17 匹配单元结构。 Figure 17 Matching unit structure.
图 18 4选 1仲裁器电路 (a) R-boxO (b) R-boxl (c) 整体电路。 图 19 发射电路的逻辑图。 Figure 18 4 select 1 arbiter circuit (a) R-boxO (b) R-boxl (c) overall circuit. Figure 19 is a logic diagram of the transmit circuit.
图 20 密钥扩展状态机。 Figure 20 Key Expansion State Machine.
图 21 pp信号产生电路。 Figure 21 pp signal generation circuit.
图 22 Switch电路结构。 Figure 22 Switch circuit structure.
图 23 轮更新单元结构。 Figure 23 Wheel update unit structure.
图 24 令牌 1至 EU暂存单元的转移关系 (a) 状态令牌 (b) 密钥令牌。 Figure 24 Transfer relationship of token 1 to EU temporary storage unit (a) Status token (b) Key token.
图 25 EU暂存单元存储记录到令牌 2的转移关系 (a) 状态令牌 (b) 密钥令牌。 Figure 25 EU temporary storage unit stores the transfer relationship recorded to token 2 (a) status token (b) key token.
图 26 令牌 2到令牌 3的转移关系 (a) 状态令牌 (b) 密钥令牌。 Figure 26 Transfer relationship from token 2 to token 3 (a) status token (b) key token.
图 27 EU单元的各种运算的流程: (a)Srd运算 (b)SM运算 (c)RC运算。 Figure 27 Flow of various operations of the EU unit: (a) Srd operation (b) SM operation (c) RC operation.
图 28 令牌 3到令牌 5和令牌 3到令牌 6的转移关系 (a) 令牌 3到令牌 5 (b) 令牌 3 到令牌 6。 Figure 28 Transfer relationship between token 3 to token 5 and token 3 to token 6 (a) token 3 to token 5 (b) token 3 to token 6.
图 29 令牌 4到令牌 5的转移关系。 Figure 29 Transfer relationship from token 4 to token 5.
图 30 令牌 5到 SR的转移关系。 Figure 30 Transfer relationship of token 5 to SR.
图 31 令牌 6到 AK暂存单元的 KR的转移关系。 Figure 31 Transfer relationship of token 6 to the KR of the AK temporary storage unit.
图 32 AK暂存单元存储的数据到令牌 7的转移关系 (a) AddKey操作令牌发射 (b) 变换密钥字令牌转发 (Nk>4) (c)变换密钥字令牌转发 (Nk=4)。 Figure 32 Transfer relationship of data stored by the AK temporary storage unit to token 7 (a) AddKey operation token transmission (b) Transformation key word token forwarding (Nk>4) (c) Transformation key word token forwarding ( Nk=4).
图 33 令牌 7到令牌 8的转移关系。 Figure 33 Transfer relationship from token 7 to token 8.
图 34 令牌 8到令牌 1和令牌 11的转移关系 (a) 密文令牌发送 (b) 状态令牌轮次更 新 (C ) 密钥令牌转发。 Figure 34 Transfer relationship between token 8 to token 1 and token 11 (a) ciphertext token transmission (b) status token round update (C) key token forwarding.
图 35 令牌 10到令牌 9的转移关系。 Figure 35 Transfer relationship between token 10 and token 9.
本发明最佳实施方式 Best mode for carrying out the invention
我们按照本发明实现了一个数据流 AES 加密芯片 (THDFAES04), 并进行了投片 实验。 下面以此为例介绍具体实施办法:  In accordance with the present invention, we implemented a data stream AES encryption chip (THDFAES04) and conducted a filming experiment. The following is an example to introduce the specific implementation method:
1. 工作方式 Working style
芯片每次处理一个分组, 输入输出数据总线均为 32位, 输入输出模块采用同步电 路方式易于嵌入同步电路系统中。在开始加密前首先通过数据输入总线将密钥列数 (Nlc) 和初始密钥分别送入芯片内部的设置寄存器和初始密钥寄存器中。然后再将明文分组送 入芯片。 然后, 由外部信号启动加密运算。 密文状态字先被暂存在输出寄存器中, 当整 个密文分组都产生之后, 结束信号 (OK)变高, 结果数据即可以从数据输出总线读出。 每 次开始输入新的分组时, 初始密钥寄存器的数据都会被重新写入内部的密钥暂存器。 2. 电路结构  Each time the chip processes a packet, the input and output data buses are all 32 bits. The input and output modules are easily embedded in the synchronous circuit system by means of a synchronous circuit. The key column number (Nlc) and the initial key are first sent to the chip's internal setup register and initial key register via the data input bus before starting the encryption. The plaintext packet is then sent to the chip. The encryption operation is then initiated by an external signal. The ciphertext status word is first stored in the output register. When the entire ciphertext packet is generated, the end signal (OK) goes high and the resulting data can be read from the data output bus. Each time a new packet is entered, the data in the initial key register is rewritten to the internal key register. 2. Circuit structure
它的整体电路结构如图 12所示。 它 THDFAES04结构中的各模块的行为和连接关 系与本发明所述内容完全相同, 由 "轮变换环"和 "密钥扩展环"两个异步流水线环 组成。 图中每个传输通道都标了一个编号, 每个通道上传输固定的令牌格式, 这些编号 就是对应的令牌编号。 此外, 还包含存储所述 WK、 所述 Nk和所述 Nr的全局寄存器, 电路中有两个相同、 彼此独立的随机控制码产生电路, 分别为 Matcher I和 Matcher II 的仲裁电路提供随机控制码, 分别命名为随机顺序控制序列寄存器 I和入随机顺序控制 序列寄存器 II。 实施方案中各个部件的具体实现方法如下- 5.1传输通道与通道端口: Its overall circuit structure is shown in Figure 12. The behavior and connection relationship of each module in the THDFAES04 structure is exactly the same as that described in the present invention, and two asynchronous pipeline loops of "round change loop" and "key extension loop" Composition. Each transmission channel in the figure is marked with a number, and each channel transmits a fixed token format, which is the corresponding token number. In addition, a global register storing the WK, the Nk and the Nr is further included, and there are two identical and independent random control code generating circuits in the circuit, respectively, and random control codes are provided for the arbitration circuits of the Matcher I and the Matcher II respectively. , named random sequence control sequence register I and incoming random sequence control sequence register II. The specific implementation of each component in the implementation is as follows - 5.1 transmission channel and channel port:
在图 12 中用空心宽箭头表示传输通道, 箭头表示数据传输方向。 所传输的数据是 相应编号的令牌。 THDFAES04采用 4相位捆绑数据握手协议的异步传输通道。  In Figure 12, the transmission channel is indicated by a hollow wide arrow and the arrow indicates the direction of data transmission. The data transmitted is the corresponding numbered token. THDFAES04 uses the asynchronous transmission channel of the 4-phase bundled data handshake protocol.
5.2输入模块: 5.2 input module:
图 13是输入模块的电路结构图, 其中 CKIN信号是输入时钟, 外部输入信号还包 括输入数据总线、 启动信号、 复位信号、 地址信号和使能信号。 复位信号可以复位整个 芯片。 控制电路根据输入的地址控制输入数据分配逻辑, 将输入数据存储到相应寄存器 中: 明文存入明文缓存器, 它是一个串行输入、 并行输出的移位寄存器, 可以存储 32 位的明文数据; 密钥存入内核部分的初始密钥寄存器; Nk值存入 Nk寄存器; 随机顺序 控制序列分别存入内核部分的随机顺序控制序列寄存器 I和入随机顺序控制序列寄存器 II。使能信号控制芯片的输入是否有效。控制电路中包括一个计数器记录当前明文序号, 明文缓存器的输出与打包逻辑电路相连, 将计数器的低 2位作为令牌 4的 column域, 将明文缓存器的输出作为令牌 4的数据域, 当写入的明文数达到 32位, 则触发通道 4 端口将打包电路输出的令牌 4发送到通道 4中。启动信号触发 load信号将初始密钥寄存 器中的数据置入 AK暂存器单元的密钥存储区, load信号触发 WK信号变为高电平。发 明所述的 InterRst—信号由控制电路产生, 当外部复位信号有效或者开始输入明文数据的 时候 (使能信号有效地址信号指向明文缓存器) InterRst—信号出现一个负脉冲将内核电 路复位, 准备执行新的加密任务, 但是初始密钥仍然保留。  Figure 13 is a circuit diagram of the input module, wherein the CKIN signal is an input clock, and the external input signal further includes an input data bus, a start signal, a reset signal, an address signal, and an enable signal. The reset signal resets the entire chip. The control circuit controls the input data distribution logic according to the input address, and stores the input data into the corresponding register: The plaintext is stored in the plaintext buffer, which is a serial input, parallel output shift register, which can store 32-bit plaintext data; The key is stored in the initial key register of the kernel portion; the Nk value is stored in the Nk register; the random sequence control sequence is stored in the random sequence control sequence register I and the incoming random sequence control sequence register II of the kernel portion, respectively. Enables the signal to control whether the input to the chip is valid. The control circuit includes a counter for recording the current plaintext number, and the output of the plaintext buffer is connected to the packing logic circuit, the lower 2 bits of the counter are used as the column field of the token 4, and the output of the plaintext buffer is used as the data field of the token 4. When the number of plaintexts written reaches 32 bits, the trigger channel 4 port sends the token 4 output from the packet circuit to channel 4. The start signal triggers the load signal to place the data in the initial key register into the key storage area of the AK register unit, and the load signal triggers the WK signal to go high. The InterRst-signal of the invention is generated by the control circuit. When the external reset signal is valid or the input of the plaintext data is started (the enable signal effective address signal is directed to the plaintext buffer) InterRst - a negative pulse appears in the signal to reset the core circuit, ready to execute New encryption task, but the initial key is still retained.
5.3输出模块- 输出模块是一个同步电路, 输入信号包括输出暂存单元的数据输出、 OK信号和外 部读数时钟 CKOUT; 输出端口包括输出数据总线, 输出暂存单元的 2位读地址和读取 擦除信号 (OUTACK:)。 5.3 Output Module - The output module is a synchronous circuit. The input signal includes the data output of the output temporary storage unit, the OK signal and the external reading clock CKOUT. The output port includes the output data bus, the 2-bit read address of the output temporary storage unit and the read erase. In addition to the signal (OUTACK:).
图 14是输出模块的电路结构图, 其中的控制电路接收 OK的上升沿后即触发 cpl 信号, 使地址累加器开始工作——从 0开始每 2个时钟周期加 1, 地址累加器的输出即 是输出暂存单元的读地址, 输出缓存是一个并行输入串行输出的移位寄存器, ren信号 是它的置数控制端。 ren在每次地址变化前有效, ren有效时, 在下降沿将输出暂存单元 的输出置入输出缓存, 随后 ren复位, 每个 CKOUT的上升沿将输出缓存的数据串行输 出到输出数据端口。 每次 ren信号复位即触发 OUTACK信号的正脉冲, 清除输出暂存 单元中的记录。  Figure 14 is a circuit diagram of the output module. The control circuit triggers the cpl signal after receiving the rising edge of OK, causing the address accumulator to start working - adding 1 every 2 clock cycles from 0, the output of the address accumulator is Is the read address of the output buffer unit, the output buffer is a shift register for the parallel input serial output, and the ren signal is its set control terminal. Ren is valid before each address change. When ren is valid, the output of the output buffer unit is placed in the output buffer on the falling edge, then ren is reset, and the rising edge of each CKOUT serially outputs the output buffer data to the output data port. . Each time the ren signal is reset, a positive pulse of the OUTACK signal is triggered, and the record in the output buffer unit is cleared.
5.4初始密钥寄存器: 初始密钥寄存器是一个 256位的寄存器组, 保存着由输入模块写入的密钥。 它的时 钟端是所述 load信号。 5.4 Initial Key Register: The initial key register is a 256-bit register bank that holds the key written by the input module. Its clock terminal is the load signal.
5.5 HMF结构: 5.5 HMF structure:
THDFAES04中釆用的 HMF电路的典型结构如图 15所示:  The typical structure of the HMF circuit used in THDFAES04 is shown in Figure 15:
它由令牌暂存器、匹配单元和发射电路组成,其中 rand是发明中所述的随机选择码, 在此称为顺序控制码。 图中实心宽箭头表示 HMF与外部间的传输通道。 WA和 WD分 别表示暂存器的写地址和输入数据端口, RA和 RD分别表示读地址和输出数据端口。  It consists of a token register, a matching unit, and a transmitting circuit, where rand is the random selection code described in the invention, referred to herein as a sequential control code. The solid wide arrow in the figure indicates the transmission path between the HMF and the outside. WA and WD represent the write address and input data port of the scratchpad, and RA and RD represent the read address and the output data port, respectively.
其工作方式是: 外部输入的令牌先存储于暂存器中。 暂存器中每个令牌记录都有相 应的 "满 /空"标志位 (flag), 在数据写入时 flag置 1, 读出后 CLR信号的高电平则将 RA所指的记录清空(对应的 flag位复位)。 CLR_done是 CLR信号的应答信号, 它的下 降沿表示 flag复位完成。  The way it works is: The externally entered token is first stored in the scratchpad. Each token record in the scratchpad has a corresponding "full/empty" flag (flag), which is set to 1 when data is written. The high level of the CLR signal after reading out clears the record pointed to by RA. (The corresponding flag bit is reset). CLR_done is the acknowledge signal of the CLR signal, and its falling edge indicates that the flag reset is complete.
匹配单元读取暂存器内部所有令牌的 flag 位以及与匹配条件相关的令牌标签域The matching unit reads the fla g bit of all tokens inside the scratchpad and the token label field associated with the matching condition
(Tags)以此计算它们的匹配函数(匹配条件的命题公式)值作为发明所述的匹配结果。 fetch即是发明所述的令牌发射触发信号。 select即为发明所述的选择信号, address即为 发明所述的令牌暂存单元的读地址, data即为发明所述的令牌暂存单元的输出数据。 打 包成新的令牌发送到执行单元。 执行单元的应答信号触发 clear驱动 CLR端口, 此时, 发射电路再次进入空闲状态。 发射电路在发送操作过程中不处理新的发送请求。 (Tags) thereby calculating their matching function (propositional formula of matching condition) as the matching result of the invention. Fetch is the token emission trigger signal of the invention. Select is the selection signal of the invention, address is the read address of the token temporary storage unit of the invention, and data is the output data of the token temporary storage unit of the invention. The packet is sent to the execution unit as a new token. The response signal from the execution unit triggers the clear drive CLR port, at which point the transmit circuit enters the idle state again. The transmitting circuit does not process the new transmission request during the transmitting operation.
5.5.1 令牌暂存器 5.5.1 Token Register
THDFAES04中令牌暂存器的存储单元由寄存器实现。图 16是一个 4单元暂存器的 示意图,图中仅画出了一组存储单元。每组单元由一组寄存器和一个 flag标志电路组成, 寄存器时钟 (elk) 的上升沿在 clr为 0时将 flag置 1, 清除信号 (clr) 的正脉冲在 elk 为 0时可以将 flag复位。 WA和 WD由输入令牌解析, reqin和 ackin分别表示输入通道 端口的写请求和写应答信号。 只有当 flag信号为 0时才能接受请求, 数据在写请求被接 受后写入寄存器。 输出数据则通过一级多路选择器 (MUX)直接输出, RD随 RA即时 变化。 CLR信号经过 RA 的选择触发对应单元的 clr信号, 当所有 clr信号都降低后 CLR—done下降, 作为记录清除过程结束的标志。  The memory location of the token register in THDFAES04 is implemented by a register. Figure 16 is a schematic diagram of a 4-cell register with only one memory cell drawn. Each group of cells consists of a set of registers and a flag flag circuit. The rising edge of the register clock (elk) sets flag to 1 when clr is 0. The positive pulse of the clear signal (clr) resets the flag when elk is 0. WA and WD are parsed by the input token, and reqin and ackin represent the write request and write acknowledge signal for the input channel port, respectively. The request can only be accepted when the flag signal is 0, and the data is written to the register after the write request is accepted. The output data is directly output through the primary multiplexer (MUX), and the RD changes instantaneously with the RA. The selection of the CLR signal by the RA triggers the clr signal of the corresponding unit. When all the clr signals are lowered, the CLR_done falls as a flag for the end of the record clearing process.
5.5.2 匹配单元 5.5.2 Matching unit
图 17是一个基本的 4请求匹配单元结构, 其由匹配逻辑部分、 请求仲裁部分和选 择保持-请求阻塞电路三部分组成。  Figure 17 is a basic 4 request matching unit structure consisting of a matching logic portion, a request arbitration portion, and a selection hold-request blocking circuit.
匹配逻辑部分实现匹配函数计算, 由组合电路实现,计算结果通过 C单元送达仲裁 器成为请求信号。  The matching logic part implements the matching function calculation, which is implemented by the combination circuit, and the calculation result is sent to the arbiter through the C unit to become the request signal.
THDFAES04中的仲裁器采用了 May D.论文中的 R-box电路, 如图 18所示, 这是 一个 4选 1的仲裁逻辑。 10~13表示输入的请求, A0、 A1是被选中的请求的序号。  The arbiter in THDFAES04 uses the R-box circuit in the May D. paper, as shown in Figure 18, which is a 4-to-1 arbitration logic. 10~13 indicates the input request, and A0 and A1 are the serial numbers of the selected request.
暂存器进行数据读写的时刻不确定, 设计时认为观测端口的信号随时可能变化, 仲 裁器的输出端也随之不断变化, 因此需要同步 select信号与令牌数据, 以保证输出通道 的请求信号有效时发射电路的输出数据是稳定的。 因此在仲裁器输出端设置 select锁存 器。 锁存信号为 lock, lock=0时锁存器透明。 select对应的令牌清空后, 对应的请求信 号复位——此时 select仍然没有变化——^ fetch也随之复位。另一方面, 图中的 C单元和 4输入或门组成了反馈阻塞电路。只要请求信号中存在有效请求就会阻塞新请求的通过, 只有所有仲裁输入端的有效请求都复位后 C单元才重新导通。阻塞电路使得仲裁器输出 经过一定时间后必然能够稳定,在 fetch上升后经过相同的延时再采样 select即可避免"冒 险"。 The time when the scratchpad reads and writes data is uncertain. When designing, the signal of the observation port may change at any time, and the output of the arbiter also changes continuously. Therefore, it is necessary to synchronize the select signal and the token data to ensure the output channel. The output data of the transmitting circuit is stable when the request signal is valid. Therefore, a select latch is provided at the output of the arbiter. The latch signal is lock, and the latch is transparent when lock=0. After the corresponding token of the select is emptied, the corresponding request signal is reset - at this time, the selection still has not changed - ^ fetch is also reset. On the other hand, the C unit and the 4 input OR gates in the figure constitute a feedback blocking circuit. As long as there is a valid request in the request signal, the passage of the new request is blocked, and the C unit is re-conducted only after all valid requests of the arbitration input are reset. The blocking circuit makes the arbiter output stable after a certain period of time. After the fetch rises, the same delay is used to resample the select to avoid "adventure".
5.5.3 发射电路  5.5.3 Transmitting circuit
图 19是发射电路部分的逻辑图与主要信号波形图。  Figure 19 is a logic diagram and main signal waveform diagram of the transmitting circuit portion.
图 19a中寄存器 R与 C单元是令牌的接收通道; 阴影部分的电路是地址锁存信号 lock的产生电路; req和 ack分别是输出通道端口的请求信号和应答信号, ackout是下 一级电路的应答信号。 其余信号与图 15对应; 是用于延时匹配的延时单元。  In Figure 19a, the registers R and C are the receiving channels of the token; the shaded circuit is the generation circuit of the address latch signal lock; req and ack are the request and response signals of the output channel port, respectively, ackout is the next stage circuit Response signal. The remaining signals correspond to Figure 15; are delay units for delay matching.
电路中所有时序单元的初始状态全为 0, fetch的上升沿经过 (select的稳定时间) 延时后成为 fetch— d信号。 fetch— d的上升沿首先触发 lock信号,将有效请求的序号锁存。 req由 lock门控输出。 lock信号在 req的上升沿至 clr—ack下降沿之间的时间内始终保持 髙电平。  The initial state of all timing elements in the circuit is all 0, and the rising edge of fetch becomes the fetch_d signal after the delay of (select stable time). The rising edge of fetch_d first triggers the lock signal, latching the sequence number of the valid request. Req is output by the lock gate. The lock signal remains at the 髙 level for the time between the rising edge of req and the falling edge of clr-ack.
THDFAES04中各个 HMF结构都是在上述典型结构的基础上稍加变化而来的, 其 中的发射电路都合并到各暂存单元的暂存器输出部分中了,下面具体介绍它们的具体参 数和变化之处——在下文没有特别说明的内容即与上述典型结构相同:  The HMF structure in THDFAES04 is slightly changed based on the above typical structure, and the transmitting circuits are incorporated into the register output part of each temporary storage unit. The specific parameters and changes thereof are specifically described below. Where – what is not specifically stated below is the same as the above typical structure:
AddKey的 HMF结构: AddKey's HMF structure:
a) AK暂存单元:  a) AK temporary storage unit:
AK暂存单元端口包括: 三个输入通道端口, 通道 5端口接收状态字令牌; 通道 6端口接收经过非线性变换的中间密钥字 f, g令牌; 通道 9端口接收新的扩展密钥字; 有两个输出通道端口: 通道 7端口发送 AddKey的操作数令牌 (令牌 7); 通道 10端 口发送密钥扩展的操作数令牌。 各令牌的打包函数见令牌传输部分。 此外, 还有置数 端口: 包括初始密钥输入总线、 load、 WK信号。  The AK temporary storage unit port includes: three input channel ports, channel 5 ports receive status word tokens; channel 6 ports receive non-linearly transformed intermediate key words f, g tokens; channel 9 ports receive new extended keys Word; There are two output channel ports: Channel 7 port sends the AddKey operand token (Token 7); Channel 10 port sends the key extended operand token. The packing function of each token is shown in the token transmission part. In addition, there are also number ports: including initial key input bus, load, WK signals.
( 1 ) 密钥字存储区有 8个密钥字记录存储单元和两个中间密钥字存储单元。  (1) The key word storage area has eight key word record storage units and two intermediate key word storage units.
密钥字存储空间的地址空间是 (000)2-(111)2The address space of the key word storage space is (000) 2 -(111) 2 .
依次存储前述 "密钥分组"模 Nk等于 0-7的密钥字, 如果 Nk<8, 则髙地址单 元空闲;  The key words of the aforementioned "key grouping" modulo Nk equal to 0-7 are sequentially stored, and if Nk < 8, the 髙 address unit is idle;
中间密钥字部分有 1位地址, 地址空间是 0-1 ; 依次存储/和^。  The intermediate key word part has a 1-bit address, and the address space is 0-1; and / and ^ are stored in order.
另有两个 5位内部存储器: BL0CKH3L0CKL和 1个 2位操作标记寄存器 KES。  There are also two 5-bit internal memories: BL0CKH3L0CKL and a 2-bit operation flag register, KES.
BLOCKL和 BLOCKH寄存器的输入与通道 9端口对应的数据输出相连, 时钟由通 道 9端口写信号触发, 令牌 9的 part信号决定哪个时钟有效 (参见后面令牌传输协 议部分)。 KES用来控制密钥扩展的时序, 其状态机如图 20所示。 在每次读取相应 的密钥字进行 fig变换和读取密钥进行密钥扩展时 KES的状态发生变化。 它的初 状态是 00,即准备计算 /的状态。 The inputs to the BLOCKL and BLOCKH registers are connected to the data output corresponding to channel 9 port. The clock is triggered by the channel 9 port write signal. The part signal of token 9 determines which clock is valid (see the Token Transmission Protocol section below). KES is used to control the timing of key expansion, and its state machine is shown in Figure 20. Corresponding each time The state of the KES changes when the key word is fig transformed and the key is read for key expansion. Its initial state is 00, which is the state of preparation for calculation.
密钥字部分和中间密钥字部分的记录格式如下:  The record format of the key word part and the intermediate key word part is as follows:
密钥字记录 (KR):  Keyword Record (KR):
Figure imgf000025_0001
Figure imgf000025_0001
每个记录的满 /空标志位(flag)是当数据被写入时(op=(00)2)置 1,当 op=(l l)2 时被复位。 The flag of each record's full/empty flag is set when the data is written (op = (00) 2 ), and is reset when op = (ll) 2 .
中间密钥字记录 (FR):
Figure imgf000025_0002
Intermediate Key Word Record (FR):
Figure imgf000025_0002
它含有两个写端口, 分别是密钥字和中间密钥字的写入端口, 包含写入数据 总线和写地址; 两个读端口, 分别对应令牌 7和令牌 10的数据域, 都是包含数据 总线和读地址,对应令牌 7数据域的总线宽度为 32位,读地址是 Matoherll的 ksel, 对应令牌 10数据域的总线宽度 160位, 读地址是所述的来自 MatcherK的 step信 号, 一次读出一个密钥段和一条中间密钥字。 密钥字端口的写信号将写入记录的 op复位; 通道 7的应答信号将读出密钥字记录的轮变换位置 1, 通道 10的应答信 号将读出记录的扩展位置 1。  It contains two write ports, which are the write port of the key word and the intermediate key word, respectively, including the write data bus and the write address; two read ports, corresponding to the data fields of the token 7 and the token 10, respectively. It contains the data bus and the read address. The bus width of the data field corresponding to the token 7 is 32 bits, the read address is the kse of the Matoherll, the bus width of the data field corresponding to the token 10 is 160 bits, and the read address is the step from the MatcherK. Signal, read one key segment and one intermediate key word at a time. The write signal of the key word port will reset the op written to the record; the acknowledge signal of channel 7 will read the round change position of the key word record 1, and the acknowledge signal of channel 10 will read the extended position of the record 1.
(2 ) 状态字存储区有 4个状态字存储单元:  (2) The status word memory area has 4 status word storage units:
地址空间: (00)2-(11:)2Address space: (00) 2 - (11:) 2 .
依次存储"状态"中的第 0-第 3列.  Store the 0th - 3rd columns in "Status" in order.
记录格式 (SR)
Figure imgf000025_0003
Recording format (SR)
Figure imgf000025_0003
状态字区有一个写端口, 包括数据总线 (宽度为 36)、 写地址、 写信号; 一 个置数端口, 与初始密钥寄存器的输出相连, 256位宽, 由 load信号作为置位信 号; 有一个读端口, 读地址与 Matcher II的 ssel信号相连, 数据总线是 36位, 与 通道 7的 datal和 color域数据输入端相连。 当 AorT为 1时, 输出 ssel所指的状 态字, 当 AorT为 0时, 则输出 0。  The status word area has a write port, including the data bus (width 36), write address, write signal; a set port, connected to the output of the initial key register, 256 bits wide, with the load signal as the set signal; A read port, the read address is connected to the ssel signal of the Matcher II, and the data bus is 36 bits, which is connected to the datal and color field data inputs of channel 7. When AorT is 1, the status word indicated by ssel is output. When AorT is 0, 0 is output.
b) Matcherll: 它检査 AK暂存单元中的状态区和密钥区。 Matcher II读取的观测信号包括状态 字记录的 color域与 flag标志, 密钥字的 op域; 匹配条件表达式见后面的令牌传输关 系部分; 它的仲裁逻辑分为两级, 第一级是从满足 AddKey运算条件的请求中选择一 个, 第二级是选择执行 AddKey操作还是执行变换密钥字的转发; 对应的发射令牌接 收通道是通道 7,输出的请求选择信号包括状态字读地址(ssel)和密钥字读地址 (ksel) 与令牌类型标志信号 AorT, 对应的令牌发射信号是 fetch— II信号; 如果 exp—stop=l, 则 Matcher II不发送变换密钥字转发的操作请求。 b) Matcherll: It checks the status area and key area in the AK scratchpad. The observation signal read by Matcher II includes the color field and flag flag of the status word record, and the op field of the key word. The matching condition expression is shown in the following token transmission relationship part; its arbitration logic is divided into two levels, the first level. Select one from the request that satisfies the AddKey operation condition. The second level selects whether to perform the AddKey operation or the transfer key conversion. The corresponding transmit token receiving channel is channel 7, and the output request selection signal includes the status word read address. (ssel) and key word read address (ksel) and token type flag signal AorT, the corresponding token transmit signal is fetch_II signal; if exp_stop=l, then Matcher II does not send the transform key word forwarded Operation request.
上述匹配单元中的仲裁器的随机控制码由随机顺序控制序列寄存器 I提供。  The random control code of the arbiter in the above matching unit is provided by the random sequence control sequence register 1.
密钥扩展的 HMF结构  Key extension HMF structure
密钥扩展的 HMF结构的令牌暂存器与 AddKey的 HMF结构共用 AK暂存单元的 密钥区, 此外, 它的暂存器还包括 AK暂存单元的中间密钥字单元。  The key extension HMF structure of the token register shares the key area of the AK temporary storage unit with the HMF structure of the AddKey. In addition, its register also includes the intermediate key unit of the AK temporary storage unit.
Matcher 的观测信号包括: 密钥字的 op域、 中间密钥字的 flag标志、 KES、 BLOCKL和 BLOCKH; 匹配条件见后面令牌转移关系部分; 输出的请求选择信号是 段标记 step, 打包逻辑根据 step, 将密钥区的相应数据以及 BLOCK值打包成令牌 10 待发送, 具体打包逻辑见令牌传输关系部分; 由于密钥扩展运算不会同时存在多个待 执行操作的令牌组,所以内部没有仲裁电路;令牌发射信号是 fetch_k;在 Wk为 0时, 即非工作状态, load信号的上升沿将初始密钥寄存器中的数据写入密钥字区。 The matcher's observation signals include: the op field of the key word, the flag flag of the intermediate key word, KES, BLOCKL, and BLOCKH; the matching condition is shown in the following token transfer relationship part; the output request selection signal is the segment mark step, and the packing logic is based on Step, the corresponding data of the key area and the BLOCK value are packaged into the token 10 to be sent, and the specific packing logic is seen in the token transmission relationship part; since the key expansion operation does not have multiple token groups to be executed at the same time, There is no arbitration circuit inside; the token transmit signal is fetch_k; when Wk is 0, that is, inactive, the rising edge of the l oa d signal writes the data in the initial key register to the key word area.
EU单元的 HMF结构  HMF structure of the EU unit
a) EU暂存单元:  a) EU temporary storage unit:
EU暂存单元中包含一个变换密钥字存储单元 key store和两个相同的状态存储单元 storeO, store 1.  The EU temporary storage unit contains a transformation key word storage unit key store and two identical state storage units storeO, store 1.
( 1 ) storeO/storel:  (1) storeO/storel:
写地址空间: (00)2-(11)2, 依次存储 ShiftRow前"状态"中的第 0-第 3列, 每 列又分为 4行, 对应状态中的行和列; Write address space: (00) 2 - (11) 2 , in order to store the 0th - 3rd column in the "state" before ShiftRow, each column is further divided into 4 rows, corresponding to the rows and columns in the state;
其中第 1行 (行地址为 0)存储记录 (HDR) 格式如下:  The first line (row address is 0) storage record (HDR) format is as follows:
Figure imgf000026_0001
Figure imgf000026_0001
storeO和 storel各包含一个读端口,一个写端口,都有各自的地址和数据总线, 写端口另有一个写信号。输入信号还有来自 Matcher I的乒乓选择信号 pp。写入时 各行的地址相同, 内部有一地址偏移电路, 该电路输入为外部 (来自 Matcherl) 输出各行的读地址, 各行的地址等于外部地址减对应的行位移常量。 两个暂存器 的读端口经过多路选择器与发射电路相连。 storeO and storel each contain a read port and a write port, each with its own address and data bus. The write port has another write signal. The input signal also has a ping-pong selection signal pp from Matcher I. The address of each row is the same when writing, and there is an address offset circuit inside. The circuit input is external (from Matcherl) to output the read address of each row, and the address of each row is equal to the external row minus the corresponding row displacement constant. The read ports of the two registers are connected to the transmit circuit via a multiplexer.
(2) key store: 只有一个存储单元。 存储密钥扩展的中间结果。 记录格式 (KR) 如下:  (2) key store: There is only one storage unit. The intermediate result of storing key extensions. The record format (KR) is as follows:
Figure imgf000027_0001
Figure imgf000027_0001
storeO和 storel的状态由 pp信号决定, pp为 0多路选择器选择 storeO的输出; pp 为 1多路选择器选择 storel的输出。 令牌写入时当轮次为偶数时写入 storeO, 当令牌的 轮次为奇数, 则写入 storel。  The state of storeO and storel is determined by the pp signal, pp is 0 multiplexer selects the output of storeO; pp is the output of storel for 1 multiplexer. When the token is written, it is written to storeO when the round is even, and when the token's round is odd, it is written to storel.
EU暂存单元有一个输入传输通道端口, 与通道 1相连; 一个输出传输通道端口, 与通道 2相连, 令牌的打包函数见令牌传输关系部分。 EU暂存单元的功能是接收通道 1发来的令牌 1 , 从中解析出令牌类型 (状态令牌还是密钥令牌)、 写地址和记录数据, 并将记录写入相应的存储单元中; 根据 pp, s_f, raddr输出相应的状态字或变换密钥字, 与其它控制信息一起打包成令牌 2; fetch—I信号触发 2#通道端口的请求信号, 将打包好 的令牌发送给通道 2。  The EU temporary storage unit has an input transmission channel port connected to channel 1; an output transmission channel port connected to channel 2, and the token packing function is shown in the token transmission relationship portion. The function of the EU temporary storage unit is to receive the token 1 sent from channel 1, from which the token type (state token or key token), write address and record data are parsed, and the record is written into the corresponding storage unit. According to pp, s_f, raddr output corresponding state word or transformation key word, together with other control information is packaged into token 2; fetch-I signal triggers the request signal of 2# channel port, and sends the packaged token to Channel 2.
b) Matcher I  b) Matcher I
Matcher I内部包括两个相同的状态令牌匹配单元和一个密钥令牌匹配单元。 storeO的匹配结果 (对应于图 17中的 matched信号) matchedO和 storel的匹配结果 matchedl被送到乒乓控制信号 pp 的产生电路, pp的产生电路如图 21所示。 storeO/storel的观测信号包括: 每个单元的 flag位, 以及 各个 HDR的 color域、 op域; 输出的请求选择信号包括 storeO/storel的读地址 raddr (2位); 具体匹 配条件见令牌传输关系部分; 状态匹配单元内部的仲裁电路为如图 18所示的 4选 1电路。  Matcher I internally includes two identical state token matching units and one key token matching unit. The matching result of storeO (corresponding to the matched signal in Fig. 17) The matching result of matchedO and storel is matched to the generating circuit of the ping-pong control signal pp, and the generating circuit of pp is as shown in Fig. 21. The observation signal of storeO/storel includes: the flag bit of each unit, and the color field and op field of each HDR; the output request selection signal includes the read address raddr (2 bits) of storeO/storel; the specific matching condition is seen in token transmission. The relationship portion; the arbitration circuit inside the state matching unit is a 4-to-1 circuit as shown in FIG.
密钥匹配单元的观测信号是密钥存储单元的 flag 标志; 匹配条件是 flag=l。 在 Matcherl中还有一个 2选 1的仲裁电路, 从状态匹配单元的请求和密钥匹配单元的请求 中随机选取一个, 对应的操作选择信号是 s_f; 对应的令牌发送信号为 fetch— I。  The observation signal of the key matching unit is the flag flag of the key storage unit; the matching condition is flag=l. There is also a 2-to-1 arbitration circuit in Matcherl, which randomly selects one from the request of the state matching unit and the request of the key matching unit, and the corresponding operation selection signal is s_f; the corresponding token transmission signal is fetch_I.
输出 HMF:  Output HMF:
a) 输出暂存单元:  a) Output temporary storage unit:
输出暂存单元是密文重排的暂存单元,发明内容 1.所述的存储单元由 4组 4字节的寄 存器组成。 它有一个输入通道端口: 与传输通道 11 相连; 其它输入信号有来自输出模 块的 2位读地址和清空信号 OUTACK (对应图 16中的 CLR信号), 其它输出信号有输 出数据 (32位) 和 4位 flag标志信号。 电路与图 16中的典型结构相同, 只是不产生其 中的复位应答信号 (CLR— d0ne)。 通道 11 的输出数据总线的地址位直接与暂存单元的 写地址相连, 数据位直接与暂存单元的数据输入总线相连。 The output temporary storage unit is a ciphertext rearrangement temporary storage unit, and the storage unit described above is composed of four sets of 4-byte registers. It has an input channel port: connected to the transmission channel 11; other input signals have a 2-bit read address from the output module and a clear signal OUTACK (corresponding to the CLR signal in Figure 16), and other output signals are lost. Out data (32 bits) and 4-bit flag flag signal. A typical circuit configuration same as FIG. 16, but which does not generate a reset acknowledge signal (CLR- d 0ne). The address bit of the output data bus of channel 11 is directly connected to the write address of the temporary storage unit, and the data bit is directly connected to the data input bus of the temporary storage unit.
b) Matcher OK:  b) Matcher OK:
输入信号为输出暂存单元的 4个 flag信号,输出为所述 OK信号。 OK等于 4个 flag 信号之 '与,。  The input signal is the four flag signals of the output temporary storage unit, and the output is the OK signal. OK is equal to 4 and the signal 'and'.
5.6密钥扩展运算单元 (KeySchedule):  5.6 Key Expansion Unit (KeySchedule):
KeySchedule单元有一个输入通道端口 (与通道 10相连)、 一个输出通道端口 (与 通道 9相连), 电路结构为输入通道端口-逻辑部分 -输出通道端口三部分级联而成。它输 入令牌 10, 经过逻辑部分处理后由输出通道端口输出令牌 9。 逻辑部分的具体功能见后 面的 "令牌传输协议部分"。  The KeySchedule unit has an input channel port (connected to channel 10), an output channel port (connected to channel 9), and a circuit structure in which the input channel port-logic portion-output channel port is cascaded. It enters token 10, which is processed by the logical section to output token 9 from the output channel port. The specific functions of the logical part are shown in the "Token Transfer Protocol Part" below.
5.7 AddKey:  5.7 AddKey:
AddKey单元单元有一个输入通道端口 (与通道 7相连)、 一个输出通道端口 (与通 道 8相连), 电路结构为输入通道端口-逻辑部分 -输出通道端口三部分级联而成。它输入 令牌 7, 经过逻辑部分处理后由输出通道端口输出令牌 8。 逻辑部分的具体功能见后面 的 "令牌传输协议部分"。  The AddKey unit has an input channel port (connected to channel 7), an output channel port (connected to channel 8), and a circuit structure in which the input channel port-logic portion-output channel port is cascaded. It enters token 7, which is processed by the logical part to output token 8 from the output channel port. The specific functions of the logical part can be found in the "Token Transmission Protocol Part" below.
5.8 EU:  5.8 EU:
EU单元单元有一个输入通道端口 (与通道 2相连)、 一个输出通道端口 (与通道 3 相连), 电路结构为输入通道端口-逻辑部分 -输出通道端口三部分级联而成。它输入令牌 2, 经过逻辑部分处理后由输出通道端口输出令牌 3。逻辑部分的具体功能见后面的 "令 牌传输协议部分"。  The EU unit has an input channel port (connected to channel 2), an output channel port (connected to channel 3), and a circuit structure in which the input channel port-logic portion-output channel port is cascaded. It enters token 2, which is processed by the logical part to output token 3 from the output channel port. The specific functions of the logic section can be found in the "License Transmission Protocol Part" below.
5.9 Switch:  5.9 Switch:
Switch是一个 2通道输入 -2通道输出的交换开关,两个输入通道开端口分别是来自 轮变换轮的 3#通道端口和来自输入模块的 4#通道端口; 此外还有输入信号: WK。其在 空闲状态(WK=0)将 4#通道端口发来的令牌 4解析后, 将其中的数据重新打包成令牌 5发送给通道 5; 在工作状态 (WK=1 ) 将 3#通道发来的令牌 3解析后根据类型, 将状 态令牌重新打包成令牌 5发送给通道 5 ; 将中间密钥字令牌重新打包成令牌 6发送给通 道 6。其电路结构如图 22所示,其中的箭头表示异步传输通道,图中的 DEMUX和 MUX 也是异步控制部件 DEMUX在传来的 Key的数据等于 1的情况下, 把输入端令牌数 据复制到通道 6, 否则复制到 MUX的输入通道, MUX在 WK=0时, 把通道 4的数据 传递到通道 5, 否则传递 DEMUX的 0输出端数据到通道 5 ; 在输入端, 通道 3的属性 域和请求 -应答信号与 DEMUX控制通道端口相连, 通道 3的其它数据线和请求-应答信 号与 DEMUX的数据输入通道端口相连; MUX的控制端则是 WK信号。 令牌间的各个 域的映射关系, 见后面的令牌传输协议部分。 5.10 轮更新单元: The Switch is a 2-channel input-2 channel output switch. The two input channel open ports are the 3# channel port from the wheel change wheel and the 4# channel port from the input module. There is also an input signal: WK. After parsing the token 4 sent from the 4# channel port in the idle state (WK=0), the data is repackaged into token 5 and sent to channel 5; in the working state (WK=1), the 3# channel is After the token 3 is parsed, the status token is repackaged into token 5 and sent to channel 5 according to the type ; the intermediate key token is repackaged into token 6 and sent to channel 6. The circuit structure is shown in Figure 22. The arrow indicates the asynchronous transmission channel. The DEMUX and MUX in the figure are also the asynchronous control unit DEMUX. When the data of the transmitted Key is equal to 1, the input token data is copied to the channel. 6, otherwise copied to the MUX input channel, MUX in WK = 0, the channel 4 data is transferred to channel 5, otherwise pass DEMUX 0 output data to channel 5; at the input, channel 3 attribute domain and request - The acknowledge signal is connected to the DEMUX control channel port. The other data lines and request-response signals of channel 3 are connected to the data input channel port of the DEMUX; the control terminal of the MUX is the WK signal. For the mapping of each domain between tokens, see the Token Transfer Protocol section below. 5.10 round update unit:
图 23是轮更新单元的电路结构。其中第一级 DEMUX与图 22相同, 如果令牌 8的 属性域等于 1则把令牌直接复制到通道 1, 如果等于 0, 则经过第二级 DEMUX, 如果 输入令牌的 color域等于 Nr, 则把令牌的一部分复制到通道 11, 同时对令牌的 column 域检查(即图中的 exp— stop?单元), 如果 column>3, 则表示所有的扩展密钥已经全部产 生, 触发 exp— stop信号变高 (exp— stop信号在新一轮运算启动时复位。); 如果令牌的 color<Nr则将令牌的 color域加 1后复制到通道 1 ;图中与通道 1相连的矩形是异步电路 中的基本部件—— "Join"控制部件: 它的两路输入不会同时有令牌到达, 它把到达的令 牌复制到输出通道。  Figure 23 is a circuit configuration of the wheel updating unit. The first level DEMUX is the same as that of FIG. 22. If the attribute field of token 8 is equal to 1, the token is directly copied to channel 1. If it is equal to 0, the second level DEMUX is passed. If the color field of the input token is equal to Nr, Then copy part of the token to channel 11, and check the column field of the token (that is, the exp_stop? element in the figure). If column>3, it means that all the extended keys have been generated, triggering exp- The stop signal goes high (the exp-stop signal is reset at the start of a new round of operations.); If the color<Nr of the token is added to the color field of the token, it is copied to channel 1; the rectangle connected to channel 1 in the figure It is the basic component of an asynchronous circuit - the "Join" control component: its two inputs do not have a token arrive at the same time, it copies the arriving token to the output channel.
5.11 随机顺序控制序列寄存器 I 5.11 Random Sequence Control Sequence Register I
THDFAES04的随机顺序控制序列采用外部输入的方法,图 12中的随机顺序控制序 列寄存器 I对应发明内容中的 Matcher I随机控制码产生电路,它是一个环形的移位寄存 器,在运算开始前通过外部输入数据端口把一组随机序列输入到随机顺序控制序列寄存 器 I中; 在工作过程中寄存器中的数据循环移位——每次 fetch— I的下降沿移位一次, 其 中有一级寄存器的输出连接到 Matcher I的随机码输入端。  The random sequence control sequence of THDFAES04 adopts an external input method, and the random sequence control sequence register I in FIG. 12 corresponds to the Matcher I random control code generating circuit in the invention, which is a ring shift register, which is externally external before the operation starts. The input data port inputs a random sequence into the random sequence control sequence register I; during the working process, the data in the register is cyclically shifted - each time the falling edge of fetch_I is shifted once, and the output connection of the primary register is connected. Go to the random code input of Matcher I.
5.12 随机顺序控制序列寄存器 II  5.12 Random Sequence Control Sequence Register II
THDFAES04的随机顺序控制序列采用外部输入的方法,图 12中的随机顺序控制序 列寄存器 II对应发明内容中的 Matcher II随机控制码产生电路, 它的电路与随机顺序控 制序列寄存器 I相同,每次 fetch— II的下降沿移位一次,输出数据连接到 Matcher II的随 机码输入端。 补充说明: 为了突出重点在上述描述中没有提到复位信号 InterRst—的连接关系, 事 实上上述各单元除了输入模块产生 InterRst一外, 其余模块都有 InterRst—的输入, 用于电 路初始化。  The random sequence control sequence of THDFAES04 adopts an external input method, and the random sequence control sequence register II in FIG. 12 corresponds to the Matcher II random control code generating circuit in the invention, and its circuit is the same as the random sequence control sequence register I, each fetch – The falling edge of II is shifted once and the output data is connected to the random code input of Matcher II. Supplementary note: In order to highlight the connection relationship of the reset signal InterRst—not mentioned in the above description, in fact, except for the input module generating InterRst one, the other modules have InterRst—input for circuit initialization.
3. 令牌传输协议 3. Token Transport Protocol
如下的令牌传输协议在上述部件和结构上执行, 以实现 AES加密算法:  The following token transport protocol is implemented on the above components and structures to implement the AES encryption algorithm:
5.13 令牌定义:  5.13 Token Definition:
令牌 1 :  Token 1 :
域 (位数) 取值 说明 Field (number of bits) value Description
data (32位) 任意 数据 Data (32 bits) arbitrary data
key(l) key/state 1-密钥令牌; 0-状态令牌 Key(l) key/state 1-key token; 0-state token
数据令牌 密钥令牌 数据令牌 密钥令牌 数据令牌 密钥令牌 Data token key token data token key token data token key token
column(2) fadd ( 1 ) 0-3 0/1 状态中的列号 中间密钥字地址 color (4) DC 0- Nr 轮次标记 随机数 op(l) remain(l) SM/Srd; 0/1 1— Srd; 0— SM 0-RC; 1-直接转发 令牌 2: 同令牌 1 Column(2) fadd ( 1 ) 0-3 0/1 Column number in intermediate state Key address color (4) DC 0- Nr Round tag random number Op(l) remain(l) SM/Srd; 0/1 1— Srd; 0— SM 0-RC; 1-Direct Forward Token 2: Same Token 1
今 令牌 3:  Today Token 3:
域 (位数) 取值 说明 Field (number of bits) value Description
data (32位) 任意 数据 Data (32 bits) arbitrary data
key(l) 1/0 1-密钥令牌; 0-状态令牌 Key(l) 1/0 1-key token; 0-state token
数据令牌 密钥令牌 数据令牌 密钥令牌 数据令牌 密钥令牌 column(2) 0-3 状态中的列号 Data Token Key Token Data Token Key Token Data Token Key Token column(2) 0-3 Column Number in Status
color (4) fadd ( 1 ) 0- Nr 0/1 同令牌 1 同令牌 1 Color (4) fadd ( 1 ) 0- Nr 0/1 same token 1 same token 1
今 令牌 4:  Today Token 4:
域 (位数) 取值 说明 Field (number of bits) value Description
data (32位) 任意 数据 Data (32 bits) arbitrary data
column(2) 0-3 状态中的列号 Column(2) column number in 0-3 state
々 令牌 5:  令牌 Token 5:
域 (位数) 取值 说明 Field (number of bits) value Description
data (32位) 任意 数据 Data (32 bits) arbitrary data
Address(2) 0-3 匹配暂存器中的存储地址  Address(2) 0-3 Matches the storage address in the scratchpad
color (4) 0- Nr 同令牌 1 Color (4) 0- Nr with token 1
今 令牌 6:  Today Token 6:
域 (位数) 取值 说明 Field (number of bits) value Description
data (32位) 任意 数据 Data (32 bits) arbitrary data
Address(l) 0/1 中间密钥字的存储地址 令牌 7:  Address(l) 0/1 Storage address of intermediate key word Token 7:
域 (位数) 取值 说明 Field (number of bits) value Description
datal (32位) 任意 操作数 1 (对应匹配暂存单元的 状态字输出) Datal (32-bit) arbitrary operand 1 (corresponding to the status word output of the matching temporary storage unit)
data2 (32位) 任意 操作数 2 (对应匹配暂存单元的 密钥字输出) Data2 (32 bits) Any Operand 2 (corresponds to the key word output of the matching temporary storage unit)
AorT(l) 0/1 执行 AddKey还是变换密钥字转 发, 0— AddKey, 1一变换密钥字 转发  AorT(l) 0/1 Execute AddKey or change key word forwarding, 0—AddKey, 1-transform key word forwarding
AorT=0 AorT=l AorT=0 AorT=l AorT=0 AorT=l column(3) fadd(l) 0-7 0/1 状态中的列 同令牌 1. remain(l) 0/1 号 同令牌 1. AorT=0 AorT=l AorT=0 AorT=l AorT=0 AorT=l column(3) fadd(l) 0-7 0/1 The column in the state is the same as the token 1. Remain(l) 0/1 is the same as token 1.
color (4) DC(5) 0- Nr 随机数 同令牌 1 令牌 8:  Color (4) DC(5) 0- Nr random number same token 1 token 8:
Figure imgf000031_0001
Figure imgf000031_0001
今 令牌 9  Today token 9
Figure imgf000031_0002
Figure imgf000031_0002
5.14 数据、 令牌转移关系  5.14 Data, Token Transfer Relationship
今 令牌 1至 EU暂存单元 记录的变换协议  Today Token 1 to EU temporary storage unit record conversion protocol
如果令牌 1的 key等于 0, 则当 color为偶数时写入 store0, color为奇数时写 入 storel ,写入地址为令牌 1的 column域的值,令牌 1各个域与 HDR、 DR1-3 各个域的映射关系如图 24 (a)所示, 其中令牌 1的 data域的最低字节 (第 7 到第 0位) 至最高字节 (第 31位到第 24位) 依次分别写入第 0行至第 3行 的存储单元中;如果令牌 1的 key域等于 1,则令牌写入 EU暂存单元的 key store 中, 令牌 1各个域与 KR各域的映射关系如图 24 (b) 所示。 If the key of token 1 is equal to 0, write to store0 when color is even, write to storel when the color is odd, write the value of the column field with address 1 of token 1, and the domain of token 1 with HDR, DR1- 3 The mapping relationship of each domain is as shown in Fig. 24 (a), in which the lowest byte (7th to 0th bit) to the highest byte (31st to 24th bits) of the data field of token 1 are sequentially written separately. In the storage unit of the 0th row to the 3rd row; if the key field of the token 1 is equal to 1, the token is written in the key store of the EU temporary storage unit, and the mapping relationship between each domain of the token 1 and the KR domain is as shown in the figure 24 (b) is shown.
今 EU暂存单元 记录 至令牌 2 This EU temporary storage unit records to token 2
Matclir I对 storeO或 storel中的数据进行匹配, 匹配条件是: 存在列数 i,满 足: 第一行第 i列、 第二行第 i-Cl列, 第三行第 i-C2列, 第四行第 i-C3列的存 储记录都是 "满 ", 对应的匹配单元输出, 即 storeO和 storel的读地址等于 i。 它同时对 key store中的变换密钥字进行匹配, 匹配条件是: FR记录是 "满"。 当符合上述条件的数据多于一个时, 则随机选取一个发送, 对于状体令牌, 如 果 pp=l则当 storel中的数据满足匹配条件时由 storel的相应数据打包成令牌 2 发射,否则当 storeO中的数据满足匹配条件时由 storeO的相应数据打包成令牌 2 发射; 如果 pp选择的状态存储区中没有满足条件的令牌数据, 而另一个状态存 储区中存在满足匹配条件的令牌数据, 则 pp取反。 状态存储区中的 HDR、 DR 记录与令牌 2的各个域的映射关系如图 25 (a) 所示。 FR记录各个域与令牌 2 的各个域的映射关系如图 25 (b) 所示。  Matclir I matches the data in storeO or storel. The matching condition is: There are column i, which satisfies: the first row, the i-th column, the second row, the i-Cl column, the third row, the i-C2 column, the fourth The storage records in row i-C3 are all "full", and the corresponding matching unit outputs, that is, the read addresses of storeO and storel are equal to i. It also matches the transform key words in the key store. The matching condition is: The FR record is "full". When more than one data meets the above conditions, a random transmission is selected. For the singular token, if pp=l, when the data in the storel satisfies the matching condition, the corresponding data of the storel is packaged into the token 2, otherwise When the data in storeO satisfies the matching condition, the corresponding data of storeO is packaged into token 2 transmission; if the state storage area selected by pp does not have the token data satisfying the condition, and another state storage area has the order satisfying the matching condition Card data, then pp is reversed. The mapping between HDR, DR records in the state store and the fields of token 2 is shown in Figure 25 (a). The mapping relationship between each domain of FR record and each domain of token 2 is shown in Figure 25 (b).
今 令牌 2->令牌 3 Today Token 2->Token 3
令牌 2到令牌 3的各个域间的映射关系如图 26所示。 其中令牌 2的 data 域经过 EU单元计算后, 结果作为令牌 3的 data域。  The mapping relationship between token 2 and token 3 is shown in Figure 26. The data field of token 2 is calculated by the EU unit, and the result is used as the data field of token 3.
EU计算的具体操作根据令牌 2的其它域的取值而定:  The specific operation of the EU calculation depends on the values of other fields of token 2:
当 key=0且 op=Srd时, 执行 Srd操作;  When key=0 and op=Srd, the Srd operation is performed;
当 key=0且 op=SM时, 执行 SM操作;  When key=0 and op=SM, perform SM operation;
当 key=l且 remain=0时, 执行 RC操作;  When key=l and remain=0, perform RC operation;
当 key=l且 remain=l时, 若 Nk>6, 执行 Srd操作; 若 Nk<=6, 结果即等 于令牌 2的 data域。 上述各个操作的流程图如图 27所示。 RC运算中用到的轮 常量 RC在线产生, 即芯片初始化时将 RC寄存器复位为初值 " (01)16" , 每次 执行 RC运算后 (通道 3端口应答信号的上升沿表示运算结束)触发寄存器时钟上 升即把当前 RC值乘 2后存入 RC寄存器 (此处的乘法是定义在 GF (28) 域上 的乘法) ; Srd用 ROM实现附录 A所述的 S盒查表操作; MixCol即实现附录 A 式 1的计算; When key=l and remaining=l, if Nk>6, the Srd operation is performed; if Nk<=6, the result is equal to the data field of token 2. A flowchart of each of the above operations is shown in FIG. The wheel constant RC used in the RC operation is generated online, that is, the RC register is reset to the initial value "(01) 16 " during the initialization of the chip, and each time the RC operation is performed (the rising edge of the channel 3 port response signal indicates the end of the operation) When the register clock rises, the current RC value is multiplied by 2 and stored in the RC register (the multiplication here is the multiplication defined in the GF (2 8 ) domain); Srd uses the ROM to implement the S-box lookup operation described in Appendix A; MixCol That is, the calculation of Equation 1 of Appendix A is implemented;
令牌 3->令牌 5 和 令牌 6  Token 3 -> Token 5 and Token 6
当令牌 3的 key=0时, 产生令牌 5, 当令牌 3的 key=l时, 产生令牌 6。 令 牌 3到令牌 5和令牌 6的各个域间的映射关系如图 28所示  When the key 3 of the token 3 is 0, the token 5 is generated, and when the key 3 of the token 3 is 1, the token 6 is generated. The mapping relationship between the token 3 and the token 5 and the token 6 is shown in Fig. 28.
令牌 4-> 令牌 5  Token 4-> Token 5
令牌 4各个域到令牌 5的各个域间的映射关系如图 29所示。 今 令牌 5->AK暂存单元中的 SR The mapping relationship between the domains of the token 4 and the domains of the token 5 is as shown in FIG. SR in today's token 5->AK temporary storage unit
令牌 5的内容存储到 AK暂存单元的状态暂存区中, 存储地址是令牌 5的 address, 其它各个域与 SR的各个域的映射关系如图 30所示。  The content of the token 5 is stored in the state temporary storage area of the AK temporary storage unit, and the storage address is the address of the token 5, and the mapping relationship between the other domains and the various domains of the SR is as shown in FIG.
令牌 6->AK暂存单元中的 KR  Token 6->KR in the AK temporary storage unit
令牌 6的数据存入 AK暂存单元的中间密钥字存储区, 地址是它的 address 域, 其它各个域与 KR的各个域的映射关系如图 31所示。  The data of the token 6 is stored in the intermediate key word storage area of the AK temporary storage unit, and the address is its address field. The mapping relationship between the other domains and the KR domains is as shown in FIG.
今 AK暂存单元- >令牌 7 Today AK Temporary Unit -> Token 7
Matcher II对应的匹配条件有两个, AddKey匹配条件是: 存在一对状态令 牌 (用 SR[i]表示)和密钥令牌 (用 KR[j]表示), 它们的存储地址分别是 i和 j, 满足:  There are two matching conditions for Matcher II. The AddKey matching condition is: There is a pair of status tokens (represented by SR[i]) and a key token (represented by KR[j]) whose storage addresses are respectively i And j, satisfy:
SR[i]. color · Nb+i-BLOCKX · Nk+j且 SR[i]的 op=0且 KR[j]的轮变换位等 于 0,  SR[i]. color · Nb+i-BLOCKX · Nk+j and SR[i] has op=0 and KR[j] has a round-shift bit equal to 0,
其中 SR[i] .color表示 SR[i]的 color域, 对于 j<4时, BLOCKX=BLOCKL, j 4时, BLOCKX=BLOCKH。 相应的匹配输出 ssel=i, ksel=j,AorT=0;  Where SR[i] .color represents the color field of SR[i], for j<4, BLOCKX=BLOCKL, j 4 , BLOCKX=BLOCKH. Corresponding matching output ssel=i, ksel=j, AorT=0;
Trans匹配条件是: KES=(00)2且地址等于 Nk-1 的密钥存储单元不空, 且 exp— stop=0。 相应的匹配输出 ssel=0, ksel=Nk-l , AorT=l; 或者 Nk > 4 时 KES=(11)2且地址等于 3的密钥存储单元不空, 相应的匹配输出 ssel=0, ksel=3, AorT=l ;或 Nk=4时 KES=(11)2且地址等于 7的密钥存储单元不空且 exp— stop=0, 相应的匹配输出 ssel=0, ksel=7, AorT=l; The Trans match condition is: KES=(00) 2 and the key storage unit with address equal to Nk-1 is not empty, and exp_stop=0. Corresponding matching output ssel=0, ksel=Nk-l, AorT=l; or KES=(11) 2 when Nk > 4 and the key storage unit with address equal to 3 is not empty, the corresponding matching output ssel=0, ksel =3, AorT=l; or KES=(11) 2 when Nk=4 and the key storage unit with address equal to 7 is not empty and exp_stop=0, the corresponding matching output ssel=0, ksel=7, AorT= l;
如果同时有多个令牌 (或令牌对)满足上述条件, 则随机选择一个。 当发 送状态令牌, 即发送 AddKey操作令牌时的令牌 7打包映射关系如图 32a所示; 当发送密钥令牌, 即进行变换密钥字转发时的令牌 7打包映射关系如图 32b-c 所示, 它们分别对应 Nk>4和 Nk=4的情况。  If more than one token (or token pair) meets the above conditions at the same time, randomly select one. When the status token is sent, that is, the token 7 packet mapping relationship when the AddKey operation token is sent is as shown in FIG. 32a; when the key token is transmitted, that is, the token 7 packet mapping relationship when the transform key word is forwarded is as shown in FIG. As shown in 32b-c, they correspond to the case of Nk>4 and Nk=4, respectively.
今 令牌 7->令牌 8 Today Token 7->Token 8
令牌 7与令牌 8的各个域间的映射关系如图 33所示。其中,令牌 7的 datal 和 data2逐位异或的结果作为令牌 8的 data域。  The mapping relationship between the token 7 and each domain of the token 8 is as shown in FIG. The result of bitwise XOR of datal and data2 of token 7 is used as the data field of token 8.
今 令牌 8_>令牌 1或令牌 n Token 8 _>token 1 or token n
当令牌 8的 key=0且 color =Nr时产生令牌 11, 各个域的映射关系如图 34a 所示; 当令牌 8的 key=0且 color<Nr时, 执行轮次更新后产生令牌 1, 各个域 的映射关系如图 34(b)所示,其中令牌 8的 color域加 1后作为令牌 1的 color值, 当令牌 8的 color=Nr-l时, 令牌 1的 op=Srd, 否则 op=SM; 当令牌 8的 key=l 时, 即密钥令牌, 产生令牌 1, 令牌 8的内容直接复制到令牌 1种, 映射关系如 图 34c所示。  When the token 8 has key=0 and color=Nr, the token 11 is generated, and the mapping relationship of each domain is as shown in FIG. 34a; when the token 8 has key=0 and color<Nr, the round update is executed. Card 1, the mapping relationship of each domain is shown in Figure 34 (b), in which the color field of token 8 is added as 1 as the color value of token 1, and when color=Nr-l of token 8 is used, token 1 Op=Srd, otherwise op=SM; When the key of the token 8=l, that is, the key token, the token 1 is generated, and the content of the token 8 is directly copied to the token, and the mapping relationship is as shown in Fig. 34c. Show.
今 令牌 10->令牌 9 Today Token 10->Token 9
令牌 10到令牌 9的各个域间的映射关系如图 35所示。其中令牌 10的 f, k0, Id, k25 k3经过 KeySch计算的结果作为令牌 9的 data域, BLOCK加 1后作为令 牌 9的 BLOCK值。 当 Nk=4时, 令牌 9的 part等于令牌 10的 step的反, Nk>4 时, 令牌 9的 part-令牌 10的 step。 The mapping relationship between the tokens 10 and the tokens of each domain is as shown in FIG. Where token 10 is f, k0, Id, k2 5 k3 The result of KeySch calculation is used as the data field of token 9, and BLOCK is incremented by 1 as the BLOCK value of token 9. When Nk=4, the part of token 9 is equal to the inverse of the step of token 10, and when Nk>4, the part of token 9 is the step of token 10.
今 令牌 9-> KR  Today Token 9-> KR
如果令牌 9的 part=0, 则令牌 9的 data写入密钥暂存区的低段, 令牌 9的 If the part 9 of token 9 is 0, the data of token 9 is written to the lower part of the key temporary storage area, token 9
BLOCK值赋给 BLOCKL, 写入的同时将低段暂存单元的 op域的两位都复位成 0; 如果令牌 9的 part=l, 则令牌 9的 data写入密钥暂存区的高段, 令牌 9的 BLOCK值赋给 BLOCKH,写入的同时将高段暂存单元的 op域的两位都复位成 0。 The BLOCK value is assigned to BLOCKL, and both bits of the op field of the low-order temporary storage unit are reset to 0 at the same time; if part=l of the token 9 is written, the data of the token 9 is written into the key temporary storage area. In the high segment, the BLOCK value of token 9 is assigned to BLOCKH, and both bits of the op field of the high segment temporary storage unit are reset to 0 at the same time.
令牌 9写入时要更新 KES的状态, 具体状态转移关系是:  When the token 9 is written, the state of the KES is updated. The specific state transition relationship is:
当 KES=(01)2时,如果 Nk>4且令牌 9的 part=0,或者 Nk=4且令牌 9的 part=l, 则 KES变为 (11)2When KES=(01) 2 , if Nk>4 and part=0 of token 9, or Nk=4 and part=l of token 9, KES becomes (11) 2 ;
当 KES=(10)2时,如果 Nk>4且令牌 9的 part=l,或 Nk=4且令牌 9的 part=0, 则 KES变为 (00)2When KES=(10) 2 , if Nk>4 and part=l of token 9, or Nk=4 and part=0 of token 9, then KES becomes (00) 2 ;
今 MatchingUnit->令牌 10  MatchingUnit->Token 10
Matcher 对 AK暂存单元的密钥暂存区中的数据进行匹配,匹配条件是- 所有低段密钥记录的 op的低位都为 0且中间密钥字 1存在, 相应的匹配单元 输出 step=0; 或者存储地址为 4到存储地址为 Nk-1的密钥记录的 op的低位 都为 0且中间密钥字 2存在, 相应的匹配单元输出 step=l;  Matcher matches the data in the key temporary storage area of the AK temporary storage unit. The matching condition is - the lower bits of the op of all the low-level key records are 0 and the intermediate key word 1 exists, and the corresponding matching unit outputs step= 0; or storing the address 4 to the storage address Nk-1 key record op lower low bit is 0 and the intermediate key word 2 exists, the corresponding matching unit output step = l;
当 step=0时, 令牌 10的 f等于中间密钥字 1的 data, k0, kls k2, k3依次分别 等于存储地址为 0, 1, 2, 3的 KR的 data, BLOCK等于 BLOCKL; 当 step=l 时, 令牌 10的 f等于中间密钥字 2的 data, k0, kl, k2, k3依次分别等于存储地 址为 4, 5, 6, 7的 KR的 data, BLOCK等于 BLOCKH。 工业应用性 通过本发明的设计, 使本发明具有可抵抗功耗分析攻击, 冗余操作、 冗余电 路少的优点, 从而在信息安全领域, 特别是密码芯片实现安全领域中, 可以获得 低能耗、 高安全性的效果, 本发明可以应用在智能卡, 如身份证卡、 金融卡、 付 费电视卡, 数字移动证书, 移动个人终端, 如 PDA、 手机、 便携电脑等需要存有 密钥的加密芯片的应用领域中。 When step=0, the f of the token 10 is equal to the data of the intermediate key word 1, k 0 , k ls k 2 , k 3 are respectively equal to the data of the KR storing the address 0, 1, 2, 3, respectively, BLOCK is equal to BLOCKL; When step=l, f of token 10 is equal to data of intermediate key word 2, k0, kl, k2, k3 are respectively equal to the data of KR storing address 4, 5, 6, 7 respectively, BLOCK is equal to BLOCKH . Industrial Applicability Through the design of the present invention, the present invention has the advantages of being resistant to power analysis attacks, redundant operations, and fewer redundant circuits, thereby achieving low power consumption in the field of information security, particularly in the field of cryptographic chip implementation security. High security effect, the invention can be applied to smart cards, such as ID cards, financial cards, pay TV cards, digital mobile certificates, mobile personal terminals, such as PDAs, mobile phones, portable computers, etc. In the field of application.

Claims

权利要求  Rights request
1、一种乱序执行的数据流 AES加密电路, 其特征在于, 该电路结构是在一个数 据流加密专用集成电路上实现的, 该电路结构遵从以 Rijndad算法为最终算法的高级 数据加密标准, 记为 AES, 使用数据流模式实现乱序加密, 该电路结构含有- a. 传输通道,是两个部件间的数据传输接口,所传输的数据是相应编号的令牌, 其中包括一个令牌输入数据总线、一个数据输出总线和输入请求与应答信号、 输出请求与应答信号, 该传输通道与外部的接口就是通道端口;  An out-of-order data stream AES encryption circuit, characterized in that the circuit structure is implemented on a data stream encryption application specific integrated circuit, the circuit structure conforms to the advanced data encryption standard using the Rijndad algorithm as a final algorithm. Recorded as AES, using data stream mode to achieve out-of-order encryption, the circuit structure contains - a. transmission channel, is the data transmission interface between the two components, the transmitted data is the corresponding number of tokens, including a token input a data bus, a data output bus and an input request and response signal, an output request and an acknowledge signal, and the interface between the transmission channel and the external is a channel port;
b. 输入单元, 是芯片内核与外部的接口, 实现把明文和密钥按照协议要求的时 序输入并通过 4#传输通道将明文送入内核部分、把密钥写入初始密钥存储器 的功能, 同时产生该电路结构中内核的各个单元所需的复位信号 InterRstJ¾ 初始密钥置入信号 load; 所述的 4#通道传输的令牌, 命名为令牌 4包括一个 32位的数据域, 一个 2位的 column域;  b. The input unit is an interface between the chip core and the external, and realizes the function of inputting the plaintext and the key according to the timing required by the protocol and sending the plaintext to the kernel part through the 4# transmission channel, and writing the key into the initial key memory. At the same time, the reset signal InterRstJ3⁄4 required for each unit of the core in the circuit structure is generated. The initial key is placed into the signal load; the token transmitted by the 4# channel is named as token 4, which includes a 32-bit data field, a 2 Bit of the column field;
c 通道开关单元 Switch, 是一个 2传输通道输入 -2传输通道输出的交换开关, 此外还接收来自工作状态寄存器的输入信号 WK, 当 WIO0时, 该通道开关 单元处于空闲状态, 接收所述输入单元经 4#通道送来的明文数据, 经过解析 后, 把其中的数据重新打包成状态字令牌, 发送给 5#通道, 所述的 5#通道传 输的令牌, 命名为令牌 5包括一个 32位的数据域, 一个 4位的表示轮次的 color域和一个 2位的地址域, 根据令牌 4打包时, 令牌 5的数据域直接复制 令牌 4的数据域, 令牌 5的 color域设为 0, 令牌 5的地址域复制令牌 4的 column域; 当 WK=1时, 处于工作状态, 把 3#通道发来的令牌解析后, 根 据不同的类型, 把状态字令牌重新打包成一个令牌发给 5#通道, 把密钥字令 牌重新打包成一个令牌发送给通道 6; 所述的 3#通道传输的令牌, 命名为令 牌 3包括一个 1位的属性域和一个 32位的数据域, 当属性域等于 0时,是状 态字令牌,还包括一个 1位的操作符域、一个 2位的 column域、一个 4位的 color域,把它重新打包成令牌 5时,其中的数据域直接复制令牌 3的数据域, color域直接复制令牌 3的 color域, 地址域直接复制令牌 3的 column域, 当 令牌 3属性域等于 1时, 是密钥字令牌, 还包括一个 1位的 fadd位和 6位不 关心的数据, 所述发送到 6#通道的令牌, 命名为令牌 6, 是下述的中间密钥 字令牌, 包括一个 32位的数据域和一个 1位的地址域, 把它打包成令牌 6 时, 令牌 3的数据域直接复制到令牌 6的数据域, fadd域复制到令牌 6的地 址域;  c channel switching unit Switch, is a switching switch of 2 transmission channel input-2 transmission channel output, and also receives input signal WK from working status register, when WIO0, the channel switching unit is in idle state, receiving the input unit After the plaintext data sent by the 4# channel is parsed, the data is repackaged into a status word token, and sent to the 5# channel, and the token transmitted by the 5# channel is named as token 5 including one 32-bit data field, a 4-bit color field representing a round and a 2-bit address field. When packing according to token 4, the data field of token 5 directly copies the data field of token 4, token 5 The color field is set to 0, the address field of token 5 is copied to the column field of token 4; when WK=1, it is in working state, after parsing the token sent from channel 3, according to different types, the status word is The token is repackaged into a token and sent to the 5# channel, and the key word token is repackaged into a token and sent to channel 6. The token transmitted by the 3# channel is named as token 3 including a 1 The attribute field and a 32-bit data field. When the attribute field is equal to 0, it is a status word token. It also includes a 1-bit operator field, a 2-bit column field, and a 4-bit color field. When repackaging into token 5, the data field directly replicates the data field of token 3, the color field directly replicates the color field of token 3, and the address domain directly replicates the column domain of token 3, when the token 3 attribute domain is equal to 1 is a key word token, and further includes a 1-bit fadd bit and 6 bits of data that are not of interest. The token sent to the 6# channel, named token 6, is the intermediate key described below. The word token includes a 32-bit data field and a 1-bit address field. When it is packaged into token 6, the data field of token 3 is directly copied to the data field of token 6, and the fadd domain is copied to the token. Address field of 6;
d. 初始密钥存储器是一个 256位的寄存器组, 从所述输入单元接收时钟信号和 输入的密码密钥数据, 把来自所述输入单元的密码密钥直接接收存入; e. AK暂存器单元, 是待执行 AddKey运算的令牌暂存单元, 包括密钥字存储 器、 状态字存储器以及令牌解析和打包电路, 其中, 密钥字存储器有 8个密 钥字存储单元, 2个中间密钥字存储单元、 两个 5位内部存储器: BLOCKH 和 BLOCKL及一个 2位状态寄存器 KES, 该密钥字存储区有 3位地址, 二 进制表示的地址空间是 000-111, 依次存储序号模密钥分组列数 Nk等于 0-7 的扩展密钥字, 髙段为 100-111, 低段为 000-011, 每条存储记录包括一个 32 位的数据域、 一个 1位的 fadd域、 一个轮变换标记位和一个扩展标记位; 所 述密钥字存储器中地址等于 Nk-1 的单元存储的数据称为变换密钥字 1 , Nk 不等于 4时地址等于 3的记录数据称为变换密钥字 2, Nk等于 4时的变换密 钥字 2是地址等于 7的记录数据; 该状态字存储区有 2位地址, 二进制表示 的地址空间是 00-11 , 依次存储状态中的第 0-3列, 每条记录包括一个 32位 的数据域、 一个 4位的 color域; 该中间密钥字存储区, 有一位地址空间: 0-1, 依次存储从通道端口 6来的中间密钥字, 该中间密钥字是 AES密钥扩 展算法中定义的非线性函数的计算结果,每条存储记录包括一个 32位的数据 域; 所述的暂存单元的每个存储单元都对应一个标记为 flag的 "满 /空"标记 位, 当单元写入时 flag置 1, 表示满, 当数据读出后 flag复位, 表示空; 该 BLOCKH存储髙段密钥字的 "分组值", BLOCKL存储低段密钥字的 "分组 值", 所述 "分组值 "是指所有轮扩展密钥序列按所述 Nk个一组分组后, 所 得到的组的序号, 该扩展密钥由初始密钥扩展而成, 该扩展密钥的总长为 4 (Nr+1 ), Nr为迭代轮数; 该 AK暂存器单元有三个输入通道端口: 通道 5 端口接收令牌 5并写入状态字存储区, 写入的地址是令牌 5的地址域的值, 状态字记录的数据域和 color域分别等于令牌 5的数据域和 color域, 通道 6 端口接收令牌 6, 写入中间密钥字区, 写入地址是令牌 6的地址域的值, 写 入记录的数据域直接复制令牌 6的数据域, 通道 9端口接收新的扩展密钥字 令牌并写入密钥字存储区, 另外, 密钥字存储区还有一个置数端口, 与所述 初始密钥寄存器的输出端相连, 256位宽, 由所述 load信号作置位信号; 该 AK暂存器单元有两个输出通道端口; 通道 7端口发送作 AddKey运算或变 换密钥字转发用的操作数令牌,通道 10端口发送密钥扩展运算用的操作数令 牌; d. The initial key storage is a 256-bit register set, receives a clock signal and input cryptographic key data from the input unit, and directly receives the cryptographic key from the input unit; e. AK temporary storage Unit, is the token temporary storage unit to be executed, including key word storage The device, the status word memory, and the token parsing and packing circuit, wherein the key word memory has 8 key word storage units, 2 intermediate key word storage units, and two 5-bit internal memories: BLOCKH and BLOCKL and one 2 Bit status register KES, the key word storage area has a 3-bit address, the binary represented address space is 000-111, and sequentially stores the extended key words of the sequence number modulo key grouping column number Nk equal to 0-7, and the 髙 segment is 100 -111, the low segment is 000-011, and each storage record includes a 32-bit data field, a 1-bit fadd field, a round-change flag bit, and an extended flag bit; the address in the key word memory is equal to Nk The data stored in the unit of -1 is called transform key word 1, the record data whose address is equal to 3 when Nk is not equal to 4 is called transform key word 2, and the transform key word 2 when Nk is equal to 4 is the record with address equal to 7. Data; The status word storage area has a 2-bit address, the binary representation of the address space is 00-11, and sequentially stores the 0-3th column in the state, and each record includes a 32-bit data field and a 4-bit color field. ; the intermediate key word storage , there is an address space: 0-1, which stores the intermediate key words from channel port 6 in sequence, which is the calculation result of the nonlinear function defined in the AES key expansion algorithm, and each storage record includes one 32-bit data field; each memory cell of the temporary storage unit corresponds to a "full/empty" flag bit labeled flag, and flag is set to 1 when the cell is written, indicating full, when the data is read, flag Reset, indicating null; the BLOCKH stores the "packet value" of the segment key word, BLOCKL stores the "packet value" of the low segment key word, and the "packet value" refers to all round extended key sequences according to the Nk After grouping, the serial number of the obtained group is expanded by the initial key, the total length of the extended key is 4 (Nr+1), and Nr is the number of iterations; the AK register The unit has three input channel ports: Channel 5 port receives token 5 and writes to the status word storage area, the address written is the value of the address field of token 5, and the data field and color field of the status word record are equal to token 5, respectively. Data field and color field, channel 6 port receives token 6, written in The key word area, the write address is the value of the address field of the token 6, the data field written in the record directly copies the data field of the token 6, and the channel 9 port receives the new extended key word token and writes the secret a key word storage area, in addition, the key word storage area further has a set port connected to the output end of the initial key register, 256 bits wide, and the load signal is used as a set signal; the AK register The unit has two output channel ports; the channel 7 port sends an operand token for the AddKey operation or the conversion key word forwarding, and the channel 10 port transmits the operand token for the key expansion operation;
el. 所述的通道 9端口传输的令牌,命名为令牌 9,包括 4个 32位的数据域 k0-k3、 一个 5位的 BLOCK域和一个 1位的 part域, 令牌 9part等于 0 则 1¾)-1¾依次写入密钥字存储区地址为 000-011的单元,所述地址用二进 制表示, 令牌 9的 BLOCK值赋给 BLOCKL, 同时将所有低段单元的轮 变换标记位和扩展标记位复位为 0, 令牌 9part等于 1则 k()-k3依次写入 密钥字存储区二进制表示的地址为 100-111 的单元, 令牌 9的 BLOCK 值赋给 BLOCKH, 同时将所有高段单元的轮变换标记位和扩展标记位 复位为 0; El. The channel 9 port transmitted token, named token 9, includes four 32-bit data fields k 0 -k 3 , a 5-bit BLOCK field and a 1-bit part field, token 9part Equal to 0 then 13⁄4)-13⁄4 is sequentially written to the unit with the key word storage area address 000-011, the address is represented by binary, the BLOCK value of token 9 is assigned to BLOCKL, and the round transformation of all low-level units is marked. The bit and extension flag bits are reset to 0, and the token 9part is equal to 1 then k()-k 3 is sequentially written into the unit of the address word storage area binary representation of 100-111, and the BLOCK value of token 9 is assigned to BLOCKH. At the same time, all the high segment units are rotated and marked with extended flag bits. Reset to 0;
e2. 所述通道 7端口发送的令牌, 命名为令牌 7, 包括 2个 32位的数据域 datal和 data2、一个 1位的属性域,属性域的值等于发送时下述的 AorT 信号的取值: 当 AorT等于 0时, 执行 AddKey操作, 令牌 7是状态字 令牌, 它还包括一个 4位的 color域、 一个 2位的 column域, 打包时, 把下述的 ssel信号的值复制到它的 column域、 地址等于 ssel的状态字 存储记录的数据域复制到令牌 7的 datal域、该状态记录的 color域复制 到令牌 7的 color域, 地址等于下述 ksel值的密钥存储记录的数据域复 制到令牌 7的 data2域, 通道 7端口的应答信号将读取的状态字记录情 空, 把读取的密钥字记录的轮变换位变成 1 ; 当 AorT等于 1时, 执行 变换密钥字转发操作, 令牌 7是密钥令牌, 除数据域和属性域外还包括 一个 1位的操作符域、一个 1位的 fadd域与 4位不关心的数据,打包时, datal域等于 0,地址等于下述 ksel值的密钥存储记录的数据域复制到它 的 data2域; ksel等于 Nk-1时, 转发变换密钥字 1, fadd等于 0, 操作 符域等于 0, 表示此令牌将执行下述 f变换, Nk等于 4时, 若 ksel等于 7, 则表示转发变换密钥字 2, fadd域等于 1, 操作符域等于 0, 表示此 令牌将执行下述 f变换, 若 Nk不等于 4且 ksd等于 3, 则表示转发变 换密钥字 2, fadd等于 1, 操作符域等于 1, 表示此令牌将执行下述 g 变换; 通道 7端口的应答信号将读取的状态字记录清空; E2. The token sent by the port 7 port is named token 7. It includes two 32-bit data fields datal and data2, and a 1-bit attribute field. The value of the attribute field is equal to the following AorT signal when transmitting. Value: When AorT is equal to 0, the AddKey operation is performed. Token 7 is a status word token. It also includes a 4-bit color field and a 2-bit column field. When packing, copy the value of the ssel signal described below. The data field to its column field, the address equal to the ssel's status word storage record is copied to the datal field of token 7, the color field of the status record is copied to the color field of token 7, and the address is equal to the key of the following ksel value The data field of the stored record is copied to the data2 field of token 7, the response signal of the channel 7 port will read the status word record, and the rounded bit of the read key word record will be changed to 1; when AorT is equal to 1 When performing the transformation key word forwarding operation, the token 7 is a key token, and includes a 1-bit operator field, a 1-bit fadd field, and 4 bits of unintentional data in addition to the data field and the attribute domain, and packaging When, datal The data field of the key storage record equal to 0, the address is equal to the ksel value described below is copied to its data2 field; when ksel is equal to Nk-1, the forwarding transform key word 1, fadd is equal to 0, and the operator field is equal to 0, indicating this The token will perform the following f-transformation. When Nk is equal to 4, if ksel is equal to 7, it means forwarding the transformation key word 2, the fadd field is equal to 1, and the operator field is equal to 0, indicating that the token will perform the following f-transformation. If Nk is not equal to 4 and ksd is equal to 3, it means forwarding the translation key word 2, fadd is equal to 1, and the operator field is equal to 1, indicating that the token will perform the following g transformation; the response signal of the channel 7 port will be read. The status word record is cleared;
e3. 所述通道 10端口发送的令牌命名为令牌 10,包括一个 32位的中间密钥 字域、 4个 32位的密钥字域 kQ-k3、 一个 5位的 BLOCK域和一个 1位 的 step域, 打包时令牌 10的 step域等于令牌发送时所述的 step信号的 值, 当令牌发送时刻所述 step信号等于 0时, 令牌 10的中间密钥字域 等于中间密钥字存储区中地址等于 0的记录的数据,令牌 10的 BLOCK 域的值等于所述 BLOCKL寄存器的值,通道 10端口的应答信号把密钥 存储区低段的 4个密钥字的扩展位都置成 1, 当令牌发送时刻所述 step 信号等于 1时, 令牌 10的中间密钥字域等于中间密钥字存储区中地址 等于 1的记录的数据,令牌 10的 BLOCK域的值等于所述 BLOCKH寄 存器的值, 通道 10端口的应答信号把密钥存储区高段的所有密钥字的 扩展位都置成 1 ; E3. The token sent by the channel 10 port is named token 10, and includes a 32-bit intermediate key field, four 32-bit key fields k Q -k 3 , a 5-bit BLOCK field, and A 1-bit step field, the step field of the token 10 is equal to the value of the step signal when the token is sent, and the intermediate key field of the token 10 when the step signal is equal to 0 when the token is sent. Equal to the recorded data in the intermediate key word storage area whose address is equal to 0, the value of the BLOCK field of the token 10 is equal to the value of the BLOCKL register, and the response signal of the channel 10 port is the 4 keys of the lower part of the key storage area. The extension bit of the word is set to 1, when the step signal is equal to 1 at the time of token transmission, the intermediate key word field of the token 10 is equal to the recorded data of the address equal to 1 in the intermediate key word storage area, the token 10 The value of the BLOCK field is equal to the value of the BLOCKH register, and the response signal of the channel 10 port sets the extension bits of all key words in the high section of the key storage area to 1;
e4. 该 KES控制密钥扩展的时序, 状态都采用二进制编码表示, KES的初 始状态二进制编码是 00, 即准备计算/的状态, 在此状态下执行变换密 钥字 1转发后, KES二进制编码变为 01, 进入执行 f变换的状态, 在 01状态下读取低段密钥进行密钥扩展时, KES的状态变化为 11, 处于 准备计算 g的状态, 在 11的状态下执行变换密钥字 2操作后, KES的 状态变化为 10, 进入执行 g变换的状态, 在 10状态下读取高段密钥进 行密钥扩展时, KES的状态变化为 00; E4. The timing of the KES control key extension, the state is represented by binary code, the initial state binary code of KES is 00, that is, the state of preparation/calculation, after performing the transformation key word 1 forwarding in this state, KES binary coding When it becomes 01, it enters the state in which the f-transformation is performed. When the low-segment key is read in the 01 state to perform key expansion, the state of the KES changes to 11, the state in which the calculation g is prepared, and the transformation key is executed in the state of 11. After word 2 operation, KES The state changes to 10, enters the state of performing g transformation, and when the high-segment key is read in 10 state for key expansion, the state of KES changes to 00;
工作状态寄存器,向所述输入单元发送 WK信号,向所述通道开关单元 Switch 发送 WK信号, 接收来自下述 Matcher OK单元的 OK信号; 当 OK信号上 升时 WK复位; a working status register, transmitting a WK signal to the input unit, transmitting a WK signal to the channel switch unit Switch, receiving an OK signal from a Matcher OK unit described below; WK resetting when the OK signal is raised;
Matcher II匹配单元, 检査 AK暂存器单元中的状态字存储区和密钥字存储 区, 发现就绪的状态字-密钥字对或就绪的变换密钥则随机选取其中之一, 把 相应的地址所选择信号传送给所述 AK暂存器单位, 随后触发令牌发射信号 fetch— II , 所述的选择信号包括标记为了 ssel的 AddKey状态字读地址、 标 记为 ksel的密钥字读地址、 标记为 AorT的表示发送令牌将执行的操作的信 号: 0表示 AddKey运算, 1表示变换密钥字转发, 标记为 Trans; 该 Matcher II 匹配单元的输入包括: AK暂存器单元的状态字存储区和密钥字存储区的 观测信号, 其中包括状态字记录的 color位与 flag位, 密钥字记录的轮变换 标记位和扩展标记位、 flag域, BLOCKL和 BLOCKH, KES, 另外还有密钥 分组列数 Nk; 所述的 "就绪"是指: 计算所有被观测状态字和密钥字的序列 号, 寻找序列号相同且 flag都为 1的状态字 -密钥字对, 或者根据 KES状态 检测并发现相应的变换密钥字; 所述 fetch一 II信号到来, 则触发所述 AK暂 存单元把令牌发送给 7#通道; 当被发送的状态字被清空, 或者 KES状态改 变, 则 fetch— II复位; The Matcher II matching unit checks the status word storage area and the key word storage area in the AK register unit, and finds that the ready status word-key pair or the ready conversion key is randomly selected one of them. The address selection signal is transmitted to the AK register unit, and then the token transmission signal fetch_II is triggered, and the selection signal includes an AddKey status word read address marked for ssel, and a key word read address marked as ksel The signal labeled AorT indicating the operation that the token will perform: 0 for the AddKey operation, 1 for the conversion key word forwarding, labeled Trans; the input to the Matcher II matching unit includes: the status word of the AK register unit The observation signal of the memory area and the key word storage area, including the color bit and flag bits of the status word record, the round conversion flag bit and the extended flag bit of the key word record, the flag field, BLOCKL and BLOCKH, KES, and Nk of the key grouping columns; the "ready" means: calculate all the sequence numbers and the observed status word key word, to find the same sequence number and a state flag are 1 word - word key pair Or detecting and discovering a corresponding transform key word according to the KES state; when the fetch-II signal arrives, triggering the AK temporary storage unit to send the token to the 7# channel; when the sent status word is cleared, or KES The state changes, then fetch — II resets;
Matcher K匹配单元, 检查密钥字存储区和中间密钥字存储区的观测信号: 轮变换标记位和扩展标记位、 flag和 KES状态; 当 KES处于密钥扩展状态 下,且相应的密钥字段和中间密钥字段已准备就绪则把标记为 step 的密钥扩 展读地址变为相应的值: 1为高段扩展, 0为低段扩展, 并触发令牌发射信号 fetch— K:, 所述的 AK 暂存器单元根据 step 信号把密钥区的相应数据以及 BLOCK值打包成令牌等待发送, 当 fetch— K信号来到时, 触发所述 AK暂存 单元把该令牌经通道 10发出; 如果下述的 exp_stop信号有效, Matcher K匹 配单元则停止工作;  Matcher K matching unit, check the observation signal of the key word storage area and the intermediate key word storage area: round transformation flag bit and extension flag bit, flag and KES state; when KES is in key extension state, and the corresponding key When the field and intermediate key fields are ready, the key extended read address marked as step becomes the corresponding value: 1 for the high segment extension, 0 for the low segment extension, and triggering the token to emit the signal fetch — K:, The AK register unit packs the corresponding data of the key area and the BLOCK value into a token waiting for transmission according to the step signal. When the fetch_K signal comes, the AK temporary storage unit is triggered to pass the token through the channel 10. Issue; if the exp_stop signal described below is valid, the Matcher K matching unit stops working;
密钥扩展运算单元, 用 Key Schedule标记, 接收并解析来自通道 10的令牌, 经过下述 Key Schedule 处理后打包成内含所述新的扩展密钥的令牌经通道 9 发出, 所述的 Key Schedule 的处理含有以下运算: a key expansion operation unit, which receives and parses a token from the channel 10 by using a Key Schedule, and is packaged into a token containing the new extended key and sent out through the channel 9 through the Key Schedule processing described below. The processing of Key Schedule contains the following operations:
il. 把所述令牌 10的中间密钥字域和 kQ-k3域作为输入,执行 KeySch运算: 中间密钥字与 ko逐位异或, 结果输出作为令牌 9的 kQ域, 并与令牌 10 的 l 逐位异或,结果输出作为令牌 9的 ki,并与令牌 10的 k2逐位异或, 结果输出作为令牌 9的 k2, 并与令牌 10的 k3逐位异或, 结果输出作为 令牌 9的 k3 ; Il. Performing the KeySch operation by taking the intermediate key field and the k Q -k 3 field of the token 10 as input: the intermediate key word is XORed with ko, and the result is output as the k Q field of the token 9. 10 l of the token and the bit-wise XOR ki 9 outputs the result as a token, the token 10 and the k bit-wise exclusive-oR 2 outputs the result as a token. 9 k is 2, and the token 10 k 3 bitwise XOR, the result is output as k 3 of token 9 ;
12. 把所述令牌 10的 BLOCK域加 1后的结果作为令牌 9的 BLOCK值;12. The result of adding 1 to the BLOCK field of the token 10 is taken as the BLOCK value of the token 9;
13. 当 Nk=4时, 把所述令牌 10的 step域的逻辑反作为所述令牌 9的 part 域, 如果 Nk>4, 则把所述令牌 10的 step域直接复制到所述令牌 9的 part域; 13. When Nk=4, the logical reverse of the step field of the token 10 is used as the part field of the token 9, and if Nk>4, the step field of the token 10 is directly copied to the Part field of token 9;
AddKey运算单元, 在接收并解析通道 7发来的操作数令牌后, 对其中的数 据执行 AddKey运算后,打包成轮密钥混合令牌,经通道 8发送,所述 AddKey 运算即 AES算法定义的轮密钥加法操作作用于状态的一列;所述经通道 8发 送的令牌, 命名为令牌 8, 包括一个 32位的数据域和一个 1位的属性域, 当 属性域等于 0时, 是状态字令牌, 还包括一个 4位的 color域和一个 2位的 column域, 当属性域等于 1时, 是密钥令牌, 还包括一个 1位的操作数域和 一个 1位的 fadd域, 打包时, 把令牌 7的 datal与 data2逐位异或的结果作 为令牌 8的结果, 令牌 7的其余域直接复制到令牌 8中与之同名的域中; 轮更新通道开关单元, 对来自通道 8的令牌进行轮次检査, 若是状态字令牌 且轮次已经达到迭代轮次 Nr, 则经通道 11转发到下述输出暂存单元; 否则, 把其轮次加 1经通道 1转发到下述 EU暂存器单元执行后续处理; 若到达的 令牌轮次为 Νι·, 且上述与其相加的扩展密钥属于密钥分组的高段, 即表示密 钥扩展已经完成, 则触发 exp一 stop信号; 若是密钥字令牌则直接由通道 1转 发到下述 EU暂存器单元执行后续处理; 所述令牌处理包括如下 3情况: kl. 通道 11传输的令牌, 命名为令牌 11, 包括一个 32位的数据域和一个 2 位的 column域,打包时,令牌 8的数据域直接复制到令牌 11的数据域, 令牌 8的 column域直接复制到令牌 11的 column域;  The AddKey operation unit, after receiving and parsing the operand token sent by the channel 7, performs an AddKey operation on the data therein, and then is packaged into a round key hybrid token, which is sent through the channel 8, and the AddKey operation is defined by the AES algorithm. The round key addition operation acts on a column of states; the token sent via channel 8 is named token 8, and includes a 32-bit data field and a 1-bit attribute field. When the attribute field is equal to 0, Is a status word token, also includes a 4-bit color field and a 2-bit column field. When the attribute field is equal to 1, it is a key token, and also includes a 1-bit operand field and a 1-bit fadd. Domain, when packing, the result of bitwise XOR of datal and data2 of token 7 is the result of token 8, and the remaining fields of token 7 are directly copied to the domain of token 8 with the same name; Unit, performing a round check on the token from channel 8, if it is a status word token and the round has reached the iteration round Nr, then forwarded to the following output temporary storage unit via channel 11; otherwise, add its round 1 via channel 1 Sending to the following EU register unit to perform subsequent processing; if the arrived token round is Νι·, and the above-mentioned extended key belongs to the high segment of the key group, indicating that the key expansion has been completed, Trigger exp-stop signal; if it is a key word token, it is directly forwarded by channel 1 to the following EU register unit to perform subsequent processing; the token processing includes the following three cases: kl. Channel 11 transmitted token, named For token 11, including a 32-bit data field and a 2-bit column domain, when packing, the data field of token 8 is directly copied to the data field of token 11, and the column field of token 8 is directly copied to the token. 11 column field;
k2. 当令牌 8的属性域为 0时, 所述通道 1发送的令牌, 命名为令牌 1, 是 状态字令牌, 包括一个 32位的数据域、 一个 4位的 color域、 一个 2位 的 column域一个 1位的操作符域和一个 1位的属性域打包时, 令牌 8 的数据域和 column域直接复制到令牌 1中同名的域中, 令牌 8的 color 域加 1后的结果作为令牌 1的 color域, 令牌 1的属性域等于 0, 若令 牌 8的 color域等于 Nr-1, 则令牌 1的操作符域标记为 Srd操作, 否则 令牌 1的操作符域标记位 SM操作; K2. When the attribute field of token 8 is 0, the token sent by channel 1 is named token 1, which is a status word token, including a 32-bit data field, a 4-bit color field, and a When the 2-bit column field is packed with a 1-bit operator field and a 1-bit attribute field, the data field and the column field of token 8 are directly copied to the domain of the same name in token 1, and the color field of token 8 is added. The result after 1 is the color field of token 1, the attribute field of token 1 is equal to 0, and if the color field of token 8 is equal to Nr-1, the operator field of token 1 is marked as Srd operation, otherwise token 1 Operator field flag bit SM operation;
k3. 如果令牌 8的属性域等于 1, 所述通道 1发送的令牌 1是变换密钥字令 牌, 包括一个 32位的数据域、 一个 1位的操作符域、 一个 1位的 fadd 域和 5位不关心的数据, 打包时, 令牌 8的各域分别直接复制到令牌 1 中同名的域中; K3. If the attribute field of token 8 is equal to 1, token 1 sent by channel 1 is a transform key word token, including a 32-bit data field, a 1-bit operator field, and a 1-bit fadd. Domain and 5 bits of data that are not of interest. When packing, the fields of token 8 are directly copied to the domain of the same name in token 1;
输出暂存单元, 是一个密文重排的暂存单元, 由一个 4 X 32 比特的存储单元 和令牌解析电路组成,该单元接收通道 11来的乱序到达的结果令牌所携带的 密文数据并暂存, 写入的地址是所述令牌 11的 column域, 写入的数据是所 8/061395 述令牌 11的数据域,在接收到下述接收单元的读地址信号后输出对应的密文 状态字; 所述的暂存单元的每个存储单元都对应一个标记为 flag的 "满 /空" 标记位, 当单元写入时 flag置 1, 表示满, 当数据读出后 flag复位, 表示空; m. 输出单元, 该单元是所述芯片与外部的接口、 实现把密文按要求的时序输出 的功能; The output temporary storage unit is a ciphertext rearrangement temporary storage unit, which is composed of a 4×32-bit storage unit and a token parsing circuit, and the unit receives the denseness carried by the result token of the out-of-order arrival of the channel 11. The text data is temporarily stored, and the address written is the column field of the token 11, and the data written is 8/061395 The data field of the token 11 outputs a corresponding ciphertext status word after receiving the read address signal of the receiving unit described below; each storage unit of the temporary storage unit corresponds to a flag labeled "flag" The full/empty flag bit, when the unit is written, the flag is set to 1, indicating full. When the data is read, the flag is reset, indicating null; m. The output unit, the unit is the interface between the chip and the external, and the ciphertext is implemented. Function output at the required timing;
n. Matcher OK匹配单元, 检査所述输出暂存单元中的所有 flag信号, 当所有的 flag都为 1则表示全部密文字都已到达, 则把结束信号 OK变成高电位, 在 通知所述工作状态存储器的同时也通知所述输出单元读取所述输出暂存单元 的密文状态字, 当 flag被复位后, OK信号变为低电位; n. Matcher OK matching unit, check all the flag signals in the output temporary storage unit, when all the flags are 1, it means that all the secret characters have arrived, then the end signal OK becomes high, at the notification station The working state memory is also notified to the output unit to read the ciphertext status word of the output temporary storage unit, and when the flag is reset, the OK signal becomes a low potential;
0. EU暂存器单元, 由一个密钥字存储区和两个完全相同的状态存储区组成, 依次标记为 key store、 storeO和 storel; 其中, key store存储密钥扩展的变 换密钥字, 一条存储记录包括一个 32位的数据域、 一个 1位的 fadd域和一 个 1位的操作符域, storeO/storel依次存储行移位之前 "状态"中的第 0-第 3 列, 每列存储单元又分为 4行, 第 0行的记录包括 1个 8位的数据域、 一个 4位的 color域和一个 1位的操作符域,第 1行至第 3行的记录包含一个 8位 的数据域; 所述两个状态存储单元按照乒乓式读写的流水线方式工作: 根据 输入令牌的轮次标记, 当轮次为偶数时写入 storeO, storel中的数据必是前一 轮的状态, 从 storel 中读取数据处理; 当令牌的轮次为奇数, 则写入 storel,store0 必是前一轮状态的待处理数据, 从 storeO 中读取数据处理; 该 EU暂存器单元设有一个传输通道端口, 接收所述轮更新通道开关单元经通 道 1发出的令牌 1, 从中解析出令牌类型: 状态令牌还是密钥令牌、 写地址 和记录数据, 并把记录写入相应的存储单元中; 一个输出传输通道端口, 与 通道 2相连, 根据下述 Matcher I匹配单元输入的读地址、 storeO/storel选择 信号以及状态 /变换密钥选择信号输出相应的状态字或变换密钥字,与其他控 制信号一起打包成令牌, 经通道 2发送给下述 EU运算单元; 上述 3个暂存 区的每个存储单元都对应一个标记为 flag的 "满 /空"标记位, 当单元写入时 flag置 1, 表示满, 当数据读出后 flag复位, 表示空;  0. The EU register unit is composed of a key word storage area and two identical state storage areas, which are sequentially labeled as key store, storeO, and storel; wherein, the key store stores the key expansion conversion key word, A storage record consists of a 32-bit data field, a 1-bit fadd field, and a 1-bit operator field. storeO/storel stores the 0th to 3rd columns in the "state" before the row shift, and each column stores The unit is further divided into 4 lines, and the record of the 0th line includes an 8-bit data field, a 4-bit color field, and a 1-bit operator field, and the records of the 1st line to the 3rd line contain an 8-bit field. Data field; the two state storage units work in a pipeline mode of ping-pong type reading and writing: according to the round mark of the input token, when the round is even, the storeO is written, and the data in the storel must be the state of the previous round. , read data processing from storel; when the token round is odd, write to storel, store0 must be the previous round of state pending data, read data processing from storeO; the EU register unit set Have a biography The channel port receives the token 1 sent by the round update channel switch unit via channel 1, and parses out the token type from: the status token or the key token, the write address and the record data, and writes the record to the corresponding storage In the unit; an output transmission channel port, connected to the channel 2, according to the following Reader address input unit read address, storeO / storel selection signal and state / transformation key selection signal output corresponding state word or transformation key word, Packed together with other control signals as tokens, sent to the following EU operation unit via channel 2; each of the above three temporary storage areas corresponds to a "full/empty" flag bit labeled flag, when the unit writes The incoming flag is set to 1, indicating full. When the data is read, the flag is reset, indicating that it is empty;
ol. 所述的令牌解析方法是:当所述令牌 1的属性域为 0时,是状态字令牌, 写入地址是令牌 1的 column域, 写入记录的第 0行的数据域是令牌 1 数据域的 7至 0位, 第 0行的 color域是令牌 1的 color域, 第 0行的操 作符域是令牌 1的操作符域,写入记录的第 1行到第 3行的数据分别依 次是令牌 1数据域的 15位至 8位、 23位至 16位和 31至 24位; 当所述 令牌 1的属性域为 1时, 是密钥令牌, 令牌 1的数据域复制到所述变换 密钥字存储记录的数据域,令牌 1的 fadd域和操作符域直接复制到所述 变换密钥字存储记录的同名域中; o2. 所述的经通道 2发送的令牌被命名为令牌 2, 它的打包方法是: 当所述 的状态 /变换密钥选择信号等于 0时,令牌 2是状态字令牌,属性域等于 0, 数据域的 7到 0位是地址等于所述的 Matcher I匹配单元输入的读地 址的第 0行记录的数据域, 数据域的 15到 8位是经过 AES算法定义的 行移位运算后的地址等于所述读地址的第 1行记录的数据域,数据域的 23到 16位是经过 AES算法定义的行移位运算后的地址等于所述读地址 的第 2行记录的数据域, 数据域的 31到 24位是经过 AES算法定义的 行移位运算后的地址等于所述读地址的第 3行记录的数据域,令牌 2的 color域和操作符域分别是地址等于所述读地址的第 0行记录的 color域 和操作符域, 令牌 2的 column域是所述读地址的值; 当所述的状态 /变 换密钥选择信号等于 0时, 令牌 2是密钥自令牌, 属性域等于 1, 数据 域是变换密钥存储记录的数据域, fadd域和操作符域分别是变换密钥存 储记录的 fadd域和操作符域; The token resolution method is: when the attribute field of the token 1 is 0, it is a status word token, the write address is a column field of the token 1, and the data of the 0th line of the record is written. The domain is the 7 to 0 bit of the token 1 data field, the color field of the 0th row is the color field of the token 1, the operator field of the 0th row is the operator field of the token 1, and the first row of the record is written. The data to the third row are respectively 15 bits to 8 bits, 23 bits to 16 bits, and 31 to 24 bits of the token 1 data field; when the attribute field of the token 1 is 1, it is a key token. The data field of the token 1 is copied to the data field of the transformed key word storage record, and the fadd field and the operator field of the token 1 are directly copied to the same-named domain of the translation key word storage record; O2. The token sent via channel 2 is named token 2, and its packing method is: when the state/transform key selection signal is equal to 0, token 2 is a state word token, attribute The field is equal to 0, the 7 to 0 bits of the data field are the data fields of the 0th row of the address equal to the read address input by the Matcher I matching unit, and the 15 to 8 bits of the data field are the row shifts defined by the AES algorithm. The calculated address is equal to the data field of the first row of the read address, and the 23 to 16 bits of the data field are the data after the row shift operation defined by the AES algorithm is equal to the data recorded in the second row of the read address. Domain, the 31 to 24 bits of the data field are the data fields of the third row of the read address after the row shift operation defined by the AES algorithm, and the color field and the operator field of the token 2 are equal to the address respectively. The color field and the operator field of the 0th line of the read address, the column field of the token 2 is the value of the read address; when the state/transform key selection signal is equal to 0, the token 2 is The key is from the token, the attribute field is equal to 1, and the data field is the number of the transformed key storage record. Domain, fadd operator domain and transform domain are recorded fadd key storage domain and domain operator;
Matcher I匹配单元, 检查 key store和 storeO/storel中的令牌信息, 在考虑行 移位变换之后发现就绪的状态字或者发现变换密钥则随机选取一个, 把地址 信息送给所述 EU暂存器单元, 并通过 fetch— I信号触发通道 2端口的触发信 号,把所述 EU暂存单元的令牌 2发送给所述 EU运算单元;所述 Matcher I 匹 配单元的输入包括来自所述 EU暂存器单元的观测端口的信号, 通道 2端口 的应答信号以及所述控制选择的随机信号; 同时, 向 EU暂存器单元输出所 述 fetch— I令牌发送信号; The Matcher I matching unit checks the token information in the key store and storeO/storel, finds the ready status word or finds the transformation key after considering the row shift transformation, and randomly selects one, and sends the address information to the EU temporary storage. a unit, and triggering a trigger signal of the channel 2 port by a fetch_I signal, and transmitting the token 2 of the EU temporary storage unit to the EU operation unit; the input of the Matcher I matching unit includes the EU temporary a signal of the observation port of the memory unit, a response signal of the channel 2 port, and the random signal of the control selection; meanwhile, outputting the fetch_I token transmission signal to the EU register unit;
全局存储器, 存储密钥分组列数 Nk, 迭代轮数 Nr, 其中, 向 EU暂存器、 下述 EU运算单元、 Matcher II两个单元和密钥扩展运算单元输出 Nk, 向轮 更新通道开关单元输出 Nr, The global memory stores the key grouping number Nk, the number of iterations Nr, and outputs Nk to the EU register, the following EU operation unit, the Matcher II unit, and the key extension operation unit, and updates the channel switching unit to the wheel. Output Nr,
EU运算单元, 接收来自通道 2的令牌 2, 解析后根据令牌 2的属性域和操作 符域以及所述密钥分组列数 Nk对数据域执行相应的计算, 操作结果打包到 令牌 3的数据域中通过通道 3发送; 其中, 所述令牌 3除数据域外, 还有一 个 1位的属性域, 其值等于所述令牌 2的属性域值: 当属性域等于 0时, 是 状态字令牌, 还有一个 4位的 color域和一个 2位的 column域; 当属性域等 于 1时, 是密钥字令牌, 还有一个 1位的 fadd域, 还有 5位不关心的数据, 打包时, 令牌 2的 fadd域直接复制到令牌 3的 fadd域中; 所述对于令牌数 据域的计算包括:  The EU operation unit receives the token 2 from the channel 2, and after parsing, performs corresponding calculation on the data domain according to the attribute domain and the operator domain of the token 2 and the number of key grouping columns Nk, and the operation result is packaged into the token 3 The data field is sent through channel 3. The token 3 has a 1-bit attribute field in addition to the data field, and its value is equal to the attribute field value of the token 2: when the attribute field is equal to 0, The status word token, there is also a 4-bit color field and a 2-bit column field; when the attribute field is equal to 1, it is a key word token, there is also a 1-bit fadd field, and 5 bits do not care. Data, when packaged, the fadd field of token 2 is directly copied to the fadd field of token 3; the calculation for the token data field includes:
rl. Srd操作, 当令牌 2的属性域等于 0且操作符域为所述的 Srd标记时或 当令牌 2的属性域等于 1且操作符域为 1且所述密钥分组列数 Nk大于 6时执行, 即对数据域的每个字节执行 AES算法定义的 Srd查表操作; 所述令牌 2属性域等于 1且操作符域为 1时的操作即是上述的 g变换在 Nk大于 6时的操作; Rl. Srd operation, when the attribute field of token 2 is equal to 0 and the operator field is the Srd flag or when the attribute field of token 2 is equal to 1 and the operator field is 1 and the key grouping number is Nk Executed when it is greater than 6, that is, the Srd table lookup operation defined by the AES algorithm is performed on each byte of the data field; the operation when the token 2 attribute field is equal to 1 and the operator field is 1 is the g transform described above. Operation when Nk is greater than 6;
r2. Srd-MixCol操作,当令牌 2的属性域等于 0且操作符域为所述的 SM标 记时执行,即先对数据域的每个字节执行 AES算法定义的 Srd查表操作, 再对 4个字节的结果向量左乘一个 4X4的常数矩阵, 其中所述的常数 矩阵为 AES算法中定义的列混合操作对应的常数矩阵; R2. The Srd-MixCol operation is performed when the attribute field of the token 2 is equal to 0 and the operator field is the SM tag, that is, the Srd table lookup operation defined by the AES algorithm is performed on each byte of the data field, and then Multiplying the result vector of 4 bytes by a constant matrix of 4×4, wherein the constant matrix is a constant matrix corresponding to the column mixing operation defined in the AES algorithm;
r3. Srd-循环移位 -轮常量相加计算, 是上述的 f变换当令牌 2的属性域等于 1且所述密钥令牌的操作符域为 0时执行, 即先对数据域的每个字节执 行 AES算法定义的 Srd查表操作, 再将 4个字节的结果循环左移 8位, 最后, 所得结果的低 8位与一个 8位的轮常量 RC逐位异或; 所述轮常 量初值为 0, 每执行一次轮常量加法运算后, 其值乘以 2, 所述乘 2操 作是定义在 GF (28) 域上的; R3. Srd-cyclic shift-round constant addition calculation, which is the above-mentioned f-transformation when the attribute field of token 2 is equal to 1 and the operator field of the key token is 0, that is, the data field first Each byte performs the Srd lookup table operation defined by the AES algorithm, and then shifts the result of 4 bytes to the left by 8 bits. Finally, the lower 8 bits of the obtained result are XORed with an 8-bit round constant RC. The initial value of the round constant is 0. After each round of constant addition, the value is multiplied by 2, and the multiplied 2 operation is defined on the GF (2 8 ) domain;
r4. 直接专发操作, 当令牌 2的属性域等于 1且所述状态令牌的操作符域为 1且 Nk小于等于 6时执行, 即令牌 2的数据域直接复制到所述令牌 3 的数据域;所述令牌 2属性域等于 1且操作符域为 1时的操作即是上述 的 g变换在 Nk下与等于 6时的操作; R4. Direct private operation, when the attribute field of token 2 is equal to 1 and the operator field of the status token is 1 and Nk is less than or equal to 6, that is, the data field of token 2 is directly copied to the token. The data field of 3; the operation when the token 2 attribute field is equal to 1 and the operator field is 1, that is, the operation of the g transform described above under Nk and equal to 6;
Matcher II随机控制码产生电路, 随机产生控制所述 Matcher II匹配单元中仲 裁电路的 3位随机选择码, 每次 fetch— II下降时产生一个新的随机控制码; Matcher I随机控制码产生电路, 随机产生控制所述 Matcher I匹配单元中仲 裁电路的 3位随机选择码, 每次 fetch— I下降时产生一个新的随机控制码; 2.上述的 Matcher II单元与 AK暂存单元构成了 AddKey运算单元的令牌暂存 -匹配 -发射结构, 简称为 HMF结构, Matcher I单元与 EU暂存单元构成了 EU运算单元的 HMF结构, Matcher K与 AK暂存单元的密钥存储区构成了 KeySchedule单元的 HMF结构, Matcher OK与输出暂存单元构成了输出的 HMF结构; 所述 HMF结构具有如下特征: a Matcher II random control code generating circuit randomly generates a 3-bit random selection code for controlling an arbitration circuit in the Matcher II matching unit, and generates a new random control code each time fetch-II falls; a Matcher I random control code generating circuit, Randomly generating a 3-bit random selection code for controlling the arbitration circuit in the Matcher I matching unit, and generating a new random control code each time fetch_I falls; 2. The above-mentioned Matcher II unit and the AK temporary storage unit constitute an AddKey operation The token temporary storage-matching-transmitting structure of the unit, referred to as HMF structure for short, the Matcher I unit and the EU temporary storage unit constitute the HMF structure of the EU operation unit, and the key storage area of the Matcher K and AK temporary storage unit constitutes the KeySchedule unit. The HMF structure, the Matcher OK and the output temporary storage unit constitute an output HMF structure; the HMF structure has the following characteristics:
ill . 包含一个令牌暂存单元, 由寄存器堆实现, 写端口采用异步握手协议; 写地址和写入数据由输入令牌解析得出,写入时钟由输入通道端口的请 求信号触发; 读端口的地址由下述匹配单元输出的选择信号决定, 输出 数据随读地址即时变化; 内部存储单元对应有表示记录是否存在的 "满 /空"标志位,所有单元的满空标志位和记录与下述匹配条件相关的域的 数据组成观测信号, 可被下述匹配单元读取; 所述输出数据可被下述令 牌打包逻辑读取; 所述满空标志位由一个 C单元产生, 该 C单元的一 端接对应记录的写入时钟, 另一输入端接记录的清空信号信号的反信 号;所述各个记录的写入时钟由写端口的接收应答信号经过写地址选择 产生,所述各个记录的清空信号由所述读端口的应答信号经读地址选择 产生; u2. 包含一个匹配单元, 由匹配逻辑和选择逻辑电路两部分组成, 暂存单元 各个记录的观测信号输入匹配逻辑电路中按照匹配条件对应的布尔表 达式算出各自的匹配结果值, 匹配成功则值为 1, 否则等于 0; 每个匹 配结果信号通过一级 C单元输出到所述选择逻辑的输入端成为请求信 号,所述 C单元的另一输入端与所有请求信号的或信号相连, 只有请求 信号全为 0时等于 1的匹配结果才能传递到选择逻辑电路, 当请求信号 中存在有效请求, 即为 1的请求信号, 在它之后产生的成立的匹配结果 就无法通过 C单元; 请求对应的令牌被发送后, 请求复位, C单元对成 立的匹配结果导通;所述 Matcher I和 Matcher II单元的选择逻辑是一个 仲裁逻辑电路, 对每个被检测的令牌组的请求信号进行随机选择, 输出 的是选中请求的序号,并由此产生令牌暂存器的读地址;所述的 Matcher K单元的选择电路是计算匹配成功的请求对应的所述 step信号; 所述 Matcher OK没有选择电路;匹配单元的选择电路输出的请求序号通过锁 存器输出成为令牌的选择信号;根据所述选择信号的选择选择对应的所 述的请求信号成为令牌发射触发信号, 如所述的 fetch— II、 fetch— I、 fetch— K信号; Ill. Contains a token temporary storage unit, implemented by the register file, the write port uses the asynchronous handshake protocol; the write address and write data are parsed by the input token, and the write clock is triggered by the request signal of the input channel port; The address is determined by the selection signal output by the matching unit below, and the output data changes instantaneously with the read address; the internal storage unit corresponds to the "full/empty" flag indicating whether the record exists, the full-empty flag of all units and the record and the lower The data composition observation signal of the matching condition related domain may be read by the following matching unit; the output data may be read by the following token packing logic; the full empty flag bit is generated by a C unit, the C One end of the unit is connected to the write clock corresponding to the record, and the other input end is connected to the reverse signal of the recorded clear signal signal; the write clock of each record is generated by the write response of the write port by the write address, the respective records The clear signal is generated by the read signal of the read port through the read address selection; U2. Contains a matching unit, which is composed of two parts: the matching logic and the selection logic circuit. The observation signal input matching logic of each record of the temporary storage unit calculates the matching result value according to the Boolean expression corresponding to the matching condition, and the matching value is successful. Is 1, otherwise equal to 0; each matching result signal is output to the input of the selection logic through the primary C unit as a request signal, and the other input of the C unit is connected to the OR signal of all request signals, only the request When the signal is all 0, the matching result equal to 1 can be passed to the selection logic circuit. When there is a valid request in the request signal, the request signal is 1, and the established matching result generated after it cannot pass the C unit; After the token is sent, the request is reset, and the C unit turns on the matching result; the selection logic of the Matcher I and Matcher II units is an arbitration logic circuit, and the request signal of each detected token group is randomized. Selecting, outputting the serial number of the selected request, and thereby generating the read address of the token register; said Ma The selection circuit of the tcher K unit is to calculate the step signal corresponding to the request for successful matching; the Matcher OK has no selection circuit; the request sequence output by the selection unit of the matching unit is outputted as a selection signal of the token through the latch; The request signal corresponding to the selection of the selection signal is a token transmission trigger signal, such as the fetch — II, fetch — I, fetch — K signal;
u3. 令牌发射触发信号经过长度等于选择电路输出稳定所需的最长时间的 延时后触发所述选择信号的锁存器的控制端将锁存器锁存, 同时触发发 送令牌的请求信号;所述暂存单元的复位应答信号将所述选择信号的锁 存器的控制端复位, 使锁存器导通, 选择信号重新随所述匹配单元的选 择逻辑电路输出变化。  U3. The token transmitting trigger signal latches the latch by the control terminal of the latch that triggers the selection signal after the delay of the longest time required to stabilize the output of the selection circuit, and triggers the request to transmit the token a reset signal of the temporary storage unit resets a control terminal of the latch of the selection signal to turn on the latch, and the selection signal re-changes with the selection logic of the matching unit.
2、 如权利要求 1所述的乱序执行的数据流 AES加密电路, 其特征在于: 所有传 输通道都采用异步握手协议。  2. The out-of-order data stream AES encryption circuit of claim 1 wherein: all of the transmission channels employ an asynchronous handshake protocol.
3、 如权利要求 1或 2所述的乱序执行的数据流 AES加密电路, 其特征在于: 所 有运算单元的数据处理和令牌打包由组合逻辑电路实现。  3. The out-of-order data stream AES encryption circuit according to claim 1 or 2, characterized in that the data processing and token packing of all the arithmetic units are implemented by a combinational logic circuit.
4、 如权利要求 1或 2所述的乱序执行的数据流 AES加密电路, 其特征在于: 所 述通道开关单元 Switch, 初始密钥寄存器、 AK暂存器单元、 Matcher K匹配单元、 密 钥扩展运算单元共同构成了密钥扩展环,而通道开关单元 Switch、 Matcher II匹配单元、 AddKey运算单元、 轮更新通道开关单元、 EU暂存器单元, Matcher I匹配单元、 EU 运算单元构成轮变换环, 环内用传输通道相连, 环间用开关单元 Switch相连。  4. The out-of-order data stream AES encryption circuit according to claim 1 or 2, wherein: the channel switch unit Switch, an initial key register, an AK register unit, a Matcher K matching unit, a key The extended arithmetic unit together constitutes a key expansion ring, and the channel switch unit Switch, the Matcher II matching unit, the AddKey operation unit, the round update channel switch unit, the EU register unit, the Matcher I matching unit, and the EU operation unit constitute a round conversion loop. The ring is connected by a transmission channel, and the ring is connected by a switch unit Switch.
5、 如权利要求 3所述的乱序执行的数据流 AES加密电路, 其特征在于: 所述通 道开关单元 Switch, 初始密钥寄存器、 AK暂存器单元、 Matcher K匹配单元、 密钥扩 展运算单元共同构成了密钥扩展环, 而通道开关单元 Switch、 Matcher II匹配单元、 AddKey运算单元、 轮更新通道开关单元、 EU暂存器单元, Matcher I匹配单元、 EU 运算单元构成轮变换环, 环内用传输通道相连, 环间用开关单元 Switch相连。  5. The out-of-order data stream AES encryption circuit according to claim 3, wherein: said channel switch unit Switch, initial key register, AK register unit, Matcher K matching unit, key expansion operation The units together form a key expansion ring, and the channel switch unit Switch, the Matcher II matching unit, the AddKey operation unit, the round update channel switch unit, the EU register unit, the Matcher I matching unit, and the EU operation unit form a round conversion loop, and the ring The internal transmission channels are connected, and the rings are connected by a switch unit Switch.
PCT/CN2006/003151 2006-11-23 2006-11-23 Aes encryption circuit for data stream executed in desequencing WO2008061395A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2006/003151 WO2008061395A1 (en) 2006-11-23 2006-11-23 Aes encryption circuit for data stream executed in desequencing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2006/003151 WO2008061395A1 (en) 2006-11-23 2006-11-23 Aes encryption circuit for data stream executed in desequencing

Publications (1)

Publication Number Publication Date
WO2008061395A1 true WO2008061395A1 (en) 2008-05-29

Family

ID=39429362

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2006/003151 WO2008061395A1 (en) 2006-11-23 2006-11-23 Aes encryption circuit for data stream executed in desequencing

Country Status (1)

Country Link
WO (1) WO2008061395A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106027222A (en) * 2016-06-30 2016-10-12 中国南方电网有限责任公司电网技术研究中心 Smart card encryption method and device for preventing differential power analysis
CN109039608A (en) * 2018-08-24 2018-12-18 东南大学 A kind of 8-bitAES circuit based on double S cores
CN113849867A (en) * 2021-08-31 2021-12-28 浪潮电子信息产业股份有限公司 Encryption chip
CN114615069A (en) * 2022-03-19 2022-06-10 山东大学 Quartet lightweight encryption algorithm implementation device and method
CN117061092A (en) * 2023-10-12 2023-11-14 仰恩大学 Reversible circuit construction method of Simon encryption algorithm

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1672352A (en) * 2002-05-23 2005-09-21 爱特梅尔股份有限公司 Advanced encryption standard (AES) hardware cryptographic engine
CN1728634A (en) * 2004-06-19 2006-02-01 三星电子株式会社 The method and apparatus that multiplies each other in the Galois Field and invert equipment and byte replacement equipment
CN1761185A (en) * 2005-11-18 2006-04-19 清华大学 AES encrypted circuit structure for data stream executed in desequencing
US20060126843A1 (en) * 2004-12-09 2006-06-15 Brickell Ernie F Method and apparatus for increasing the speed of cryptographic processing
CN1833399A (en) * 2003-06-16 2006-09-13 韩国电子通信研究院 Rijndael block cipher apparatus and encryption/decryption method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1672352A (en) * 2002-05-23 2005-09-21 爱特梅尔股份有限公司 Advanced encryption standard (AES) hardware cryptographic engine
CN1833399A (en) * 2003-06-16 2006-09-13 韩国电子通信研究院 Rijndael block cipher apparatus and encryption/decryption method thereof
CN1728634A (en) * 2004-06-19 2006-02-01 三星电子株式会社 The method and apparatus that multiplies each other in the Galois Field and invert equipment and byte replacement equipment
US20060126843A1 (en) * 2004-12-09 2006-06-15 Brickell Ernie F Method and apparatus for increasing the speed of cryptographic processing
CN1761185A (en) * 2005-11-18 2006-04-19 清华大学 AES encrypted circuit structure for data stream executed in desequencing

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106027222A (en) * 2016-06-30 2016-10-12 中国南方电网有限责任公司电网技术研究中心 Smart card encryption method and device for preventing differential power analysis
CN106027222B (en) * 2016-06-30 2022-10-28 南方电网科学研究院有限责任公司 Smart card encryption method and device for preventing differential power analysis
CN109039608A (en) * 2018-08-24 2018-12-18 东南大学 A kind of 8-bitAES circuit based on double S cores
CN113849867A (en) * 2021-08-31 2021-12-28 浪潮电子信息产业股份有限公司 Encryption chip
CN113849867B (en) * 2021-08-31 2024-02-23 浪潮电子信息产业股份有限公司 Encryption chip
CN114615069A (en) * 2022-03-19 2022-06-10 山东大学 Quartet lightweight encryption algorithm implementation device and method
CN114615069B (en) * 2022-03-19 2022-11-04 山东大学 Quartet lightweight encryption algorithm implementation device and method
CN117061092A (en) * 2023-10-12 2023-11-14 仰恩大学 Reversible circuit construction method of Simon encryption algorithm
CN117061092B (en) * 2023-10-12 2023-12-15 仰恩大学 Reversible circuit construction method of Simon encryption algorithm

Similar Documents

Publication Publication Date Title
CN1761185B (en) AES encrypted circuit structure for data stream executed in desequencing
Shahbazi et al. Area-efficient nano-AES implementation for Internet-of-Things devices
Hell et al. Grain: a stream cipher for constrained environments
US8301905B2 (en) System and method for encrypting data
CN107800532A (en) Inexpensive cryptography accelerators
Sen et al. Cellular automata based cryptosystem (CAC)
WO2008061395A1 (en) Aes encryption circuit for data stream executed in desequencing
Paar et al. Stream ciphers
ES2295007T3 (en) PROCEDURE OF CONTRAMEDIDA IN AN ELECTRONIC COMPONENT THAT USES A CRYPTOGRAPH ALRITM WITH SECRET KEY.
Reis et al. IMCRYPTO: an in-memory computing fabric for AES encryption and decryption
Joshi et al. Implementation of S-Box for advanced encryption standard
TW200411593A (en) Method and apparatus for protecting public key schemes from timing, power and fault attacks
Ajmi et al. Efficient and lightweight in-memory computing architecture for hardware security
JP2004054128A (en) Encrypting system
Gueron et al. Hardware implementation of AES using area-optimal polynomials for composite-field representation GF (2^ 4)^ 2 of GF (2^ 8)
Abd Zaid et al. Modification advanced encryption standard for design lightweight algorithms
Kaur et al. Efficient implementation of AES algorithm in FPGA device
Aumasson et al. Heavy Quark for secure AEAD
Lee et al. Lightweight and low-latency AES accelerator using shared SRAM
Rachh et al. Efficient implementations of S-box and inverse S-box for AES algorithm
Purohit et al. FPGA Implementation of the AES Algorithm with Lightweight LFSR-Based Approach and Optimized Key Expansion
Diedrich et al. Comparison of Lightweight Stream Ciphers: MICKEY 2.0, WG-8, Grain and Trivium
Banik et al. On design of robust lightweight stream cipher with short internal state
Jeon One-way hash function based on cellular automata
US20140362986A1 (en) Parameterized random data generator providing a sequence of bytes with uniform statistical distribution

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 06817881

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 06817881

Country of ref document: EP

Kind code of ref document: A1