# US 2018/0026782 A1 · Modular exponentiation with transparent side channel attack countermeasures

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

- Number: US 2018/0026782 A1
- Document ID: US20180026782A1
- Status: Published application
- Kind: A1
- Application number: 15/217,760
- Filed: 2016-07-22
- Published: 2018-01-25
- Earliest claimed: 2016-07-22
- Assignees: QUALCOMM Incorporated
- Applicants: QUALCOMM Incorporated
- Inventors: Lu Xiao; Jing Deng; Justin Yongjin Kim
- Web page: https://patentgrep.com/patent/US20180026782A1

## CPC

- H04L 9/002: {Countermeasures against attacks on cryptographic mechanisms (network architectures or network communication protocols for protection against malicious traffic H04L63/1441)}
- G06F 21/75: by inhibiting the analysis of circuitry or operation
- G06F 21/755: {with measures against power attack}
- H04L 9/003: {for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]}
- H04L 9/302: {involving the integer factorization problem, e.g. RSA or quadratic sieve [QS] schemes}
- G06F 7/72: using residue arithmetic
- 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)

## Abstract

A method of implementing security in a modular exponentiation function for cryptographic operations is provided. A key is obtained as a parameter when the modular exponentiation function is invoked. The key may be one of either a public key or a private key of a cryptographic key pair. Within the modular exponentiation function, the method ascertains whether the key is greater than L bits long, where L is a positive integer. A countermeasure against an attack is implemented if the key is greater than L bits long. The countermeasure may include one or more techniques (e.g., hardware and/or software techniques) that inhibit or prevent information about the key from being ascertained through analysis. One or more exponentiation operations may then be performed using the key. The same modular exponentiation function may be used to perform encryption and decryption operations but with different keys.

## Claims

### Claim 1

A method of implementing security in a modular exponentiation function for cryptographic operations, comprising:
obtaining a key as a parameter when the modular exponentiation function is invoked;
ascertaining, within the modular exponentiation function, whether the key is greater than L bits long, where L is a positive integer;
implementing a countermeasure against an attack if the key is greater than L bits long; and
performing one or more exponentiation operations using the key.

### Claim 2 (depends on 1)

The method of claim 1, wherein the key is one of either a public key or a private key of a cryptographic key pair.

### Claim 3 (depends on 1)

The method of claim 1, wherein L=24 bits.

### Claim 4 (depends on 1)

The method of claim 1, wherein the same modular exponentiation function performs encryption and decryption operations but with different keys.

### Claim 5 (depends on 1)

The method of claim 1, wherein the countermeasure include one or more techniques that inhibit or prevent information about the key from being ascertained through analysis.

### Claim 6 (depends on 1)

The method of claim 1, wherein the countermeasure includes cryptographic blinding of the key.

### Claim 7 (depends on 1)

The method of claim 1, wherein implementing the countermeasure includes at least one of:
switching to a power-equalization circuit that utilizes approximately the same amount of power for the one or more exponentiation operations independent of a value of the key,
switching to a time-equalization circuit that takes approximately the same amount of time for the one or more exponentiation operations independent of the value of the key, or
switching to a power-equalization and time-equalization circuit that utilizes approximately the same amount of power and time for the one or more exponentiation operations independent of the value of the key.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
bypassing the countermeasure if the key is less than or equal to L bits long.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
obtaining a data m and a modulus n, wherein the one or more exponentiation operations encrypt the data m to obtain ciphertext c, where c=mkpub modulo n, and kpub=key.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
obtaining a data c and a modulus n, wherein the one or more exponentiation operations decrypt the data c to obtain a data m, where c=mkpub modulo n, and kpub=key.

### Claim 11 (depends on 1)

The method of claim 1, further comprising:
obtaining a message m and a modulus n, and the one or more exponentiation operations sign the message m with a private key kpriv to obtain a signature s, where s=mkpriv modulo n, and kpriv=key.

### Claim 12 (depends on 1)

