Methods for encrypting and signing data, related electronic devices, and related computer programs

By calculating multiple signature points and signature portions in an elliptic curve point group, the problem of high memory consumption and long computation time of elliptic curve cryptographic signature algorithms in insecure environments is solved, enhancing the security of white-box implementations and preventing fault attacks.

CN116707814BActive Publication Date: 2026-06-30IDEMIA FRANCE SAS

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
IDEMIA FRANCE SAS
Filing Date
2023-02-09
Publication Date
2026-06-30

Smart Images

  • Figure CN116707814B_ABST
    Figure CN116707814B_ABST
Patent Text Reader

Abstract

This invention relates to a method for encrypted signing of data, related electronic devices, and related computer programs. A method for encrypted signing of data includes: - (E10) determining a signature point equal to an element equal to a first derived point plus a number equal to a first scalar; - (E12) determining a second scalar by subtracting the product of a third and a fourth scalar from the product of the first scalar and a selected scalar; - (E14) determining another signature point equal to an element equal to the selected point plus a number equal to the second scalar, and an element equal to the second derived point plus a number equal to the fourth scalar; - (E16) determining a signature portion based on a private key, the first scalar, the coordinates of the signature point, and data. The first and second derived points are respectively equal to an element equal to the generating point plus numbers equal to the fifth and third scalars.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of cryptography.

[0002] More specifically, this invention relates to an encryption processing method, and also to a related electronic device and a related computer program. Background Technology

[0003] When implementing encryption algorithms through software running in an insecure environment, specific measures must be taken to prevent attackers from gaining access to secret data (such as encryption keys) through simple control of that environment.

[0004] The techniques for protecting the implementation of cryptographic algorithms in insecure environments are known as "white-box cryptography".

