# US 2019/0245679 A1 · Unified hardware accelerator for symmetric-key ciphers

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2019/0245679 A1
- Document ID: US20190245679A1
- Status: Published application
- Kind: A1
- Application number: 15/887,290
- Filed: 2018-02-02
- Published: 2019-08-08
- Earliest claimed: 2018-02-02
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Vikram B. Suresh; Sanu K. Matthew; Sudhir K. Satpathy; Vinodh Gopal
- Web page: https://patentgrep.com/patent/US20190245679A1

## CPC

- H04L 9/0631: {Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms}
- G09C 1/00: Apparatus or methods whereby a given sequence of signs, e.g. an intelligible text, is transformed into an unintelligible sequence of signs by transposing the signs or groups of signs or by replacing them by others according to a predetermined system (cryptographic typewriters G09C3/00)
- G06F 17/16: Matrix or vector computation {, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization (matrix transposition G06F7/78)}
- H04L 2209/125: Parallelization or pipelining, e.g. for accelerating processing of cryptographic operations
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G09C: CIPHERING OR DECIPHERING APPARATUS FOR CRYPTOGRAPHIC OR OTHER PURPOSES INVOLVING THE NEED FOR SECRECY
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Modifications to Advanced Encryption Standard (AES) hardware acceleration circuitry are described to allow hardware acceleration of the key operations of any non-AES block cipher, such as SMT and Camellia. In some embodiments the GF(28) inverse computation circuit in the AES S-box is used to compute X−1 (where X is the input plaintext or ciphertext byte), and hardware support is added to compute parallel GF(28) matrix multiplications. The embodiments described herein have minimal hardware overhead while achieving greater speed than software implementations.

## Claims

### Claim 1

An apparatus for a cryptographic hardware accelerator, comprising:
An Advanced Encryption Standard (AES) substitution box (S-box) for an AES encryption cipher, wherein the AES S-box is to perform an inversion followed by an AES affine transformation on input vectors, wherein the AES affine transformation uses a mapping matrix and translation vector as specified by the AES;
non-AES affine transformation circuitry for non-AES ciphers to perform affine transformations on 8-bit input vectors using variable mapping and translation functions; and,
circuitry to perform an S-box function for non-AES ciphers that includes circuitry to: pass 8-bit input vectors to: the non-AES affine transformation circuitry having the mapping function to include multiplication by a matrix AS1 and a translation function to include addition of a vector bS1, pass the result of the affine transformation to the AES S-box and bypass the AES affine transformation so as to only perform an inversion, and pass the result of the S-box inversion to the non-AES affine transformation circuitry having the mapping function to include multiplication by a matrix AS2 and the translation function to include addition of a vector bS2.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein:
affine transformations for the non-AES cipher are defined as being performed in a Galois extension field denoted as GFS(28) that is generated from GF(2) by a specified field polynomial S(x) of degree 8;
the AES S-box is to perform the inversion operation in a composite Galois field denoted as GFC((24)2) that is generated by a specified field polynomial P(x) of degree 2 from a ground field GFC(24) that is generated by a specified field polynomial R(x) of degree 4 from GF(2); and,
the non-AES affine transformation circuitry's mapping function includes multiplication by a matrix MS that maps vectors from GFS(28) to GFC((24)2) before inversion by the S-box and that includes multiplication by a matrix MS−1 that maps vectors from GFC((24)2) to GFS(28) after inversion by the S-box.

### Claim 3 (depends on 2)

The apparatus of claim 2 wherein:
affine transformations for the AES cipher are defined as being performed in a Galois extension field denoted as GFAE(28), wherein the GFAE(28) field is generated from a Galois field GF(2) by a specified field polynomial AE(x) of degree 8 where AE(x)=(x8+x4+x3+x+1);
the S-box is further to map vectors from the GFAE(28) field to the GFC((24)2) field by multiplication in GF(2) with a matrix MA before inversion and to map the inverted vectors back from GFC((24)2) to GFAE(28) with a matrix MA−1 after inversion; and,
the non-AES affine transformation circuitry's mapping function includes multiplication by the matrix MA31 1 before inversion by the S-box and includes multiplication by the matrix MA after inversion by the S-box.

### Claim 4 (depends on 3)

The apparatus of claim 3 further comprising:
a shift rows circuit, a mix column circuit, and a key addition circuit to perform encryption/decryption in accordance with the AES cipher; and
wherein the circuitry to perform an S-box function for the non-AES cipher circuitry includes circuitry to bypass the shift rows circuit, mix column circuit, and key addition circuit.

### Claim 5 (depends on 3)

