Method for performing cryptographic operations on data in a processing device, corresponding processing device and computer program product

By randomizing the values ​​of projection format coordinates in elliptic curve cryptography in processing equipment, the problem of side channel attack in asymmetric cryptography is solved, and the security improvement of fast and low computing costs is achieved.

CN113141255BActive Publication Date: 2025-01-10STMICROELECTRONICS SRL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110063631.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-01-17
Filing Date
2021-01-18
Publication Date
2025-01-10
Estimated Expiration
2041-01-18

AI Technical Summary

Technical Problem

In asymmetric cryptography, especially elliptic curve cryptography, side channel attack poses a threat to the security of processing equipment, and the prior art randomization methods are computationally cost-effective and inefficient, making it difficult to effectively defend against horizontal attacks.

Method used

The value of the projection format coordinates is randomized in the processing device, and the value of the projection format coordinates is multiplied by a random value to randomize it. The specific method includes using an integer random generation function to generate a random value and equate it to greater than Multiply the word length values ​​to achieve fast and low computational randomization operations.

Benefits of technology

It effectively reduces computing costs, improves the security of anti-side channel attacks, reduces the possibility of attackers identifying key patterns, and improves the security of processing devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113141255B_ABST
    Figure CN113141255B_ABST
Patent Text Reader

Abstract

A scalar multiplication operation comprises: an iterative process of performing a set of operations on a bit or a group of consecutive bits of a secret key at each iteration. The multiplication operation comprises multiplying the value of a projection format coordinate by a random value. The random value is the product of a random number generated over a range having a first value as an end value and a second value greater than the first value. The first value is the word length of 2 multiplied by a multiplier value to the power minus one. The second value is equal to the number of bits of the coordinate to the power of 2 divided by the first value. The multiplier value is an integer greater than or equal to one and less than the ratio of the number of bits to the word length.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present description relates to techniques for methods of performing cryptographic operations on data in a processing device operating with a given word length.

[0002] For example, the described embodiments may be directed to an asymmetric cryptographic process operating over a finite field of a given order using ECC (Elliptic Curve Cryptography), such as implementing point multiplication via a Montgomery ladder.

[0003] Various embodiments may be applied to, for example, smart cards, microcontrollers, set-top boxes using encryption or digital signature schemes. Background Art

[0004] Description of the Prior Art

[0005] Cryptographic protocols or encryption protocols are abstract or concrete protocols that perform security-related functions and apply cryptographic methods, usually as a sequence of cryptographic primitives.

[0006] In the field of protection against side channel attacks in devices using cryptographic algorithms, such as microcontrollers implementing cryptographic algorithms such as ECC or RSA, vertical side channel attacks (SCA) are known, in which an attacker can use the device to encrypt arbitrary data (input) in order to obtain the cryptographic key used by the cryptographic algorithm. The attacker records side channel information during the encryption of known input data, the side channel being represented by power consumption, electromagnetic radiation or other similar quantities.

[0007] The side channel is linked to the data processed by the device, which are the cryptographic keys, and the attacker's data that is fed as input, so it represents known data.

[0008] The attacker records many "traces" with different known input data and a constant unknown key, makes an assumption about the value of a portion of the cryptographic key, and uses statistical methods to verify such assumptions using the traces. In order to apply such statistical methods, the attacker needs to use many traces, each with different known input data and a constant key.

[0009] However, in asymmetric cryptography, there is a mathematical way to modify the secret key for each execution so that the result of the operation does not change, even though the data used during the calculation changes. Therefore, since the key is no longer constant, the attacker cannot collect many traces.

[0010] To do this, attackers deploy so-called horizontal attacks when they need to work on a single trace.

[0011] In the device to be protected (e.g. a processing unit or a microcontroller), there are usually memories, controllers, the memories storing input / output data and intermediate values, controllers that read words from RAM memory and store them in registers, and then "call" multipliers on registers (e.g. a multiplier unit or circuit that performs a multiplication operation on operands stored in registers). The multiplier multiplies the operands and writes the result to the RAM memory. In such a case, more than 95% of the calculations are done in the multiplier.

[0012] Regarding this, Figure 1 1 shows a processing unit or core 10, which includes a controller unit or circuit 11, which reads the data stored in memory 13 (such as RAM memory) Figure 1 The controller 11 receives the words indicated by a and b in the registers provided in the controller 11 and then calls the multiplier circuit 12 on the contents of the registers (words a, b). The multiplier 12 performs a multiplication operation on the operands a, b stored in the registers of the controller 11. The multiplier 12 multiplies the operands, for example, performs a modulo n multiplication R=a·b mod n, and writes the result R to the RAM memory 13.

[0013] Referring to a conventional processing device architecture, the controller 11 and the multiplier 12 may correspond to a control circuit and an ALU of a processing circuit such as a CPU, while the memory 13 may be located externally relative to the processing device 10 .