[0005] The paper "White Box Cryptography and an AES implementation" by S. Chow et al., presented in the proceedings of the 9th Annual Conference on Selected Areas of Cryptography (SAC'02) held on August 15-16, 2002, proposes, for example, a technique for generating AES algorithms, each applicable to a specific encryption key.

[0006] For solutions typically proposed in this context, the encryption algorithm is broken down into a series of basic processing operations, and the hidden data is manipulated using lookup tables associated with these basic processing operations.

[0007] These solutions consume a particularly large amount of memory due to the use of these numerous lookup tables.

[0008] Elliptic curve cryptography is known for its use in data signing, for example. The FIPS 186-4 standard, "Digital Signature Standard (DSS)," published by the National Institute of Standards and Technology (NIST) in July 2013, describes the ECDSA signature algorithm.

[0009] The properties of elliptic curves on finite bodies are used in computations involved in data processing (such as data signing). This involves manipulating elements of the point group of the elliptic curve, which is of finite order and equipped with operations to add two points of the elliptic curve.

[0010] To sign data using a private key, the first element of the group is associated with the group's generation point, and the affine coordinates of the signature point are determined. This signature point is equal to the combination of an element equal to the generation point and a number equal to a first scalar, obtained through the operation described above. The signature portion is also determined based on the private key, the first scalar, the affine coordinates, and the data. The message signature consists of the affine coordinates and the signature portion.

[0011] The first scalar used can be determined by random sampling, but attackers may find it relatively easy to block the random source, especially in white-box implementations. Alternatively, the first scalar used can be determined by applying a pseudo-random algorithm to the data.

[0012] In each of these two cases, the signature of a given message will always be the same, thus facilitating the attack proposed by Damian Poddebniak, Juraj Somorovsky, Sebastian Schinzel, Manfred Lochter, and Paul Rosler in “Attacking Deterministic Signature Schemes using Fault Attacks”, DOI 10.1109 / EuroSP.2018.00031, 2018.

[0013] This attack involves signing the same data twice and disrupting the calculation of affine coordinates. The attacker thus obtains the correct affine coordinates, the incorrect affine coordinates, the correct signature portion, and the incorrect signature portion with the incorrect affine coordinates. He can then recover the private key used to sign the data.

[0014] There are two ways to defend against this attack.

[0015] The first method involves using a public key associated with a private key to verify the signature of the data. However, verification is slower than signing, and white-box implementations also consume a particularly large amount of memory.

[0016] The second method involves calculating the signature of the data twice and comparing the two signatures calculated in this way. However, this method doubles the computation time and requires double the white-box implementation to defend against double-failure attacks that inject the same error, which consumes twice the memory. Summary of the Invention

[0017] To overcome these shortcomings, this invention proposes a method for cryptographically signing data based on a private key and a finite point group of elliptic curves, implemented within an electronic device. The group is equipped with an operation that adds two points of the elliptic curve and includes a point generation function. The method comprises the following steps:

[0018] - Determine a first signature point, which is equal to the combination of the element equal to the first derived generation point of the curve and the number equal to the first intermediate scalar through the operation, and

[0019] - The second intermediate scalar is determined by adding to or subtracting from the scalar resulting from the product of the first intermediate scalar and the selected scalar.

[0020] - Determine a second signature point, which is equal to the combination of elements equal to the selected point of the curve and numbers equal to the second intermediate scalar through the operation, and the combination of other elements equal to the second derived point of the operation or the opposite of the second derived point and numbers equal to the third intermediate scalar through the operation.

[0021] -The signature portion is determined based on the private key, the first intermediate scalar, the affine coordinates of the first signature point, and the data.

[0022] And among them:

[0023] - The first derived generating point is equal to the combination of the elements equal to the generating point of the curve and the numbers equal to the second derived scalar through the operation.

[0024] - The second derived point is equal to the combination of the elements equal to the selected point of the curve and the numbers equal to the first derived scalar through the operation.

[0025] The signature of this data includes the signature portion and another signature portion determined based on the affine coordinates of the second signature point.

[0026] Further advantageous and non-limiting features of the method according to the invention, individually or in any technically possible combination, are as follows:

[0027] These other elements are equal to the second derived generation point, and the step of determining the second intermediate scalar is based on subtraction.

[0028] - These other elements are equal to the negative of the second derived generating point, and the step of determining the second intermediate scalar is based on addition.

[0029] - The selected scalar is the second derived scalar, and the selected point is the generating point.

[0030] - The value of the selected scalar is one, and the selected point is the first derived generating point.

[0031] The method further includes the steps of determining the first derived generation point by combining the operations of elements equal to the generation point of the curve and numbers equal to the second derived scalar, and determining the second derived generation point by combining the operations of elements equal to the selected point of the curve and numbers equal to the first derived scalar.

[0032] Both the second derived scalar and the first derived scalar were determined through random sampling or by applying a pseudo-random algorithm to the data.

[0033] - The value of the third intermediate scalar is one.

[0034] -If the value of the selected scalar is one, then the third intermediate scalar has a non-zero value.

[0035] - This first intermediate scalar was determined either by random sampling or by applying a pseudo-random algorithm to the data.

[0036] - This third intermediate scalar was determined through random sampling.

[0037] - The value of this second derived scalar is strictly greater than one.

[0038] - The signature portion is equal to the modulo of the order of the group by the product of the multiplicative inverse of the first intermediate scalar, the multiplicative inverse of the second derived scalar, and the intermediate signature scalar, wherein the intermediate signature scalar is equal to the sum of the scalar generated by the aggregation of the data through a hash function and the product of the affine coordinates of the first signature point and the private key, and the other signature portion is the affine coordinates of the second signature point.

[0039] The signature portion is equal to the sum of the first intermediate scalar and the scalar generated by the product of the private key and the aggregated intermediate data using a hash function, modulo the order of the group. The intermediate data is a concatenation of the affine coordinates of the first signature point, another affine coordinate of the first signature point, two affine coordinates of another point on the curve, and the data. The method further includes the step of determining another signature portion by concatenating the affine coordinates of the second signature point and another affine coordinate of the second signature point.

[0040] The signature portion is equal to the sum of the first intermediate scalar and the scalar resulting from the product of the private key and the aggregated intermediate data using a hash function, modulo the order of the group, where the intermediate data is the concatenation of the affine coordinates of the first signature point, another affine coordinate of the first signature point, and the data. The method further includes the step of determining another signature portion by applying the hash function to the concatenation of the second signature point, another affine coordinate of the second signature point, and the data.

[0041] - The steps of determining the first signature point and the steps of determining the signature portion are implemented in a white-box manner.

[0042] - The steps of determining only the first signature point and determining the signature portion are implemented in a white-box manner.

[0043] - The first signature point and the second signature point are calculated in two different ways.

[0044] The present invention also proposes a computer program comprising instructions executable by a processor and designed to implement, when executed by the processor, the method for cryptographically signing data as defined above.

[0045] The present invention also proposes an electronic device capable of cryptographically signing data based on a private key and a finite group of points of an elliptic curve, the group being equipped with an operation for adding two points of the elliptic curve and including a generating point. The electronic device includes...

[0046] - A determining block for determining a first signature point, the first signature point being equal to a combination of elements equal to the first derived generation point of the curve and numbers equal to the first intermediate scalar through the operation, and

[0047] - A defined block used to determine the signature portion based on the private key, the first intermediate scalar, the affine coordinates of the first signature point, and the data.

[0048] - A determination block for determining a second intermediate scalar by adding to or subtracting from a scalar resulting from the product of the first intermediate scalar and the selected scalar.

[0049] - A determining block for determining a second signature point, which is equal to a combination of elements equal to the selected point of the curve and a number equal to the second intermediate scalar through the operation, and other elements equal to the second derived point or the opposite of the second derived point through the operation and a number equal to the third intermediate scalar through the operation.

[0050] And among them:

[0051] - The first derived generating point is equal to the combination of the elements equal to the generating point of the curve and the numbers equal to the second derived scalar through the operation.

[0052] - The second derived point is equal to the combination of the elements equal to the selected point of the curve and the numbers equal to the first derived scalar through the operation, and

[0053] The signature of this data includes the signature portion and another signature portion determined based on the affine coordinates of the second signature point.

[0054] The electronic device can be configured to implement each of the implementation options considered for the methods for cryptographically signing data as defined above.

[0055] Of course, the various features, variations and embodiments of the present invention can be combined with each other in various ways, as long as they are not incompatible or mutually exclusive. Attached Figure Description

[0056] Further features and advantages of the invention will become apparent from the following description and with reference to the accompanying drawings, which illustrate exemplary embodiments of the invention that are not restrictive in nature.

[0057] In the attached diagram:

[0058] Figure 1 The main components of the electronic entity in which the invention is implemented are schematically shown;

[0059] Figure 2 An example of an elliptic curve and a point group of elliptic curves is shown;

[0060] Figure 3 The main steps of the method for encrypting and signing data according to the first embodiment of the present invention are shown in the form of a flowchart.

[0061] Figure 4 The main steps of a method for cryptographically signing data according to another embodiment of the present invention are illustrated in flowchart form.

[0062] Unless otherwise stated, elements common to multiple figures or similar elements in multiple figures have been assigned the same reference numerals and have the same or similar features, so for simplicity, these common elements are usually not described multiple times. Detailed Implementation

[0063] Figure 1 An electronic device 2 is schematically shown, which includes a processor 4 (e.g., a microprocessor), a storage module 6, a random access memory 8, and a communication module 10.

[0064] Random access memory 8 and storage module 6 are each linked to processor 4, enabling processor 4 to read data from or write data to each of these memories 6 and 8.

[0065] Storage module 6 stores computer program instructions, some of which are designed to implement cryptographic signature methods when executed by processor 4, such as reference Figure 3 and Figure 4 At least one of the methods described. Storage module 6 is, for example, a hard disk drive or a potentially rewritable non-volatile memory (e.g., a memory of the EEPROM type, which stands for "Electrically Erasable Programmable Read-Only Memory").

[0066] Random access memory 8, in itself, can store at least some elements (specifically, points of scalars and elliptic curves), which are referenced... Figure 3 and Figure 4Manipulated during various processing operations performed during at least one of the described methods.

[0067] The electronic device 2 also includes a set of blocks (not shown), such as a determination block for determining a first signature point, a determination block for determining a signature portion, a determination block for determining a second intermediate scalar, and a determination block for determining a second signature point. These blocks can actually be formed by a combination of hardware and software elements. Each block has the function described in the method according to the invention and explained below. Therefore, for each block, the electronic device 2 stores, for example, software instructions that can be executed by the processor 4 of the electronic device 2 to use hardware elements (e.g., a communication interface or memory) and thus implement the function provided by that block.

[0068] According to one possible embodiment, computer program instructions stored in storage module 6 are, for example, during the operation phase of electronic device 2, referenced... Figure 3 and Figure 4 The described method was received prior to this (e.g., from a remote computer).

[0069] This invention is particularly applicable to situations where electronic device 2 is insecure and an attacker can therefore access the internal operations of electronic device 2, and thus access the processing operations performed by processor 4 and the data manipulated in these processing operations. (This is the white-box cryptographic framework mentioned in the introduction.)

[0070] The communication module 10 is connected to the processor 4 to allow the processor 4 to receive data from another electronic device (not shown) and / or transmit data to another electronic device (not shown). In some embodiments, the processor 4 is thus able to receive data m from other electronic devices and / or transmit other data to other electronic entities, such as references. Figure 3 and Figure 4 The result of at least one method described is typically a signature of the data m.

[0071] Figure 3 and Figure 4 Each figure in the diagram illustrates a method for cryptographically signing data according to the present invention.

[0072] Each of these encryption methods is implemented here by electronic device 2 (due to the execution of computer program instructions stored in storage module 6 as described above).

[0073] Each of these methods performs the operation in a point group Gr of finite order n of the elliptic curve E. This group Gr is equipped with an operation that adds two points of the elliptic curve E, hereinafter referred to as the operation. The elliptic curve E is defined by a set of parameters, including a point in the group Gr called the generating point G. Therefore, this generating point is predetermined and can actually be stored in the electronic device 2, for example, in its storage module 6. Any point in the group Gr can be uniquely associated with a set of c-dimensional affine coordinates in a c-dimensional spatial reference frame.

[0074] In addition, each of these methods performs algebraic operations (addition, multiplication, and subtraction) on scalars, which will be explained below as addition, product, and subtraction.

[0075] Figure 2 An example of an elliptic curve E in a 2D affine reference frame is shown, as well as an example of a point group Gr of an elliptic curve E defined on a volume K.

[0076] This invention is not limited to this example of elliptic curves and the group Gr. According to other examples, the elliptic curve E may have another shape in this reference frame, or may be defined in another reference frame and / or another space, particularly with a dimension greater than 2.

[0077] Figure 3 The main steps of a method for cryptographically signing data according to a first embodiment of the present invention are shown.

[0078] Figure 3 The method aims to determine, for example, the signature of data m received via communication module 10 using private key d and ECDSA algorithm.

[0079] In initialization step E2, processor 4 determines a first derived scalar t1 and a second derived scalar t0. The first derived scalar t1 and the second derived scalar t0 can each be determined by: random sampling; by applying a pseudo-random algorithm to, for example, data m; or by reading from the memory of electronic device 2, for example, if the first derived scalar t1 and / or the second derived scalar t0 have been predetermined, and then storing them in storage module 6.

[0080] The second derived scalar t0 preferably has a value modulo the order n of the group Gr, which is strictly greater than one.

[0081] The method then includes the step of determining a first derived generating point T0 (step E4), which is equal to a combination of elements equal to the generating point G of the elliptic curve E and numbers equal to the second derived scalar t0 through an operation of the group Gr, for example, multiplying the generating point G by the second derived scalar t0.

[0082] This is represented as: T0 = [t0]G.

[0083] The step of determining the first derived generation point (step E4) can be achieved by: calculating based on the second derived scalar t0 and the generation point G; or by reading the memory of the electronic device 2, for example, if the first derived generation point T0 has been pre-calculated and stored in its storage module 6.

[0084] The method also includes the step of determining a second derived generating point T1 (step E6), which is equal to the combination of an element equal to the generating point G of the elliptic curve E and a number equal to the first derived scalar t1 through an operation of the group Gr, for example, multiplying the generating point G by the first derived scalar t1: T1 = [t1]G.

[0085] The step of determining the second derived generation point (step E6) can be achieved by: calculating based on the first derived scalar t1 and the generation point G; or by reading the memory of the electronic device 2, for example if the second derived generation point T1 has been pre-calculated and stored in the storage module 6.

[0086] The method then includes the step of determining a first intermediate scalar (step E8), during which the processor 4 determines the first intermediate scalar k, for example by random sampling or by applying a pseudo-random algorithm to the data m.

[0087] The method further includes a step of determining a third intermediate scalar (step E9), during which the processor 4 determines the third intermediate scalar k”, for example by random sampling or by typically applying a pseudo-random algorithm to the data m. The value of the third intermediate scalar (k”) is preferably one. Therefore, the computations performed by this method are reduced without compromising the robustness of the method.

[0088] The method then includes the step of determining a first signature point R1 (step E10), which is equal to the combination of an element equal to the first derived point T0 of the curve and a number equal to the first intermediate scalar k through an operation of the group Gr, for example, multiplying the first derived point T0 by the first intermediate scalar k: R1 = [k]T0.

[0089] The choice of the second derived scalar t0 being greater than 1 can effectively resist side-channel attacks and reverse engineering attacks because the first signature point R1 is determined by combining elements equal to the first derived generation point T0, which is different from the generation point G that is usually known to the public.

[0090] The method then includes a step of determining a second intermediate scalar (step E12), during which the second intermediate scalar k' is determined by adding a scalar resulting from the product of the first intermediate scalar k and the second derived scalar t0 to a scalar resulting from the product of the first derived scalar t1 and the third intermediate scalar k”. Therefore, the value of the second intermediate scalar k' is k.t0 + k”.t1.

[0091] According to a variation of the step of determining the second intermediate scalar (step E12), the second intermediate scalar k' is determined by subtracting the scalar resulting from the product of the first derived scalar t1 and the third intermediate scalar k” from the scalar resulting from the product of the first intermediate scalar k and the second derived scalar t0. Therefore, in this variation of the step, the value of the second intermediate scalar k' is k.t0-k”.t1.

[0092] Therefore, during the step of determining the second intermediate scalar (step E12), the second intermediate scalar k' is determined by adding or subtracting from the scalar generated by the product of the first intermediate scalar k and the selected scalar, where the selected scalar is the second derived scalar t0.

[0093] The method further includes the step of determining a second signature point R0 (step E14), which is equal to the combination of elements equal to the curve's generation point G and numbers equal to the second intermediate scalar k' through an operation of the group Gr, and other elements equal to the opposite of the second derived generation point T1 of the operation and numbers equal to the third intermediate scalar k” through an operation of the group Gr, for example by multiplying the generation point G by the second intermediate scalar k' and multiplying the opposite of the second derived generation point T1 by the third intermediate scalar k”, and then adding the result of each of these multiplications to the group Gr: R0 = [k']G - [k”]T1.

