# US 2019/0379526 A1 · Protection of an iterative calculation

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

- Number: US 2019/0379526 A1
- Document ID: US20190379526A1
- Status: Published application
- Kind: A1
- Application number: 16/435,309
- Filed: 2019-06-07
- Published: 2019-12-12
- Earliest claimed: 2018-06-08
- Assignees: STMicroelectronics (Rousset) SAS
- Applicants: Stmicroelectronics (Rousset) SAS
- Inventors: Ibrahima DIOP; Yanis LINGE
- Web page: https://patentgrep.com/patent/US20190379526A1

## CPC

- H04L 9/002: {Countermeasures against attacks on cryptographic mechanisms (network architectures or network communication protocols for protection against malicious traffic H04L63/1441)}
- H04L 9/003: {for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]}
- G06F 21/72: in cryptographic circuits
- 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)
- H04L 9/004: {for fault attacks}
- G06F 7/723: {Modular exponentiation (G06F7/724, G06F7/727, G06F7/728 take precedence)}
- H04L 9/302: {involving the integer factorization problem, e.g. RSA or quadratic sieve [QS] schemes}
- H04L 9/3066: {involving algebraic varieties, e.g. elliptic or hyper-elliptic curves}
- H04L 2209/12: Details relating to cryptographic hardware or logic circuitry
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G09C: CIPHERING OR DECIPHERING APPARATUS FOR CRYPTOGRAPHIC OR OTHER PURPOSES INVOLVING THE NEED FOR SECRECY

## Abstract

The disclosure concerns a method of protecting a calculation on a first number and a second number, including the steps of: generating a third number including at least the bits of the second number, the number of bits of the third number being an integer multiple of a fourth number; dividing the third number into blocks each having the size of the fourth number; successively, for each block of the third number: performing a first operation with a first operator on the contents of a first register and of a second register, and then on the obtained intermediate result and the first number, and placing the result in a third register; and for each bit of the current block, performing a second operation by submitting the content of the third register to a second operator with a function of the rank of the current bit of the third number, and then to the first operator with the content of the first or of the second register according to state “0” or “1” of said bit, and placing the result in the first or second register.

## Claims

### Claim 1

A method, comprising:
performing, using an electronic circuit, a calculation on a first number and a second number; and
protecting the performing of the calculation, wherein the method includes:
generating a third number comprising at least the bits of the second number, a number of bits of the third number being an integer multiple of a fourth number;
dividing the third number into blocks each having a size in bits of the fourth number; and
successively, for each block of the third number:
performing a first function, the first function using a first operator and having as inputs: contents of a first register, contents of a second register and the first number, and placing a result of the first function in a third register; and
for each bit of the current block,
performing a second function, the second function using a second operator and having as inputs:
contents of the third register;
a rank of a current bit of the third number; and
the contents of a selected one of the first and the second register according to a state of said current bit; and
placing a result of the second function in the selected one of the first and second register.

### Claim 2 (depends on 1)

The method of claim 1 wherein said second function includes raising of number 2 to a power of the rank of the current bit of the third number.

### Claim 3 (depends on 1)

The method of claim 1, comprising generating the third number by concatenation of the bits of the second number and of states “0”.

### Claim 4 (depends on 1)

The method of claim 1 wherein the second register contains the result of the calculation.

### Claim 5 (depends on 1)

The method of claim 1 wherein the first and second registers are initialized with a neutral element of the first operator of the first function.

### Claim 6 (depends on 1)

The method of claim 1 wherein the first and second functions are performed modulo a fifth number.

### Claim 7 (depends on 1)

The method of claim 1, comprising comparing a final content of the third register with a result of a third function performed on the first number and number 2 raised to a power of a number of bits of the second number.

### Claim 8 (depends on 1)

The method of claim 1 wherein an index of the bits of each block increases from 0 to a value of the fourth number minus 1.

### Claim 9 (depends on 1)

The method of claim 1 wherein bits of a same block are processed in a random order.