[0014] In asymmetric cryptography, for example, RSA (Rivest-Shamir-Adleman) cryptography involving a multiplication cycle implementing modular exponentiation or ECC (Elliptic Curve Cryptography) involving a multiplication cycle implementing elliptic curve scalar multiplication can be used.

[0015] In ECC cryptography, a main loop is implemented that implements iterative point multiplication of an operand corresponding to a point P with a secret key k to obtain kP, for example as shown in the following set of instructions (1), representing each secret key k bit or a group of bits k i Iterations:

[0016] L1. If k i =0:

[0017] L2.Q1=Add(Q1,Q0)

[0018] L3.Q0=Double(Q0)

[0019] L4. Otherwise:

[0020] L5.Q0=Add(Q0,Q1)

[0021] L6.Q1=Double(Q1) (1)

[0022] where k i It is the i-th bit or a group of consecutive bits of the secret key k, such as a word, Q0, Q1 are the first loop variable and the second loop variable, respectively, which are assigned to read the value of the point P from the corresponding address in the register of the controller unit 11, for example, Q0 is set to zero value, and Q1=P, Add and Double are summation and multiplication by 2 operations. Q1, Q0 correspond to points expressed in a projection format by homogeneous coordinates (X, Y, Z), where point (x, y)=X / Z, Y / Z. Q0 is set to zero value, which represents the infinite point of the homogeneous coordinates represented by Z=0. At the beginning of the iteration, Q0 is set to zero value, and Q1=P, and then they take different values ​​during different iterations depending on the bits of the secret key k. The set of operations L1-L6 is also called the Montgomery ladder, and can be used to implement modular exponentiation or scalar multiplication. The Montgomery ladder can be beneficial when timing is exposed to an attacker performing a side channel attack.

[0023] Other projection formats can be, for example, (x, y) = X / Z 2 , Y / Z 3 or another format, the solution described here is adaptable to different formats with an appropriate number of multiplications. For example, if the projection format is (x, y) = X / Z 2 , Y / Z 3 , then the randomization can be

[0024] X=((X*r)mod N)*r mod N

[0025] Y=(((Y*r)mod N)*r mod N)*r mod N

[0026] Z=Z*r mod N

[0027] Where N is the order or size of the finite field over which elliptic curve cryptography is implemented.

[0028] The main loop (1) of the point multiplication thus consists of:

[0029] For each bit or groups of consecutive bits k of the secret key k i , for example, each i-th bit k i :

[0030] If such a bit k iis zero, the second loop variable Q1 written to the same address of the controller 11 register corresponding to the operand variable is set equal to the sum of the two variables Q1 and Q0, and the first variable Q0 is multiplied by two,

[0031] Otherwise, the first variable Q0 is equal to the sum of the two variables Q1, Q0, and the second variable Q1 is multiplied by two.

[0032] Three families of horizontal attacks are commonly identified:

[0033] Attacks on Secret Bit Manipulation

[0034] Attacks on addresses

[0035] Attacks on data

[0036] Specifically, with respect to attacks on data, such attacks may be performed based on input and output values ​​of two iterations.

[0037] For example, in the case of ECC, if the output of the Double operation at iteration i is used as the input of the Double operation at step i+1, then k i =k i+1 , and the attacker can recognize the pattern.

[0038] A known solution involves, at each iteration i, for example, for each bit k of the secret key k i , randomizing the values ​​X, Y, Z of the projection format coordinates representing the first variable Q0 and the second variable Q1 by multiplying such values ​​X, Y, Z of the projection format coordinates by a random value, defining the order or size of the finite field using Montgomery multiplication with a given modulus value N (such modulus value N is represented by a number of bits n, which is usually equal to the bit length l of the operand), the point of the ECC cryptography is expressed in the projection format.

[0039] For example, it is a random integer r generated by the integer random generator function randint(sv,ev) (known in Python, Java or Matlab) over the range from a given starting value sv (e.g. 1) to an ending value ev of N-1, N being a value defining the order of the finite field used to represent the operands. Thus, the order N can be, for example, 2 256 -2 224 +2 192 +2 96 -1, which is a prime number. For efficiency, N can be chosen as a prime number close to a multiple of the word, slightly less than 2 m*WS , WS is the word length and m is a multiple value, but it can also be smaller.

[0040] r = randint(1, N-1)

[0041] The integer random generation function randint is an example of an operation that includes obtaining random bits from a TRNG (True Random Number Generator) or a CSPRNG (Cryptographically Strong Pseudo Random Number Generator).

[0042] Each new homogeneous coordinate nX, nY, NZ is obtained by multiplying the value X, Y, Z of the current projection format coordinate by a random value r using a multiplication with a given modulus value p using the Montgomery multiplication process:

[0043] nX=X*r mod N

[0044] nY=Y*r mod N

[0045] nZ=Z*r mod N

[0046] For the point (x, y) x = nX / nZ = X*r / Z*r = X / Z, the result is still correct

[0047] Such an approach can be used, but the randomization operation must be fast relative to modular multiplication.

[0048] Moreover, even if the randomization operation is designed to be fast enough, the form of Montgomery multiplication has another inconvenience:

[0049]

[0050] Where a is a common first Montgomery operand, such as the coordinates of the first loop variable Q0, b is a common second Montgomery operand, such as the coordinates of the second loop variable Q1, and N' is an element consisting of a single word. 1 is a given number of bits representing the values ​​of the projected format coordinates X, Y, Z, and is a parameter of the Montgomery multiplication. If it is desired to perform modular multiplication of integers modulo N, the given number of bits 1 is a power of 2 and greater than N.

[0051] The parameter 1 expressed in bits depends on the implementation and complies with the condition l >= bit size (N).

[0052] Assume that a and b are 2 l As the bound, the computational cost is approximately subword multiplication, where WS indicates the system word length. Even if the value of the second operand b is small, the value (abN′ mod 2 l ) is still a large value, even if the value of b is small, (abN′mod2 l )The computational cost of N is also The sub-word multiplication, because 1> = n, is at least Summary of the invention

[0053] Embodiments may relate to techniques for performing cryptographic operations on data in a processing device operating with a given word length. In one embodiment, an asymmetric cryptographic process operating on a finite field of a given order is applied, the asymmetric cryptographic process comprising performing a scalar multiplication operation between at least one operand representing a curve point expressed by projected format coordinates and a secret key, the scalar multiplication operation comprising: performing an iterative process of a set of operations for each or each group of consecutive bits of the secret key at each iteration, the multiplication process comprising: randomizing, at each iteration, the value of the projected format coordinates representing the at least one operand represented by a given number of bits by multiplying such value of the projected format coordinates by a random value.

[0054] Embodiments may provide a method for performing cryptographic operations on data in a processing device, including performing multiplication operations using randomization of variables, which method addresses the shortcomings of the prior art and is particularly fast and has low computational cost.

[0055] One or more embodiments may relate to a corresponding processing device and a computer program product for performing the method, which can be loaded into the memory of at least one computer and includes a portion of software code capable of performing the steps of the method when the product is run on at least one computer. As used herein, reference to such a computer program product is understood to be equivalent to a reference to a computer-readable component containing instructions for controlling a processing system in order to coordinate the implementation of the method according to the embodiment. The reference to "at least one computer" is obviously intended to emphasize the possibility of implementing the present embodiment in a modular and / or distributed form.

[0056] According to an embodiment of the solution described herein, a method for performing a cryptographic operation on data in a processing device operating with a given word length comprises applying an asymmetric cryptographic process operating on a finite field of a given order, said asymmetric cryptographic process comprising performing a scalar multiplication operation between at least one operand representing a curve point expressed by coordinates in a projected format and a secret key,

[0057] The scalar multiplication operation comprises: an iterative process of performing a set of operations on each bit or each group of consecutive bits of the secret key at each iteration,

[0058] The multiplication process includes: at each iteration, and

[0059] randomizing the value represented by the given number of bits of the projection format coordinates of the at least one operand by multiplying such value of the projection format coordinates by a random value,

[0060] in

[0061] The randomization operation includes obtaining the random value as a product of a randomly generated value and a second value, the randomly generated value being generated over a range having a first given value as an end value, the second value being greater than the first given value, and

[0062] The first given value is 2 raised to the power of the word length or a multiple of the word length minus one, the second value is equal to 2 raised to the power of the given number of bits divided by the first value, and the multiplier value of the word length in the multiple is a small integer, at least less than the ratio of the given number of bits to the word length.

[0063] In a variant embodiment, the upper limit for the multiplier value is 4, specifically the multiplier value in the multiple is 1 or 2.

[0064] In a variant embodiment, the random value is generated as a random value selected within a range having a value one as a starting value.

[0065] In a variant embodiment, the asymmetric cryptographic process is an ECC process, at least one operand is a point on an elliptic curve, and the multiplication operation is an ECC scalar multiplication.

[0066] In a variant embodiment, the set of operations represents Montgomery ladder operations.

[0067] In a variant embodiment, the iterative process includes executing the Montgomery ladder, performing iterative point multiplication of a secret key by at least one operand, allocating a first loop variable and a second loop variable, including executing the Montgomery ladder representing a set of operations, including:

[0068] For each bit of the secret key, if such bit is zero, the second variable is set equal to the sum of the two variables and the first variable is multiplied by two;

[0069] Otherwise, the first variable is equal to the sum of the two variables, and the second variable is multiplied by two; and

[0070] The randomization operation is performed on projection format coordinates expressing the first variable and the second variable.

[0071] In a variant embodiment, the iterative process is performed by dividing the bits of the secret key into a plurality of groups of consecutive bits and comprises performing a set of operations on each group of bits of the secret key at each iteration.

[0072] The described embodiments also relate to embodiments of a processing device configured to perform the steps of the method of any preceding embodiment.

[0073] The embodiments described herein also relate to a computer program product which can be loaded into the memory of at least one computer and comprises a portion of software code capable of performing the steps of the method of any of the preceding embodiments when the product is run on at least one computer.