[0094] According to a variation of the step of determining the second signature point (step E14), the second signature point R0 is determined by combining the elements equal to the curve's generating point G and the numbers equal to the second intermediate scalar k' through the operation of the group Gr, and the other elements equal to the second derived generating point T1 and the numbers equal to the third intermediate scalar k” through the operation of the group Gr. For example, by multiplying the generating point G by the second intermediate scalar k' and the second derived generating point T1 by the third intermediate scalar k”, and then adding the result of each of these multiplications to the group Gr: R0 = [k']G + [k”]T1.

[0095] Therefore, the step of determining the second signature point (step E14) determines that the second signature point R0 is equal to the combination of elements equal to the selected point of the curve and numbers equal to the second intermediate scalar k' through the operation, and other elements equal to the points in the second derived generation point T1 or the opposite of the second derived generation point T1 through the operation and numbers equal to the third intermediate scalar k” through the operation, and the selected point is the generation point G.

[0096] When the step of determining the second intermediate scalar (step E12) is implemented according to the previously described variant, a variant of the step of determining the second signature point (step E14) is typically used.

[0097] Finally, the method includes a step of determining the signature portion (step E16), which determines the signature portion s based on the private key d, the first intermediate scalar k, the affine coordinates r1 of the first signature point R1 (typically affine coordinates of a predetermined dimension in an affine reference frame of a predetermined affine space) and the data m.