The method of claim 1, further comprising:
obtaining a signature s and a modulus n, and the one or more exponentiation operations authenticate the signature s with a public key kpub to obtain a message m, where m=skpub modulo n, and kpub=key.

### Claim 13

A machine-readable storage medium having one or more instructions for implementing security in a modular exponentiation function which when executed by at least one processing circuit causes the at least one processing circuit to:
obtain a key as a parameter when the modular exponentiation function is invoked;
ascertain, within the modular exponentiation function, whether the key is greater than L bits long, where L is a positive integer;
implement a countermeasure against an attack if the key is greater than L bits long; and
perform one or more exponentiation operations using the key.

### Claim 14 (depends on 13)

The machine-readable storage medium of claim 13, wherein the key is one of either a public key or a private key of a cryptographic key pair.

### Claim 15 (depends on 13)

The machine-readable storage medium of claim 13, wherein the same modular exponentiation function performs encryption and decryption operations but with different keys.

### Claim 16 (depends on 13)

The machine-readable storage medium of claim 13, wherein the countermeasure includes one or more techniques that inhibit or prevent information about the key from being ascertained through analysis.

### Claim 17 (depends on 13)

The machine-readable storage medium of claim 13, wherein the countermeasure includes cryptographic blinding of the key.

### Claim 18 (depends on 13)

The machine-readable storage medium of claim 13, wherein implementing the countermeasure includes at least one of:
switch to a power-equalization circuit that utilizes approximately the same amount of power for the one or more exponentiation operations independent of a value of the key,
switch to a time-equalization circuit that takes approximately the same amount of time for the one or more exponentiation operations independent of the value of the key, or
switch to a power-equalization and time-equalization circuit that utilizes approximately the same amount of power and time for the one or more exponentiation operations independent of the value of the key.

### Claim 19 (depends on 13)

The machine-readable storage medium of claim 13, further having one or more instructions which when executed by at least one processing circuit causes the at least one processing circuit to:
bypass the countermeasure if the key is less than or equal to L bits long.

### Claim 20

A device comprising:
means for obtaining a key as a parameter when a modular exponentiation function is invoked;
means for ascertaining, within the modular exponentiation function, whether the key is greater than L bits long, where L is a positive integer;
means for implementing a countermeasure against an attack if the key is greater than L bits long; and
means for performing one or more exponentiation operations using the key.

### Claim 21 (depends on 20)

The device of claim 20, wherein the means for implementing the countermeasure includes at least one of:
means for switching to a power-equalization circuit that utilizes approximately the same amount of power for the one or more exponentiation operations independent of a value of the key,
means for switching to a time-equalization circuit that takes approximately the same amount of time for the one or more exponentiation operations independent of the value of the key, or
means for switching to a power-equalization and time-equalization circuit that utilizes approximately the same amount of power and time for the one or more exponentiation operations independent of the value of the key.

### Claim 22

A modular exponentiation circuit, comprising:
a register to obtain a key as a parameter when a modular exponentiation operation is invoked; and
a processing circuit coupled to the register, the processing circuit configured to
ascertain whether the key is greater than L bits long, where L is a positive integer,
implement a countermeasure against an attack if the key is greater than L bits long, and
perform one or more exponentiation operations using the key.

### Claim 23 (depends on 22)

The modular exponentiation circuit of claim 22, wherein the processing circuit implements the countermeasure if the key is greater than L bits long, otherwise the one or more exponentiation operations bypass the countermeasure.

### Claim 24 (depends on 22)

The modular exponentiation circuit of claim 22, wherein the processing circuit is configured to implement the countermeasure by applying cryptographic blinding to the key.

### Claim 25 (depends on 22)

The modular exponentiation circuit of claim 22, wherein the processing circuit includes at least one of:
a power-equalization circuit that utilizes approximately the same amount of power for the one or more exponentiation operations independent of a value of the key,
a time-equalization circuit that takes approximately the same amount of time for the one or more exponentiation operations independent of the value of the key, or
a power-equalization and time-equalization circuit that utilizes approximately the same amount of power and time for the one or more exponentiation operations independent of the value of the key.