The apparatus of claim 3 further comprising:
an AES encryption pathway through the AES S-box that includes a first encryption operation that multiplies an input vector by the matrix MA, a second encryption operation that inverts the result, and a third encryption operation that performs the AES affine transformation followed by multiplication with the matrix MA−1;
an AES decryption pathway through the S-box that includes a first decryption operation that multiplies an input vector by the matrix MA followed by AES inverse affine transformation, a second decryption operation that inverts the result, and a third decryption operation that performs multiplication by the matrix MA−1;
wherein the circuitry to perform an S-box function for the non-AES cipher, in order to bypass the AES transformation and the AES inverse transformation of the AES S-box, includes a pathway through the S-box that includes the first encryption operation, the second encryption or decryption operation, and the third decryption operation.

### Claim 6 (depends on 3)

The apparatus of claim 3 wherein:
the non-AES affine transformation circuitry's mapping function includes multiplication by the matrix product MSMA−1AS1 and its translation function includes addition of the vector product MSMA−1*b1 before inversion by the S-box; and,
the non-AES affine transformation circuitry's mapping function includes multiplication by the matrix product MAMS−1AS2 and its translation function includes addition of the vector b2 after inversion by the S-box.

### Claim 7 (depends on 2)

The apparatus of claim 2 wherein the non-AES encryption cipher is SM4 where the field polynomial S(x) is:
S(x)=(x8+x7+x6+x5+x4+x2+1).

### Claim 8 (depends on 2)

The apparatus of claim 2 wherein the non-AES encryption cipher is Camellia where the field polynomial S(x) is:
S(x)=(x8+x6+x5+x3+1).

### Claim 9 (depends on 1)

The apparatus of claim 1 wherein the apparatus is incorporated into a central processing unit (CPU) accessible by the CPU's instruction set.

### Claim 10

The apparatus of claim I wherein the apparatus is incorporated into a coprocessor or other device to interface to a central processing unit (CPU).

### Claim 11

A method to perform non-Advanced Encryption Standard (AES) cipher operations, comprising:
performing a first non-AES affine transformation on a non-AES cipher input vector, wherein the first non-AES affine transformation is a mapping that includes multiplication by a matrix AS1 and a translation that includes addition of a vector bS1;
passing the input vector after the first non-AES affine transformation to an AES substitution box (S-box) for an AES encryption cipher, wherein the AES S-box performs an inversion followed by an AES affine transformation on input vectors, wherein the AES affine transformation uses a mapping matrix and translation vector as specified by the AES;
bypassing the AES affine transformation of the AES S-box; and,
performing a second non-AES affine transformation on the input vector after inversion by the AES S-box, wherein the second non-AES affine transformation is a mapping that includes multiplication by a matrix AS2 and a translation that includes addition of a vector bS2

### Claim 12 (depends on 11)

The method of claim 11, wherein:
non-AES affine transformations for the non-AES cipher are defined as being performed in a Galois extension field denoted as GFS(28) that is generated from GF(2) by a specified field polynomial S(x) of degree 8;
the AES S-box performs the inversion operation in a composite Galois field denoted as GFC((24)2) that is generated by a specified field polynomial P(x) of degree 2 from a ground field GF(24) that is generated by a specified field polynomial R(x) of degree 4 from GF(2);
the first non-AES affine transformation is a mapping that includes multiplication by matrix MS that maps vectors from GFS(28) to GFC((24)2); and,
the second non-AES affine transformation is a mapping that includes multiplication by a matrix MS−1 that maps vectors from GFC((24)2) to GFS(28).

### Claim 13 (depends on 12)

The method of claim 12 wherein
affine transformations for the AES cipher are defined as being performed in a Galois extension field denoted as GFAE(28), wherein the GFAE(28) field is generated from a Galois field GF(2) by a specified field polynomial AE(x) of degree 8 where AE(x)=(x8+x4+x3+x+1);
wherein the AES S-box maps vectors from the GFAE(28) field to the GFC((24)2) field by multiplication in GF(2) with a matrix MA before inversion and maps the inverted vectors back from GFC((24)2) to GFAE(28) with a matrix MA−1 after inversion;
the first non-AES affine transformation is a mapping that includes multiplication by the matrix MA−1; and,
the second non-AES affine transformation is a mapping that includes multiplication by the matrix MA.

### Claim 14 (depends on 13)

The method of claim 13 wherein the AES acceleration hardware includes a shift rows circuit, a mix column circuit, and a key addition circuit to perform encryption/decryption in accordance with the AES cipher, and further comprising bypassing the shift rows circuit, mix column circuit, and key addition circuit when performing non-AES cipher operations.

### Claim 15 (depends on 13)