[0098] For example, in the case of the ECDSA signature algorithm, the signature part s is equal to the modulo of the order of the group Gr, which is the product of the multiplicative inverse of the first intermediate scalar k, the multiplicative inverse of the second derived scalar t0, and the intermediate signature scalar. The intermediate signature scalar is equal to the sum of the scalars generated by the aggregation e of the data m through the hash function H and the product of the affine coordinates r1 of the first signature point (usually the affine coordinates of the first dimension in a predetermined affine reference frame of a predetermined space) and the private key d. In other words: s = (k.t0) -1 .(e+r1.d)mod n, where e=H(m). The hash function H is usually the SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA3-224, SHA3-256, SHA3-384 or SHA3-512 algorithm.

[0099] exist Figure 3 At the end of the method, electronic device 2 thus has a signature of data m via the ECDSA algorithm using private key d, specifically a signature portion s and another signature portion determined based on the affine coordinates r0 of the second signature point R0 (typically a predetermined second dimension in an affine reference frame of a predetermined space, such as the first dimension mentioned above). Here, the other signature portion is the affine coordinates r0 of the second signature point R0.

[0100] The attack mentioned in the introduction is no longer feasible. Specifically, the attacker needs to know the incorrect affine coordinates used in calculating the signature. The first and second signature points are calculated in two different ways. Therefore, it is necessary for the attacker to inject the same error twice: once into the calculation of the first signature point's affine coordinates, and again into the calculation of the second signature point's affine coordinates. By implementing these two calculation operations in different ways, the attack becomes impossible.

[0101] Preferably, if the value of the selected scalar is one, then the third intermediate scalar (k”) has a non-zero value.