### Claim 10 (depends on 1)

The method of claim 1 wherein bits of a same block are successively processed.

### Claim 11 (depends on 1)

The method of claim 1 wherein an order of the processing of bits of a same block results from a permutation.

### Claim 12 (depends on 1)

The method of claim 1 wherein the calculation is a modular exponentiation of the first number by the second number.

### Claim 13 (depends on 12)

The method of claim 12 wherein the first operator is multiplication and the second operator is raising to a power.

### Claim 14 (depends on 1)

The method of claim 1 wherein the calculation is a multiplication of a point of an elliptic curve by a scalar.

### Claim 15 (depends on 14)

The method of claim 14 wherein the first operator is addition and the second operator is multiplication.

### Claim 16

A device, comprising:
a memory including a plurality of registers; and
cryptographic circuitry coupled to the memory, wherein the cryptographic circuitry, in operation, performs a calculation on a first number and a second number, wherein the performing the calculation includes:
generating a third number comprising at least the bits of the second number, a number of bits of the third number being an integer multiple of a fourth number;
dividing the third number into blocks each having a size in bits of the fourth number; and
successively, for each block of the third number:
performing a first function, the first function using a first operator and having as inputs: contents of a first register of the memory, contents of a second register of the memory and the first number, and placing a result of the first function in a third register of the memory; and
for each bit of the current block,
performing a second function, the second function using a second operator and having as inputs:
contents of the third register;
a rank of a current bit of the third number; and
the contents of a selected one of the first and the second register according to a state of said current bit; and
placing a result of the second function in the selected one of the first and second register.

### Claim 17 (depends on 16)

The device of claim 16 wherein said second function includes raising of number 2 to a power of the rank of the current bit of the third number.

### Claim 18 (depends on 16)

The device of claim 16 wherein the cryptographic circuitry generates the third number by concatenating bits of the second number and states “0”.

### Claim 19 (depends on 16)

The device of claim 16 wherein the second register contains the result of the calculation.

### Claim 20 (depends on 16)

The device of claim 16 wherein the first and second registers are initialized with a neutral element of the first operator of the first function.

### Claim 21 (depends on 16)

The device of claim 16 wherein the first and second functions are performed modulo a fifth number.

### Claim 22 (depends on 16)

The device of claim 16 wherein the cryptographic circuitry, in operation:
performs a third function on the first number and number 2 raised to a power of a number of bits of the second number; and
compares a result of the third function to contents of the third register.

### Claim 23 (depends on 16)

The device of claim 16 wherein an order of processing of bits of a block is based on a permutation.

### Claim 24 (depends on 16)

The device of claim 16 wherein the calculation is a modular exponentiation of the first number by the second number.

### Claim 25 (depends on 16)

The device of claim 16 wherein the calculation is a multiplication of a point of an elliptic curve by a scalar.

### Claim 26

A non-transitory computer-readable medium having contents which cause cryptographic circuitry to perform a calculation on a first number and a second number, wherein the performing the calculation includes:
generating a third number comprising at least the bits of the second number, a number of bits of the third number being an integer multiple of a fourth number;
dividing the third number into blocks each having a size in bits of the fourth number; and
successively, for each block of the third number:
performing a first function, the first function using a first operator and having as inputs: contents of a first register of the memory, contents of a second register of the memory and the first number, and placing a result of the first function in a third register of the memory; and
for each bit of the current block,
performing a second function, the second function using a second operator and having as inputs:
contents of the third register;
a rank of a current bit of the third number; and
the contents of a selected one of the first and the second register according to a state of said current bit; and
placing a result of the second function in the selected one of the first and second register.

### Claim 27 (depends on 26)

The non-transitory computer-readable medium of claim 26 wherein the contents comprise instructions which, when executed, cause the cryptographic circuitry to perform the calculation.

### Claim 28 (depends on 26)

The non-transitory computer-readable medium of claim 26 wherein the first and second functions are performed modulo a fifth number.