The method of claim 13 wherein:
an AES encryption pathway through the AES S-box includes a first encryption operation that multiplies an input vector by the matrix MA, a second encryption operation that inverts the result, and a third encryption operation that performs the AES affine transformation followed by multiplication with the matrix MA−1;
an AES decryption pathway through the AES S-box includes a first decryption operation that multiplies an input vector by the matrix MA followed by AES inverse affine transformation, a second decryption operation that inverts the result, and a third decryption operation that performs multiplication by the matrix MA−1; and,
further comprising bypassing the AES affine transformation and the AES inverse transformation of the S-box by traversing a pathway through the S-box that includes the first encryption operation, the second encryption or decryption operation, and the third decryption operation.

### Claim 16 (depends on 13)

The method of claim 13 further comprising:
performing the first non-AES affine transformation with a mapping function that includes multiplication by the matrix product MSMA−1AS1 and with a translation function that includes addition of the vector product MSMA−1*b1; and,
performing the second non-AES affine transformation with a mapping function that includes multiplication by the matrix product MAMS−lAS2 and with a translation function that includes addition of the vector b2 after inversion by the S-box.

### Claim 17 (depends on 12)

The method of claim 12 wherein the non-AES encryption cipher is SM4 where the field polynomial S(x) is:
S(x)=(x8+x7+x6+x5+x4+x2+1).

### Claim 18 (depends on 12)

The method of claim 12 wherein the non-AES encryption cipher is Camellia where the field polynomial S(x) is:
S(x)=(x8+x6+x5+x3+1).

### Claim 19

A computer-readable storage medium comprising instructions to cause processing circuitry having an instruction set for Advanced Encryption Standard (AES) cryptographic hardware acceleration, upon execution of the instructions by the processing circuitry, to:
perform a first non-AES affine transformation on a non-AES cipher input vector, wherein the first non-AES affine transformation is a mapping that includes multiplication by a matrix AS1 and a translation that includes addition of a vector bS1;
pass the input vector after the first non-AES affine transformation to an AES substitution box (S-box) for an AES encryption cipher, wherein the AES S-box performs an inversion followed by an AES affine transformation on input vectors, wherein the AES affine transformation uses a mapping matrix and translation vector as specified by the AES;
bypass the AES affine transformation of the AES S-box; and, perform a second non-AES affine transformation on the input vector after inversion by the AES S-box, wherein the second non-AES affine transformation is a mapping that includes multiplication by a matrix AS2 and a translation that includes addition of a vector bS2.

### Claim 20 (depends on 19)

The medium of claim 19, wherein:
affine transformations for the non-AES cipher are defined as being performed in a Galois extension field denoted as GFS(28) that is generated from GF(2) by a specified field polynomial S(x) of degree 8;
the AES S-box performs the inversion operation in a composite Galois field denoted as GFC((24)2) that is generated by a specified field polynomial P(x) of degree 2 from a ground field GF(24) that is generated by a specified field polynomial R(x) of degree 4 from GF(2);
the first non-AES affine transformation means is a mapping that includes multiplication by a matrix MS that maps vectors from GFS(28) to GFC((24)2); and,
the second non-AES affine transformation means is a mapping that includes multiplication by a matrix MS−1 that maps vectors from GFC((24)2) to GFS(28).

### Claim 21 (depends on 19)

The medium of claim 19 wherein:
affine transformations for the AES cipher are defined as being performed in a Galois extension field denoted as GFAE(28-), wherein the GFAE(28) field is generated from a Galois field GF(2) by a specified field polynomial AE(x) of degree 8 where AE(x)=(x8+x4+x3+x+1);
the AES S-box maps vectors from the GFAE(28) field to the GFC((24)2) field by multiplication in GF(2) with a matrix MA before inversion and maps the inverted vectors back from GFC((24)2) to GFAE(28) with a matrix MA−1 after inversion;
the first non-AES affine transformation is a mapping that includes multiplication by the matrix MA−1; and,
the second non-AES affine transformation is a mapping that includes multiplication by the matrix MA.

### Claim 22 (depends on 19)

The medium of claim 19 further comprising instructions to:
perform the first non-AES affine transformation with a mapping function that includes multiplication by the matrix product MSMA−1AS1 and with a translation function that includes addition of the vector product MSMA−1*b1; and,
perform the second non-AES affine transformation with a mapping function that includes multiplication by the matrix product MAMS−1AS2 and with a translation function that includes addition of the vector b2 after inversion by the S-box.

### Claim 23 (depends on 20)

The medium of claim 20 wherein the non-AES encryption cipher is SM4 where the field polynomial S(x) is:
S(x)=(x8+x7+x6+x5+x4+x2+1).

### Claim 24 (depends on 20)

The medium of claim 20 wherein the non-AES encryption cipher is Camellia where the field polynomial S(x) is:
S(x)=(x8+x6+x5°x3+1).

### Claim 25 (depends on 19)

The medium of claim 19 wherein the processing circuitry is a central processing unit (CPU) having an instruction set for AES hardware acceleration and affine transformations.