[0102] Those skilled in the art will understand that the steps of the method can be performed in other orders, as long as each step has the elements required for its execution (e.g., points of scalars and / or elliptic curves).

[0103] According to the first example, the steps of determining the first derived generation point (step E4) and determining the second derived generation point (step E6) can be performed in any order.

[0104] According to the second example, the initialization step (step E2) can be performed after the step of determining the first derived generation point (step E4) and / or the step of determining the second derived generation point (step E6), especially when the determination of the first derived generation point T0 and / or the second derived generation point T1 is based on reading the memory of the electronic device 2.

[0105] According to the third example, the steps of determining the first intermediate scalar (step E8) and determining the third intermediate scalar (step E9) can be performed in any order. The steps of determining the first intermediate scalar (step E8) and / or determining the third intermediate scalar (step E9) can be performed before any of steps E2 to E6.

[0106] According to the fourth example, the step of determining the first signature point (step E10) can be performed at any time after the step of determining the first derived generation point (step E4) and the step of determining the first intermediate scalar (step E8) but before the step of determining the signature portion (step E16).

[0107] According to the fifth example, the step of determining the second signature point (step E14) can be performed at any time after the step of determining the second derived generation point (step E6) and the step of determining the second intermediate scalar (step E12).

[0108] Based on the last example, the step of determining the signature portion (step E16) can be performed at any time after the step of determining the first signature point (step E10).

[0109] Figure 4A method for cryptographically signing data according to another embodiment of the present invention is illustrated in the form of a flowchart.

[0110] Figure 4 The method also aims to determine, for example, the signature of data m received via communication module 10 using private key d and ECDSA algorithm.

[0111] Figure 4 The method includes the same initialization step E2 as the initialization step E2 in the first embodiment.

[0112] The method then includes the step of determining the first derived generation point T0 (step E4), which is the same as in the first embodiment.

[0113] The method further includes the step of determining a second derived generation point T1 (step E106), which is equal to the combination of elements equal to the first derived generation point T0 of the elliptic curve E and numbers equal to the first derived scalar t1 through the operation of the group Gr.

[0114] For example, the step of determining the second generation point is performed by multiplying the first derived generation point T0 by the first derived scalar t1, or according to another example, by multiplying the generation point G by the scalar resulting from the product of the first derived scalar t1 and the second derived scalar t0: T1 = [t1.t0]G = [t1]T0.

[0115] The step of determining the second derived generation point can be performed by: calculating based on the first derived scalar t1 and the first derived generation point T0; or calculating based on the first derived scalar t1, the second derived scalar t0, and the generation point G; or by reading the memory of the electronic device 2, for example, if the second derived generation point T1 has been pre-calculated and stored in its storage module 6.

[0116] The method then includes the steps of determining a first intermediate scalar (step E8), determining a third intermediate scalar (step E9), and then determining a first signature point R1 (step E10), the steps being the same as those described for the first embodiment.

[0117] The method then includes a step of determining a second intermediate scalar (step E112), during which the second intermediate scalar k' is determined by adding a scalar resulting from the product of the first derived scalar t1 and the third intermediate scalar k” to the first intermediate scalar k. Therefore, the value of the second intermediate scalar k' is k + k”.t1.

[0118] According to a variation of the step (step E112) for determining the second intermediate scalar, the second intermediate scalar k' is determined by subtracting the scalar resulting from the product of the first derived scalar t1 and the third intermediate scalar k” from the first intermediate scalar k. Therefore, in this variation of the step, the value of the second intermediate scalar k' is kk”.t1.

[0119] Therefore, during the step of determining the second intermediate scalar (step E112), the second intermediate scalar k' is determined by adding or subtracting from the scalar generated by the product of the first intermediate scalar k and the selected scalar, where the value of the selected scalar is 1.

[0120] The method further includes the step of determining a second signature point R0 (step E114), which is equal to the combination of elements equal to the first derived generating point T0 of the curve and numbers equal to the second intermediate scalar k' through an operation of the group Gr, and other elements equal to the opposite of the second derived generating point T1 of the operation and numbers equal to the third intermediate scalar k” through an operation of the group Gr, for example by multiplying the first derived generating point T0 by the second intermediate scalar k' and multiplying the opposite of the second derived generating point T1 by the third intermediate scalar k”, and then adding the result of each of these multiplications to the group Gr:

[0121] R0 = [k']T0 - [k”]T1.

[0122] According to a variation of the step of determining the second signature point (step E114), the second signature point R0 is determined by combining the elements equal to the first derived generating point T0 of the curve and the numbers equal to the second intermediate scalar k' through the operation of the group Gr, and the other elements equal to the second derived generating point T1 and the numbers equal to the third intermediate scalar k” through the operation of the group Gr, for example by multiplying the first derived generating point T0 by the second intermediate scalar k' and the second derived generating point T1 by the third intermediate scalar k”, and then adding the result of each of these multiplications to the group Gr: R0 = [k']T0 + [k”]T1.

[0123] Therefore, the step of determining the second signature point (step E114) determines that the second signature point R0 is equal to the combination of elements equal to the selected point of the curve and numbers equal to the second intermediate scalar k' through the operation, and other elements equal to the points in the second derived generation point T1 or the opposite of the second derived generation point T1 through the operation and numbers equal to the third intermediate scalar k” through the operation, the selected point being the first derived generation point T0.

[0124] When the step of determining the second intermediate scalar (step E112) is performed according to the previously described variant, a variant of the step of determining the second signature point (step E114) is typically used.

[0125] Finally, the method includes the step of determining the signature portion (step E16), which is the same as in the first embodiment.

[0126] exist Figure 4 At the end of the method, electronic device 2 thus has a signature of data m via the ECDSA algorithm using private key d, specifically a signature portion s and another signature portion determined based on the affine coordinates r0 of the second signature point R0 (typically a predetermined second dimension in an affine reference frame of a predetermined space, e.g., a first dimension described with respect to the affine coordinates r1 of the first signature point R1 in step E16 of determining the signature portion). Here, the other signature portion is the affine coordinates r0 of the second signature point R0.

[0127] The attack mentioned in the introduction is no longer feasible. Specifically, the attacker needs to know the incorrect affine coordinates used in calculating the signature. The first and second signature points are calculated in two different ways. Therefore, it is necessary for the attacker to inject the same error twice: once into the calculation of the first signature point's affine coordinates, and again into the calculation of the second signature point's affine coordinates. By implementing these two calculation operations in different ways, the attack becomes impossible.

[0128] Preferably, if the value of the selected scalar is one, then the third intermediate scalar (k”) has a non-zero value.

[0129] Those skilled in the art will understand that the steps of the method can be performed in other orders, as long as each step has the elements required for its execution (e.g., points of scalars and / or elliptic curves).

[0130] According to the first example, when the second derived generation point T1 is determined by calculation based on the first derived scalar t1, the second derived scalar t0 and the generation point G, or by reading the memory of the electronic device 2, the step of determining the second derived generation point (step E106) can be performed before the step of determining the first derived generation point (step E4).

[0131] According to the second example, the initialization step (step E2) can be performed after the step of determining the first derived generation point (step E4) and / or the step of determining the second derived generation point (step E6), especially when the determination of the first derived generation point T0 and / or the second derived generation point T1 is based on reading the memory of the electronic device 2.

[0132] According to the third example, the steps of determining the first intermediate scalar (step E8) and determining the third intermediate scalar (step E9) can be executed in any order. The steps of determining the first intermediate scalar (step E8) and / or determining the third intermediate scalar (step E9) can be executed before any of the initialization step (step E2), the step of determining the first derived generation point (step E4), and the step of determining the second derived generation point (step E106).

[0133] According to the fourth example, the step of determining the first signature point (step E10) can be performed at any time after the step of determining the first derived generation point (step E4) and the step of determining the first intermediate scalar (step E8).

[0134] According to the fifth example, the step of determining the second signature point (step E114) can be performed at any time after the step of determining the first derived generation point (step E4), the step of determining the second derived generation point (step E106), and the step of determining the second intermediate scalar (step E112).

[0135] Based on the last example, the step of determining the signature portion (step E16) can be performed at any time after the step of determining the first signature point (step E10).

[0136] The above describes two embodiments of the method for performing ECDSA encrypted signatures on data according to the present invention.

[0137] As a variation, these embodiments can be applied to cryptographically signing data using the EdDSA algorithm. In this case, the step of determining the signature portion (step E16) further determines the signature portion s based on the private key d, the first intermediate scalar k, the affine coordinates r1 of the first signature point R1 (typically the affine coordinates of a predetermined first dimension in an affine reference frame of a predetermined space), and the data m. However, in this variation, this step of determining the signature portion (step E16) determines the signature portion s, which is equal to the sum of the first intermediate scalar k and the scalar generated by the product of the private key d and the condensation of the intermediate data m' through the hash function H, modulo the order of the group Gr, where the intermediate data m' is the affine coordinates r1 of the first signature point and another affine coordinate r of the first signature point. y1 (Usually, the affine coordinates of a predetermined first other dimension that are different from the predetermined first dimension in the affine reference frame of the predetermined space), and the two affine coordinates q and q' of another point Q on curve E. y (These are typically the affine coordinates of the first predetermined dimension and the first other predetermined dimensions in an affine reference frame of a predetermined space), and the concatenation of data m. In other words: s = k + dH(r1|r y1 |q|q y|m)mod n. The hash function H is usually the SHA-512 or SHAKE256 algorithm.

[0138] Adapted in this way Figure 3 and Figure 4 The method can be supplemented by a step (step E200) to determine another signature portion u, which is determined by the affine coordinates r0 of the second signature point R0 (typically a predetermined second dimension in an affine reference frame of a predetermined space, such as a predetermined first dimension) and another affine coordinate r of the second signature point R0. y0 The concatenation of (typically a predetermined second other dimension in an affine reference frame of a predetermined space, such as a predetermined first other dimension) determines another signature part u. In other words: u = r0|r y0 .

[0139] exist Figure 3 Method or Figure 4 When the method ends, the electronic device 2 thus has a signature of the data m by means of the private key d via the EdDSA algorithm, specifically the aforementioned signature part s and another signature part u determined by the step of determining another signature part based on the affine coordinates r0 of the second signature point R0 (step E200).

[0140] According to another variant, refer to Figure 3 and Figure 4 The two embodiments described can be applied to cryptographically signing data m using the Schnorr signature algorithm. In this case, step E16, which determines the signature portion, further determines the signature portion s based on the private key d, the first intermediate scalar k, the affine coordinates r1 of the first signature point R1 (typically affine coordinates of a predetermined first dimension in an affine reference frame of a predetermined space), and the data m. However, in this other variation, step E16 determines the signature portion s, which is equal to the sum of the first intermediate scalar k and the scalar generated by the product of the private key d and the condensation of intermediate data m' through the hash function H, modulo the order of the group Gr, where the intermediate data m' is the affine coordinates r1 of the first signature point and another affine coordinate r of the first signature point R1. y1 (Usually, affine coordinates in other predetermined dimensions that differ from the predetermined first dimension in an affine reference frame of a predetermined space), and the concatenation of data m. In other words: s = k + dH(r1|r y1 |m)modn. The hash function H is usually the SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA3-224, SHA3-256, SHA3-384 or SHA3-512 algorithm, and the result may be truncated.

[0141] Adapted in this way Figure 3 and Figure 4 The method can be supplemented by another step (step E201) to determine another signature part u, in which the affine coordinates r0 of the second signature point R0 (typically in a predetermined second dimension, such as a predetermined first dimension, in an affine reference frame of a predetermined space) are determined by the other affine coordinates r0 of the second signature point R0. y0 (Typically, a second other dimension in a predetermined affine reference frame of a predetermined space, such as a first other dimension) and the concatenation of data m are used to apply the hash function H to determine another signature part u. In other words: u = H(r0|r y0 |m).

[0142] exist Figure 3 Method or Figure 4 When the method ends, the electronic device 2 thus has a signature of the data m by means of the private key d through the Schnorr signature algorithm, specifically the aforementioned signature part s and another signature part u determined by another step (step E201) of determining another signature part based on the affine coordinates r0 of the second signature point R0.

[0143] As already mentioned, those skilled in the art will understand that the steps of each method can be performed in a different order, as long as each step has the elements required for its execution (e.g., points of scalars and / or elliptic curves).

[0144] Therefore, it will be noted that step E200 for determining another part of the signature and step E201 for determining another part of the signature can be found in the reference. Figure 3 The method described includes the steps for determining the second signature point (step E14) or reference. Figure 4 The method described is executed at any time after the step of determining the second signature point (step E114).

[0145] It will be noted that the attack mentioned in the introduction is no longer possible using these variants of the EdDSA or Schnorr algorithm for cryptographic signing of data. Specifically, the attacker needs to know the incorrect affine coordinates of the signature points used in calculating the signature portion. The first and second signature points are calculated in two different ways. Therefore, it is necessary for the attacker to inject the same error twice: once into the calculation of the two affine coordinates of the first signature point, and again into the calculation of the two affine coordinates of the second signature point. By implementing these two calculation operations in different ways, the attack becomes impossible.

[0146] Preferably, if the value of the selected scalar is one, then the third intermediate scalar (k”) has a non-zero value.

[0147] Regardless of the embodiment and / or variant embodiments, it will be noted that the calculations involved in processing points on the elliptic curve E are typically performed by performing operations (addition, subtraction, and multiplication) on one or more coordinates of the one or more points in question (e.g., one or more affine coordinates for each point, but not necessarily affine coordinates in all dimensions of the relevant affine reference frame, or, according to another example, one or more projected coordinates for each point, but not necessarily projected coordinates in all dimensions of the relevant projected reference frame) in another finite body.

[0148] Finally, regardless of which embodiment and / or variant of the method for cryptographically signing data according to the present invention, the steps of determining the first signature point R1 and determining the signature portion s can be implemented in a white-box manner.

[0149] Therefore, when this method is implemented in a non-secure device, it is able to resist the attacks mentioned in the prior art.

[0150] Preferably, the steps of determining only the first signature point R1 and determining the signature portion s are implemented in a white-box manner.

[0151] Therefore, when implemented in an insecure device, the method is resistant to the attacks mentioned in the prior art, while limiting the device's memory consumption and the computation associated with the implementation.

[0152] Those skilled in the art will understand that the above embodiments, variations and various features can be combined with each other in various ways, as long as they are not mutually incompatible or mutually exclusive.

Claims

1. A method for cryptographically signing data (m) based on a private key (d) and a finite point group of an elliptic curve (E) implemented in an electronic device (2), the finite point group being equipped with an operation of adding two points of the elliptic curve and including generating points (G), the method comprising the following steps: - Determine (E10) the first signature point (R1), which is equal to the combination of the element equal to the first derived generation point (T0) of the elliptic curve and the number equal to the first intermediate scalar (k) through the operation, and - The second intermediate scalar (k') is determined by adding or subtracting the scalar generated by the product of the first derived scalar (t1) and the third intermediate scalar (k") to the scalar generated by the product of the first intermediate scalar (k) and the selected scalar. - Determine the second signature point (R0) (E14, E114), which is equal to the combination of elements equal to the selected point of the elliptic curve and numbers equal to the second intermediate scalar (k') through the operation, and other elements equal to the point of the second derived generation point (T1) or the opposite of the second derived generation point (T1) through the operation and numbers equal to the third intermediate scalar (k') through the operation. - The signature portion (s) is determined based on the private key (d), the first intermediate scalar (k), the affine coordinates (r1) of the first signature point (R1), and the data (m). And among them, - The first derived generating point (T0) is equal to the combination of the elements equal to the generating point (G) of the elliptic curve and the numbers equal to the second derived scalar (t0) through the operation. - The second derived generating point (T1) is equal to the combination of elements equal to the selected point of the elliptic curve and numbers equal to the first derived scalar (t1) through the operation. - The signature of the data includes the signature portion(s) and another signature portion determined based on the affine coordinates (r0) of the second signature point (R0). in, - The other elements are equal to the second derived generation point (T1), and the steps (E12, E112) for determining the second intermediate scalar (k') are based on subtraction, or - The other elements are equal to the opposite of the second derived generation point, and the steps (E12, E112) for determining the second intermediate scalar (k') are based on addition.

2. The method for encrypting and signing data (m) according to claim 1, wherein, - The selected scalar is the second derived scalar (t0), and the selected point is the generating point (G), or - The value of the selected scalar is one, and the selected point is the first derived generation point (T0).

3. The method for encrypting and signing data (m) according to claim 1, the method further includes the following steps: - The first derived generation point (T0) is determined by combining the elements equal to the generation point (G) of the elliptic curve and the numbers equal to the second derived scalar (t0) through the operation (E4). - The second derived point (T1) is determined by combining the elements equal to the selected point of the elliptic curve and the numbers equal to the first derived scalar (t1) through the operation (E6, E106).

4. The method for encrypting and signing data (m) according to claim 1, wherein, Both the second derived scalar (t0) and the first derived scalar (t1) are determined by random sampling or by applying a pseudo-random algorithm to the data (m).

5. The method for encrypting and signing data (m) according to claim 1, wherein, If the value of the selected scalar is one, then the third intermediate scalar (k) has a non-zero value.

6. The method for encrypting and signing data (m) according to claim 1, wherein, The first intermediate scalar (k) is determined by random sampling or by applying a pseudo-random algorithm to the data (m).

7. The method for encrypting and signing data (m) according to claim 1, wherein, The value of the second derived scalar (t0) is strictly greater than one.

8. The method for cryptographically signing data (m) according to claim 1, wherein, - The signature portion (s) is equal to the modulo of the order of the finite point group of the product of the multiplicative inverse of the first intermediate scalar (k), the multiplicative inverse of the second derived scalar (t0), and the intermediate signature scalar. The intermediate signature scalar is equal to the sum of the scalars generated by the aggregation of the data (m) through a hash function and the product of the affine coordinates (r1) of the first signature point and the private key (d). - The other signature portion is the affine coordinate (r0) of the second signature point (R0).

9. The method for encrypting and signing data (m) according to claim 1, - Wherein, the signature portion (s) is equal to the sum of the first intermediate scalar (k) and the scalar generated by the product of the private key (d) and the condensation of the intermediate data (m') through the hash function (H), modulo the order of the finite point group, where the intermediate data is the affine coordinates (r1) of the first signature point and another affine coordinate (r2) of the first signature point. y1 The concatenation of the two affine coordinates of the other point (Q) of the elliptic curve and the data (m), and - Also includes the affine coordinates (r0) of the second signature point (R0) and another affine coordinate (r) of the second signature point (R0). y0 The steps to determine another signature portion are cascaded together (E200).

10. The method for cryptographically signing data (m) according to claim 1, - Wherein, the signature portion (s) is equal to the sum of the first intermediate scalar (k) and the scalar generated by the product of the private key (d) and the aggregate of the intermediate data (m') through the hash function (H), modulo the order of the finite point group, where the intermediate data (m') is the affine coordinate (r1) of the first signature point and another affine coordinate (r) of the first signature point (R1). y1 The concatenation of the data (m) and the data (m), and - It also includes the affine coordinates (r0) of the second signature point (R0) and another affine coordinate (r...) of the second signature point (R0). y0 The step (E201) involves applying a hash function (H) to the concatenation of the data (m) and the hash function (H) to determine another signature portion.

11. The method for cryptographically signing data (m) according to claim 1, wherein, The steps (E10) of determining the first signature point (R1) and (E16) of determining the signature portion (s) are implemented in a white-box manner.

12. The method for cryptographically signing data (m) according to claim 11, wherein, The steps (E10) of determining only the first signature point (R1) and the step (E16) of determining the signature portion are implemented in a white-box manner.

13. A computer program comprising instructions executable by a processor and configured to perform the method according to any one of claims 1 to 12 when the instructions are executed by the processor.

14. An electronic device (2) capable of cryptographically signing data (m) based on a private key (d) and a finite point group of an elliptic curve (E), the finite point group being equipped with an operation that adds two points of the elliptic curve and includes a generating point (G), the electronic device comprising: - A determining block for determining a first signature point (R1), the first signature point being equal to a combination of elements equal to the first derived generating point (T0) of the elliptic curve and numbers equal to the first intermediate scalar (k) through the operation, and - A determination block for determining the signature portion (s) based on the private key (d), the first intermediate scalar (k), the affine coordinates (r1) of the first signature point (R1), and the data (m). - A determination block for determining a second intermediate scalar (k') by adding to or subtracting from a scalar resulting from the product of the first derived scalar (t1) and the third intermediate scalar (k') into the scalar resulting from the product of the first intermediate scalar (k) and the selected scalar. - A determining block for determining a second signature point (R0), the second signature point being equal to a combination of elements equal to a selected point of the elliptic curve and a number equal to the second intermediate scalar (k') through the operation, and other elements equal to a point in the second derived generating point (T1) or the opposite of the second derived generating point (T1) through the operation and a number equal to the third intermediate scalar (k') through the operation. And among them, - The first derived generating point (T0) is equal to the combination of the elements equal to the generating point (G) of the elliptic curve and the numbers equal to the second derived scalar (t0) through the operation. - The second derived generating point (T1) is equal to the combination of elements equal to the selected point of the elliptic curve and numbers equal to the first derived scalar (t1) through the operation, and - The signature of the data includes the signature portion(s) and another signature portion determined based on the affine coordinates (r0) of the second signature point (R0). in, - The other elements are equal to the second derived generation point (T1), and the steps (E12, E112) for determining the second intermediate scalar (k') are based on subtraction, or - The other elements are equal to the opposite of the second derived generation point, and the steps (E12, E112) for determining the second intermediate scalar (k') are based on addition.