[0074] In one embodiment, a method includes a method of performing cryptographic operations on data in a processing device that operates with a word length, including applying an asymmetric cryptographic process that operates on a finite field having an order, the asymmetric cryptographic process including performing a scalar multiplication operation between at least one operand representing a curve point expressed by a projected format coordinate and a secret key, the scalar multiplication operation including: performing an iterative process of a set of operations on a bit or a group of consecutive bits of the secret key at each iteration, the multiplication operation including: at each iteration, randomizing the value of the projected format coordinate representing the at least one operand represented by the number of bits by multiplying the value of the projected format coordinate by a random value, wherein randomizing the value includes: generating a random number over a range having a first value as an end value, and multiplying the random number by a second value greater than the first value, the first value being 2 raised to the power of the word length multiplied by a multiplier value minus 1, the second value being equal to 2 raised to the power of the number of bits divided by the first value, the multiplier value being an integer greater than or equal to one and less than the ratio of the number of bits to the word length. In one embodiment, an upper limit for the multiplier value is 4. In one embodiment, the multiplier value is 1 or 2. In one embodiment, the starting value of the range is 1. In one embodiment, the asymmetric cryptographic process is an elliptic curve cryptography (ECC) process, the at least one operand is a point on an elliptic curve, and the multiplication operation is an ECC scalar multiplication. In one embodiment, the set of operations represents a Montgomery ladder. In one embodiment, each iteration of the iterative process is performed on bits of the secret key and includes: if such a bit is zero, setting the second variable equal to the sum of the two variables and multiplying the first variable by two; otherwise, setting the first variable equal to the sum of the two variables and multiplying the second variable by two; and performing the randomization operation on the projected format coordinates expressing the first variable and the second variable. In one embodiment, the iterative process is performed by dividing the bits of the secret key into multiple groups of consecutive bits, and includes performing the set of operations on a group of bits of the secret key at each iteration.

[0075] In one embodiment, a device includes: a memory; and a cryptographic circuit device having a word length and coupled to the memory, wherein the cryptographic circuit device applies an asymmetric cryptographic process operating on a finite field having an order in an operation, the asymmetric cryptographic process including performing a scalar multiplication operation between at least one operand representing a curve point expressed by a projected format coordinate and a secret key, the scalar multiplication operation including: performing an iterative process of performing a set of operations on a bit or a group of consecutive bits of the secret key at each iteration, the multiplication operation including: at each iteration, randomizing the value represented by the number of bits of the projected format coordinate representing the at least one operand by multiplying the value of the projected format coordinate by a random value, wherein randomizing the value includes generating a random number over a range having a first value as an end value, and multiplying the random number by a second value greater than the first value, the first value being 2 to the power of the word length multiplied by a multiplier value minus 1, the second value being equal to 2 to the power of the number of bits divided by the first value, the multiplier value being an integer greater than or equal to one and less than the ratio of the number of bits to the word length. In one embodiment, the upper limit for the multiplier value is 4. In one embodiment, the multiplier value is 1 or 2. In one embodiment, the starting value of the range is 1. In one embodiment, the asymmetric cryptographic process is an elliptic curve cryptography (ECC) process, at least one operand is a point on an elliptic curve, and the multiplication operation is an ECC scalar multiplication. In one embodiment, the set of operations represents a Montgomery ladder. In one embodiment, each iteration of the iterative process is performed on a bit of the secret key and includes: if such a bit is zero, setting the second variable equal to the sum of the two variables and multiplying the first variable by two; otherwise, setting the first variable equal to the sum of the two variables and multiplying the second variable by two; and performing a randomization operation on the projection format coordinates expressing the first variable and the second variable. In one embodiment, the iterative process is performed by dividing the bits of the secret key into multiple groups of consecutive bits, and includes performing the set of operations on a group of bits of the secret key at each iteration.

[0076] In one embodiment, a non-transitory computer-readable medium has content that configures a processing device to perform a cryptographic operation on data using a word length, the performing the cryptographic operation comprising applying an asymmetric cryptographic process operating on a finite field having an order, the asymmetric cryptographic process comprising performing a scalar multiplication operation between at least one operand representing a curve point expressed by a projected format coordinate and a secret key, the scalar multiplication operation comprising: performing an iterative process of performing a set of operations on a bit or a group of consecutive bits of the secret key at each iteration, the multiplication operation comprising: at each iteration, randomizing the value represented by the number of bits of the projected format coordinate representing the at least one operand by multiplying the value of the projected format coordinate by a random value, wherein randomizing the value comprises generating a random number over a range having a first value as an end value, and multiplying the random number by a second value greater than the first value, the first value being 2 raised to the power of the word length multiplied by a multiplier value minus 1, the second value being equal to 2 raised to the power of the number of bits divided by the first value, the multiplier value being an integer greater than or equal to one and less than the ratio of the number of bits to the word length. In one embodiment, the upper limit for the multiplier value is 4. In one embodiment, the multiplier value is 1 or 2. In one embodiment, the content comprises instructions for execution by cryptographic circuitry of a processing device. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] The present disclosure will now be described, by way of non-limiting example only, with reference to the accompanying drawings, in which:

[0078] Figure 1 The processing units or cores are shown; and

[0079] Figure 2 A flow chart representing an embodiment of the method described herein. DETAILED DESCRIPTION

[0080] The following description illustrates various specific details intended to provide a thorough understanding of the embodiments. The embodiments may be implemented without one or more of the specific details or with other methods, components, materials, etc. In other cases, well-known structures, materials, or operations are not illustrated or described in detail so that aspects of the embodiments are not obscured.

[0081] References to "an embodiment" or "one embodiment" in the framework of this description are intended to indicate that a particular configuration, structure, or characteristic described with respect to that embodiment is included in at least one embodiment. Likewise, phrases such as "in one embodiment" or "in an embodiment" that may appear at various points in this description do not necessarily refer to one and the same embodiment. Furthermore, in one or more embodiments, particular configurations, structures, or characteristics may be appropriately combined.

[0082] The references used herein are for convenience only and therefore do not limit the scope of protection or the scope of the embodiments.

[0083] The solution described herein relates to a method for performing cryptographic operations on data in a processing device operating with a given word length, comprising applying an asymmetric cryptographic process operating on a finite field of a given order, the asymmetric cryptographic process comprising performing a scalar multiplication operation between at least one operand representing a curve point expressed by projected format coordinates and a secret key, the scalar multiplication operation comprising: performing an iterative process of a set of operations for each bit or each group of consecutive bits of the secret key at each iteration, the multiplication process comprising: at each iteration, randomizing a value represented by a given number of bits of the projected format coordinates of the at least one operand by multiplying such value of the projected format coordinates by a random value, for example using a point multiplication (such as Montgomery multiplication), wherein the random value is a small integer multiplied by a large integer, which can be regarded as one or several words. Specifically, the randomization operation comprises: the random value is obtained as the product of a randomly generated value and a second value, the randomly generated value being generated over a range having a first given value as an end value, the second value being greater than the first given value. Specifically, the first given value is 2 raised to the power of the word length or a multiple of the word length minus one, the second value is equal to 2 raised to the power of the given number of bits divided by the first value, and the multiplier value of the word length in the multiple is a small integer, at least less than the ratio of the given number of bits to the word length.

[0084] Thus, in one embodiment, a random integer value r is generated by an integer random generation function randint(sv, ev) which generates a random integer value r from a given starting value sv (e.g., 1) to an ending value ev (which is the value of the word length raised to the power of 2 minus 2). m*WS -1), where m is a small integer multiplier number (e.g., m=1 or m=2). Here, given the finite field order N, WS indicates the word length, and w is the word size of the operand, i.e., the number of words of the operand, the operand such as the ECC point coordinate X(Q0) can be represented by a polynomial representation:

[0085] Q0=a n *2 w*WS +a n-1 *2 w-1*WS +…+a1*2 1*WS +a0

[0086] where a n …a0 is a polynomial coefficient. For example, the bit size of N is 1024, the word length WS is 16 bits, and the number of words w required to represent the operand is 64.

[0087] For example, N is a prime number, which, as mentioned, defines a finite field. In yet another embodiment, the bit size n of N may be close to the value 256. The value word length WS may be 8, 16, 32 or 64, for example.

[0088] The operands are represented in Montgomery notation and, by definition, are less than 2. l , where the operand length 1>=bit size (N). In most cases, the operand length is equal to the bit size n of the finite field N, l=n, but sometimes the operand length is larger than the bit size n, such as the word length WS, l=n+WS.

[0089] The word number w of the operand is represented by l / WS, the ratio of the operand bit length 1 to the word length WS.

[0090] Multiply the result of the randint function by a number greater than the end value ev of the random value range, specifically as 2 l-m*WS Much larger, 2 operand length l and the difference between the small multiple of word length WS, namely m*WS. m is a multiplier, which is a small integer. When set to the minimum value m=1, the multiplier m can provide the lowest computational cost, however, if m=2, the computational cost will be greater, but the randomization will be more effective. As also indicated below, other options are possible, in order to reduce the computational cost, the multiplier m should at least be much smaller than the ratio of the length 1 of the operand to the word length WS.

[0091] Therefore, the choice of the value of the multiplier m can usually be 1 or 2. The multiplier m can ideally be less than or equal to the order N divided by the word length WS, m <= N / WS or m*WS <= N

[0092] r = randint(1,2 m*WS -1)*2 l-m*WS

[0093] The maximum value of the random value r can usually be less than 2 m*WS -1.

[0094] Therefore, the random value r obtained by the randomization operation through the random generation function randint is the sum of the random generated value and the second value 2 which is larger (for example, larger than the first value). l-m*WS The product is obtained by randomly generating a value with the first given value 2 m*WS As the end value ev is generated over a range, the first value and the second value are powers of 2 whose sum of exponents is equal to the length of the operand 1.

[0095] Then, each new homogeneous coordinate nX, nY, NZ is obtained by multiplying the values ​​X, Y, Z of the current projection format coordinates by a random value r using a multiplication using the Montgomery multiplication process:

[0096] nX=MM(X,r)

[0097] nY=MM(Y,r)

[0098] nZ=MM(Z,r)

[0099] Montgomery multiplication is still:

[0100]

[0101] This allows simplification to:

[0102] ab=a*randint(1,2 m*WS -1)*2 l-m*WS , where a*randint(1,2 m*WS -1) Calculation needs Second word multiplication, and (a*randint(1,2 (m*WS)-1 ) and 2 l-m*WS The computational cost of the multiplications between is negligible compared to the number of multiplications performed in the Montgomery domain; and

[0103] abN′mod 2 l =wrd*2 l-m*WS , where wrd is 2 m*WS is the upper limit value, so (abN′mod 2 l )N=wrd*N*2 l-m*WS , so (abN′mod 2 l )N has a computational cost of m*n / WS word multiplications. And:

[0104] wrd=a*randint()*N′mod 2(WS)

[0105] Thus, the total cost of this Montgomery multiplication is

[0106] exist Figure 2 , an exemplary flow chart of an embodiment 100 of the operation of the method described herein is shown.

[0107] This embodiment relates to ECC cryptography and represents the steps of the main loop L1-L6 already described, which uses loop variables Q1 and Q0 to implement iterative point multiplication of ECC curve points P with a secret key. Thus, S0 indicates the point where, starting from the first bit (e.g., i=0), the ECC cryptography performs an iterative point multiplication of a secret key k with a point P. i At this point the execution of the loop is iterated. Step S1 is a test that implements the iterative loop together with the return to step S5, specifically verifying whether i=n, ​​for all bits k iAll loop iterations of have been executed. If affirmative, the program continues with randomization S2 and scalar multiplications L2-L6. Otherwise, the program ends S6. Then, for each iteration, the homogeneous coordinates X, Y, Z in the loop variables Q0, Q1 are subjected to randomization S2, randomizing the values ​​X, Y, Z representing the projection format coordinates of the first variable and the second variable by multiplying such values ​​X, Y, Z of the projection format coordinates with a random value r. Such a value random r of operation S2 is provided by step S3, wherein said random value r is obtained by function randint as a randomly generated value and a second value 2 greater than the first value l-m*WS The random value is the product of the first given value 2 m*WS -1 as the range of the end value ev, the first value and the second value are powers of 2, the sum of their exponents is equal to the length 1 of the operand, and the exponent of the first value is a factor of the second value. Specifically, the random value r is generated as a random value selected from the range of values ​​having a small multiple of the word length WS of 2 as the end value ev multiplied by 2 to the power of the difference between the length 1 of the operand and the small multiple of the word length WS value. Therefore, step S3 is shown as receiving the values ​​of the start sv, the end ev, the order N, the length 1, and the word length WS from the memory of the processing device 10 or another control processor associated with the processing device 1.

[0108] Then, step S2 outputs the random coordinates nX, nY, NZ of the variables Q1, Q0 for which the main loop of the point multiplication is performed, for example thus including, for example, in step L1 for each bit k of the secret key k i Its value is checked.

[0109] If such a bit k i is zero, the second variable Q1 written into the same address of the controller 11 register corresponding to the operand variable is set equal to the sum of the two variables Q1 and Q0, and the first variable Q0 is multiplied by 2 (operations L2 and L3); otherwise, the first variable Q0 is equal to the sum of the two variables Q1 and Q0, and the second variable Q1 is multiplied by 2 (operations L5 and L6).

[0110] In both cases, the values ​​of the two variables Q1, Q0 are stored in the RAM memory 13 in each iteration (operation S4), and then as a final result R will be stored in the RAM 13 as a result of the multiplication at the end of the iteration, for example when i=n, ​​all bits k of the key k i has been used, and the iterative scalar multiplication 100 ends (operation S6). After storing S4 in the RAM 13, execution returns to step S0 to increment the index i.

[0111] The solutions according to the various embodiments described herein help to achieve the following advantages.

[0112] This solution advantageously uses modular multiplication with a random word as randomization operation, which is cheap in terms of computational cost.

[0113] Standard Montgomery multiplication with a single random word will cost The solution described in this paper involves The computational cost of sub-word multiplication.

[0114] Advantageously, there are no quadratic terms here, as long as the multiplier m<<1 / WS, for example if 1 is 1024 and WS 64, then the multiplier m should be much smaller than 16. In a variant embodiment, the upper limit of the value of the multiplier m is 4.

[0115] Since each iteration requires at least three multiplications, this significantly reduces latency compared to a full modular multiplication.

[0116] Of course, without prejudice to the principle of the embodiment, the details of construction and the embodiments may vary widely with respect to what is described and illustrated herein purely by way of example, without departing from the scope of the present embodiment, as defined by the following claims.

[0117] In the described embodiment, the iterative process includes, at each iteration, for each bit k of the secret key k i The set of operations L2-L6 are performed. However, an iterative process can be performed, dividing the bits of the secret key k into groups of consecutive bits, such as bit pairs (k i , k i+1 ) or more bits in the group, and includes performing a set of operations on each group of bits of the secret key k at each iteration, of course, the number of iterations performed is smaller, here indicated by K. For example, in such a case, the iterative process can be:

[0118] For i, from 0 to K:

[0119] Q=2*Q

[0120] Q=Q+T[e w ]

[0121] where Q is the only intermediate variable and T is the 2D containing the input points. w Multiples table, w is the word length of the operand, e w is a group of k bits of size w.

[0122] Since the attacker may notice that in the scalar window (T[e w )The same table T[e w ] to obtain information about the secret key k, so the loading table T[ew ], and randomizes the values ​​X, Y, Z of the projection format coordinates of the operand represented by the given number of bits 1 by multiplying such values ​​X, Y, Z of the projection format coordinates by the random value r, by which the operation S2 comprises obtaining the random value r as a random generated value and a random value greater than the first given value 2 m*WS The second value 2 l-m*WS The random value is the product of the first given value 2 m*WS As the end value ev is generated on the range, the first value 2 m*WS It is the word length WS of 2 or a multiple of the word length WS to the power of m*WS minus one, the second value is 2 l-m*WS The length of the operand equal to 2 raised to the power of 1 divided by the first value 2 m*WS , the multiplier value m in the multiple m*WS is a small integer.

[0123] In the method described here, the input values ​​of the scalar multiplication are an integer (secret key k) and a point, such as Q0 or Q. Then, a loop of the iterative process calculates on (at least) two points by performing point additions. If more than one bit of the secret key k is processed for each iteration, the loop will calculate on more than two points.

[0124] In addition, although the embodiments are described herein with reference to point multiplication in elliptic curve multiplication as an implementation of the Montgomery ladder, the methods described herein can be applied to other scalar multiplications, such as Double and Add, windowing methods, sliding window methods, w-ary non-adjacent form (wNAF) methods, or other methods, including an operation to randomize a value represented by a given number of bits of a projection format coordinate representing at least one operand by multiplying such a value of the projection format coordinate by a random value, and in such a case, the randomization operation also includes: obtaining the random value as the product of a randomly generated value and a second value greater than a first given value, the randomly generated value being generated over a range having the first given value as an end value, the first value being a power of 2 or a multiple of the word length, the second value being equal to a power of 2 of the length of the operand divided by the first value, and the multiplier value in the multiple being a small integer.

[0125] Some embodiments may take the form of or include a computer program product. For example, according to one embodiment, a computer readable medium is provided, which includes a computer program suitable for performing one or more of the above methods or functions. The medium may be a physical storage medium, such as, for example, a read-only memory (ROM) chip, or may be a disk, such as a digital versatile disk (DVD-ROM), a compact disk (CD-ROM), a hard disk, a memory, a network, or a portable medium item read by an appropriate driver or via an appropriate connection, including one or more bar codes or other related codes encoded in one or more such computer readable media and readable by an appropriate reader device.

[0126] In addition, in some embodiments, some or all of the methods and / or functionality may be implemented or provided in other ways, such as at least partially implemented in firmware and / or hardware, including but not limited to one or more application-specific integrated circuits (ASICs), digital signal processors, discrete circuit devices, logic gates, standard integrated circuits, controllers (e.g., by executing appropriate instructions, and including microcontrollers and / or embedded controllers), field programmable gate arrays (FPGAs), complex programmable logic devices (CPLDs), etc., as well as devices using RFID technology and various combinations thereof.

[0127] The various embodiments described above can be combined to provide further embodiments. Aspects of the embodiments can be modified, if necessary to employ concepts of the various patents, applications and publications to provide further embodiments.

[0128] In light of the above detailed description, these and other changes can be made to the embodiments. Generally, in the following claims, the terms used should not be interpreted to limit the claims to the specific embodiments disclosed in the specification and claims, but should be interpreted to include all possible embodiments and the full range of equivalents to which such claims are entitled. Therefore, the claims are not limited by the present disclosure.

Claims

1. A method of performing cryptographic operations on data in a processing device operating with a word length, comprising applying an asymmetric cryptographic process operating over a finite field having an order, the asymmetric cryptographic process comprising performing a scalar multiplication operation between at least one operand representing a curve point expressed by projected format coordinates and a secret key, the scalar multiplication operation comprising: An iterative process of performing a set of operations on a bit or a group of consecutive bits of the secret key at each iteration, the multiplication operation comprising: at each iteration, The value represented by the number of bits of the projection format coordinates of the at least one operand is randomized by multiplying the value of the projection format coordinates by a random value, wherein Randomizing the value includes generating a random number over a range having a first value as an end value, and multiplying the random number by a second value greater than the first value, The first value is the word length multiplied by the multiplier value raised to the power of 2 minus 1, The second value is equal to 2 raised to the power of the number of bits divided by the first value, and the multiplier value is an integer greater than or equal to one and less than a ratio of the number of bits to the word length. The method of claim 1 , wherein the upper limit for the multiplier value is 4. The method of claim 1 , wherein the multiplier value is 1 or 2. The method according to claim 1 , wherein the starting value of the range is 1. .

5. The method of claim 1, wherein the asymmetric cryptographic process is an elliptic curve cryptography (ECC) process, the at least one operand is a point on an elliptic curve, and the multiplication operation is an ECC scalar multiplication. The method of claim 5 , wherein the set of operations represents a Montgomery ladder.

7. The method of claim 6, wherein each iteration of the iterative process is performed on bits of the secret key using a first loop variable and a second loop variable, and comprises: If such bit is zero, setting the second loop variable equal to the sum of the first loop variable and the second loop variable, and multiplying the first loop variable by two; otherwise, setting the first loop variable equal to the sum of the first loop variable and the second loop variable, and multiplying the second loop variable by two; as well as A randomization operation is performed on the projection format coordinates expressing the first loop variable and the second loop variable.

8. The method of claim 1, wherein the iterative process is performed by dividing the bits of the secret key into multiple groups of consecutive bits, and includes performing a set of operations on a group of bits of the secret key at each iteration.

9. An apparatus for performing a cryptographic operation on data, comprising: Memory; as well as A cryptographic circuit device having a word length and coupled to the memory, wherein the cryptographic circuit device applies an asymmetric cryptographic process operating on a finite field having an order in the operation, the asymmetric cryptographic process comprising performing a scalar multiplication operation between at least one operand representing a curve point expressed by a projected format coordinate and a secret key, the scalar multiplication operation comprising: performing an iterative process of a set of operations on a bit or a group of consecutive bits of the secret key at each iteration, the multiplication operation comprising: randomizing the value represented by the number of bits of the projected format coordinate representing the at least one operand by multiplying the value of the projected format coordinate by a random value at each iteration, wherein Randomizing the value includes generating a random number over a range having a first value as an end value, and multiplying the random number by a second value greater than the first value, The first value is the word length multiplied by the multiplier value raised to the power of 2 minus 1, The second value is equal to 2 raised to the power of the number of bits divided by the first value, and the multiplier value is an integer greater than or equal to one and less than a ratio of the number of bits to the word length.

10. The apparatus of claim 9, wherein an upper limit for the multiplier value is 4. The apparatus of claim 9 , wherein the multiplier value is 1 or 2. 18 . The apparatus according to claim 9 , wherein the starting value of the range is 1.

13. The apparatus of claim 9, wherein the asymmetric cryptographic process is an elliptic curve cryptography (ECC) process, the at least one operand is a point on an elliptic curve, and the multiplication operation is an ECC scalar multiplication. The apparatus of claim 13 , wherein the set of operations represents a Montgomery ladder.

15. The apparatus of claim 14, wherein each iteration of the iterative process is performed on bits of the secret key using a first loop variable and a second loop variable, and comprises: If such bit is zero, setting the second loop variable equal to the sum of the first loop variable and the second loop variable, and multiplying the first loop variable by two; otherwise, setting the first loop variable equal to the sum of the first loop variable and the second loop variable, and multiplying the second loop variable by two; as well as A randomization operation is performed on the projection format coordinates expressing the first loop variable and the second loop variable.

16. The apparatus of claim 9, wherein the iterative process is performed by dividing the bits of the secret key into multiple groups of consecutive bits, and includes performing a set of operations on a group of bits of the secret key at each iteration.

17. A non-transitory computer readable medium having content that configures a processing device to perform a cryptographic operation on data using a word length, the performing the cryptographic operation comprising applying an asymmetric cryptographic process operating over a finite field having an order, the asymmetric cryptographic process comprising: A scalar multiplication operation is performed between at least one operand representing a curve point expressed by the projected format coordinates and a secret key, the scalar multiplication operation comprising: an iterative process of performing a set of operations on a bit or a group of consecutive bits of the secret key at each iteration, the multiplication operation comprising: at each iteration, The value represented by the number of bits of the projection format coordinates of the at least one operand is randomized by multiplying the value of the projection format coordinates by a random value, wherein The random value is a product of a random number generated over a range having a first value as an end value and a second value, the second value being greater than the first value, The first value is the word length multiplied by the multiplier value raised to the power of 2 minus 1, The second value is equal to 2 raised to the power of the number of bits divided by the first value, and the multiplier value is an integer greater than or equal to one and less than a ratio of the number of bits to the word length.

18. The non-transitory computer readable medium of claim 17, wherein an upper limit for the multiplier value is 4.

19. The non-transitory computer readable medium of claim 17, wherein the multiplier value is 1 or 2.

20. The non-transitory computer-readable medium of claim 17, wherein the content comprises instructions executed by cryptographic circuitry of the processing device.

Citation Information

Patent Citations

  • Protecting parallel multiplication operations from external monitoring attacks

    CN109791517A

  • Method for elliptic curve scalar multiplication using parameterized projective coordinates

    US20100322422A1