EP1660989A2 - Modular reduction for a cryptographic process and coprocessor for carrying out said reduction - Google Patents

Modular reduction for a cryptographic process and coprocessor for carrying out said reduction

Info

Publication number
EP1660989A2
EP1660989A2 EP04786388A EP04786388A EP1660989A2 EP 1660989 A2 EP1660989 A2 EP 1660989A2 EP 04786388 A EP04786388 A EP 04786388A EP 04786388 A EP04786388 A EP 04786388A EP 1660989 A2 EP1660989 A2 EP 1660989A2
Authority
EP
European Patent Office
Prior art keywords
multiplication
register
result
bits
polynomial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
EP04786388A
Other languages
German (de)
French (fr)
Inventor
Jean-François Tour d'Aygosi DHEM
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gemplus SA
Original Assignee
Gemplus Card International SA
Gemplus SA
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gemplus Card International SA, Gemplus SA filed Critical Gemplus Card International SA
Publication of EP1660989A2 publication Critical patent/EP1660989A2/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/724Finite field arithmetic
    • G06F7/726Inversion; Reciprocal calculation; Division of elements of a finite field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3066Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy involving algebraic varieties, e.g. elliptic or hyper-elliptic curves
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3093Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy involving Lattices or polynomial equations, e.g. NTRU scheme
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • H04L9/3252Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures using DSA or related signature schemes, e.g. elliptic based signatures, ElGamal or Schnorr schemes

Definitions

  • the invention also relates to an electronic component comprising means for implementing such a method.
  • the invention is particularly applicable for the implementation of cryptographic methods of the public key type on an elliptical curve, for example in smart cards.
  • Public key algorithms on an elliptical curve allow cryptographic applications such as encryption, digital signature, authentication, etc. They are particularly widely used in smart card applications, because they allow the use of short keys. , allowing fairly short processing times.
  • the notation LA (x) / B (x) J means the default integer part of A (x) / B (x).
  • S (x) is the remainder of the polynomial integer division, it is also equal to the result of the modular polynomial reduction U (x) mod N (x).
  • the degree of the polynomial N (x) is noted deg (N).
  • deg (TJ) - deg (N).
  • N (x) is fixed and constant, at least when working on a given elliptic curve.
  • the adapted Montgomery algorithm is very often used for software implementations of cryptosystems (set of an encryption / decryption process and a signature / authentication process) on elliptic curves such as ECDSA, using polynomial representations. see for example D3: IEEE Std 1363-2000 standard specifications for public-key cryptography, New York, 2000).
  • the modular calculation method on polynomials according to Montgomery is certainly effective, but it has the disadvantage of introducing during the calculation an error factor, known as the Montgomery constant, 'error factor that it is necessary to correct at the end of a calculation to obtain a correct result.
  • a first object of the invention is to propose, for the implementation of a cryptographic process, an alternative to the Montgomery process which is at least as efficient, in terms of resource use or calculation time, but not having the drawbacks of Montgomery's calculation process.
  • the invention determines the integer part of the quotient of two polynomials, and can be used to perform more complex operations, including modular operations in the body of the polynomials.
  • the practical implementation of such an operation does not require more resources, and can be executed as quickly as the Montgomery algorithm.
  • the method according to the invention produces an exact result, it does not introduce any error and no error correction is necessary at the end of the method; the memory requirements for the data and in ROM for the code are therefore lower than for the known equivalent methods, in particular the Montgomery algorithm. This is particularly interesting for constrained applications (eg smart card).
  • the method according to the invention is in practice based on a modular division method on integers, a method said from left to right described by Barrett in document D4 (Barrett, P: Implementing the Rivest Shamir and Adleman public key encryption algorithm on a standard digital processor, CRYPTO'86, volume 263 of Lecture Notes in Computer Science, Springer Verlag 1987, pp 311-323).
  • Barrett's algorithm is based on the school division method, which consists in zeroing the most significant bits of the numerator, then adding or subtracting a multiple of the denominator.
  • the Barrett algorithm is modified according to the invention to perform the computation of a quotient in the field F p [x] of the polynomials (ie the set of polynomials whose coefficient of each monomial is an integer between 0 and p -1).
  • Q (x) by the following relation:
  • Np (x) we denote that the polynomial N (x) is of size p.
  • ⁇ ⁇ (x) and (pp-i (x) are respectively the quotient and the remainder of the division of U (x) by xP.
  • T ⁇ (x) and ⁇ p_ ⁇ (x) are respectively the quotient and the remainder of the division of ⁇ P + ⁇ by N (x).
  • the method according to the invention can be implemented in any polynomial of t-bit architecture, for example 32 bits, in which the polynomial modular multiplication is implemented.
  • the method according to the invention is in particular advantageously usable for achieving modular polynomial reductions in the body F2 [x].
  • the notation IX 1 signifies an integer part by excess of X.
  • the result of the polynomial addition of two polynomials of degree p is a polynomial of degree p (same number of bits in its binary representation). On integers, the result of an addition can have a bit of more in its binary representation because of a possible propagation of restraint. * The operation " ⁇ todulo" (the remainder of the division of two polynomials) gives a polynomial of degree strictly smaller than the divider called module. This means that the binary vector representing the remainder always has one bit less than the vector representing the module. * On integers, the rest is smaller than the module but can have the same number of bits in its binary representation.
  • Equation 2 can be carried out by interlacing the multiplication from the highest index of A to the lowest with the reduction by N (x).
  • the first calculation A pa (x) B (x) is taken out of the loop on i (see algorithm 2) so that the loop on i can start with the calculation of the quotient (Q (x)) and the two calculations of U (x) in lines 3 and 5 of algorithm 1 can be grouped in line
  • (HI, LO) is a virtual register of 2t bits (such a register is conventional in a RISC architecture realizing a multiplication of t * t bits with a result on 2t bits) which corresponds to the value resulting from a concatenation of two registers HI and LO, each of t bits.
  • HI and LO are respectively the upper part (the most significant bits) and the lower part (the least significant bits) of the 2t-bit register (HI, LO).
  • the operation (HI, LO) / ⁇ A®B is a calculation of multiplication and accumulation of the result in HI, LO
  • the algorithm 4 also shows the number of multiplication and accumulation instructions without deductions (column # ®) and the number of accesses to the memory (columns #Load and #Store).
  • column # ® the number of multiplication and accumulation instructions without deductions
  • #Load and #Store the number of accesses to the memory
  • the code for algorithm 4 above can be compacted by calculating Ai (x) .B (x) interleaved with Q (x) .N (x) and in reverse order (see algorithm 5), in which j is decremented in algorithm 5, line 11, unlike algorithm 4, line 17: we first calculate Ai.B [pl] and Q (x) .N [pl]. This is possible because there is no propagation of restraint when working on F 2 [ ⁇ ] ”'contrary to what happens when we work on integers.
  • U sup is simply ((HI, LO)) / (A [i] ® B [p-1]) ”(tl). Indeed, there is no influence of the term A [i] ®B [p-2] on the desired upper part of U (x) because the term
  • a [i] ®B [p-2] influences only the first t-1 bits of (U [p-1], U [p-2]) / A [i] ®B [pl]) and it doesn ' there is no propagation of restraint.
  • Another advantageous consequence of such a calculation is that there is no longer any need to calculate A p - ⁇ (x) B (x) in advance and no additional final reduction by Q (x) N (x) n ' is no longer necessary so that lines 1 to 8 and 26 to 35 of algorithm 4 are no longer necessary in algorithm 5.
  • N'o (line 9) is defined by the relation: N ' 0 ⁇ N [0] (_1) mod x fc .
  • the method according to the invention is similar to that of Montgomery in terms of number of operations of the multiplication and accumulation type without restraint and number of memory accesses.
  • the advantage of the proposed method is that it calculates exactly A (x) B (x) modulo N (x), which is not the case with the Montgomery method which calculates A (x) B (x) ⁇ (_ P> modulo N (x) (Dl).
  • the only possible drawback of the method according to the invention (it depends on the context) compared to the method of
  • Montgomery can be a slower extraction of Usup from the intermediate values of U (x) and also the right shift of t-1 bits when calculating Q.
  • This possible software disadvantage can be simply (with a low cost) taken into account in an implementation hardware. This is not the case to remove the bulky ⁇ (" P> from Montgomery's multiplication.
  • Table 1 shows the results, in terms of clock cycles, obtained from the Montgomery method (algorithm 6) and two versions of the method according to the invention (algorithms 4 and 5).
  • Table 1 gives an advantage to the Montgomery method. This is explained by the software complexity of the quotient evaluation on lines 10 and 26 of algorithm 4 and on line 8 of algorithm 5 compared to line 9 of algorithm 6 (Montgomery), the processor used that does not have instructions to take advantage of the new architecture proposed. However, this does not make any difference in a hardware implementation. Furthermore, remember that algorithms 4 and 5, according to the invention, have the advantage of providing an exact result. On the contrary, algorithm 6 provides a result to within a constant, which must be removed at the end of the algorithm (this is not included in algorithm 6 and must be added).
  • a second object of the invention is to propose a processor architecture which is particularly well suited to the implementation of a method according to the invention as described above, and in particular for the implementation of specific operations of the algorithms 4 and 5.
  • An example of an additional block according to the invention is shown in the attached single figure.
  • This architecture is to be considered as a specific block (coprocessor) that can be grafted onto an existing processor and suitable for carrying out elementary calculations (register loading, addition, multiplication, etc.).
  • the operation of this coprocessor will be detailed by taking as an example the operations of algorithm 5. Note that in the figure, only the data paths are represented. For the sake of simplification, in particular the means necessary for controlling the various elements of the coprocessor have not been shown.
  • the coprocessor in the figure is grafted onto the data path of an existing processor by way of an IN_BUS input bus and an "OUT_BUS" output bus.
  • the coprocessor includes a "Multiply-Accu” calculation circuit, two multiplexers MUXl and MUX2 and six registers (HI, LO), U, RBN, A, Q and »k.
  • the "Multiply-Accu” block is a purely combinatorial block taking as input 3 values (X, Y and Z) on two buses of size t-bits (X and Y) and one bus of size 2t bits and outputting the result (on 2t-bit) of the operation (X®Y ⁇ Z).
  • the MUXl multiplexer is a multiplexer with three inputs (0, 1, 2) and an output (all of 2t-bits), its output is connected to input Z of the Multiply-Accu "circuit.
  • the MUX2 multiplexer includes three inputs and an output of t-bits each, its output is connected to input X of the "Multiply-Accu" circuit.
  • the multiplexers MUXl, MUX2 are conventional circuits which, depending an external command connects one of their inputs to their output.
  • the block (HI, LO) is an internal 2t-bit register, comprising a 2t-bit input connected to the output of the "Multiply-Accu circuit and a 2t-bit output including the most significant t-bits are connected to the input of the bus 0UT_BUS.
  • the 2t-bits of the output of the block (HI, LO) are connected to input 0 of the multiplexer MUXl and the t least significant bits of the output of the block ( HI, LO) are connected to the t most significant bits of the input 1 of the multiplexer MUXl.
  • the block U is an internal register of t-bits comprising an input of t-bits connected to the bus IN_BUS and an output of t bits connected at the t most significant bits of inputs 1 and 2 of the multiplexer MUXl. The most significant t bits of input 2 of the multiplexer MUXl are forced to zero.
  • the register U also includes an initialization input RESET. is used to store the number U Colour used in algorithm 5.
  • the RBN register of t-bits includes an entry of t-bit s connected to the IN_BUS bus and a t-bit output connected to the Y input of the Multiply-Accu circuit. The RBN register is used to store the number B Cosmetic or the number Ntinct.
  • the t-bit register A includes a t-bit input connected to the IN_BUS bus and an output connected to input 0 of the MUX2 multiplexer. Register A is used to store the number Atinct.
  • the t-bit register Q includes a t-bit output connected to input 1 of the MUX2 multiplexer and a t-bit input connected to t-bits of weight t-1 to 2t-2 of the Multiply circuit output -Accu (the most significant bit 2t-l is zero and the least significant bits are not significant).
  • the Q register is used to store intermediate calculation data.
  • the register »k of t bits includes a 2t-bit input connected to the output of the register (HI, LO) and a t-bit output connected to input 2 of the MU 2 multiplexer.
  • the block» k is a register shift which takes an input value of 2t-bit, shifts it by k-bit to the right (which amounts to dividing the incoming number by 2k ) and gives a result of t-bit at output (the first t bits of the result of the division by 2 k ).
  • the memory read operations (involving Utinct, B Cosmetic, N Cosmetic and Atinct) load data into the registers U, RBN or A of size t , the data coming from an external memory (not shown) via the input bus "IN_BUS".
  • the data resulting from an operation in the coprocessor will be written in external memory via the bus "OUT_bus”.
  • the data to be written in external memory will always be stored in the "Hi" register (corresponding to the most significant t-bits of the register (HI, LO).
  • the operation of the coprocessor will now be described in the context of setting implementation of algorithm 5.
  • the coprocessor is most often not used for basic operations such as loop operations or the initialization of data in memory. 1, 2, 3, 4, 11 17 and 23 of FIG. 5 are not processed by the coprocessor but by the general processor with which it is associated.
  • the "master" processor executes the algorithm and calls from time to time to the coprocessor (and therefore controls the coprocessor) to carry out certain specific operations which will be described below. These specific operations could for example be called by instructions of the coprocessor type in a dedicated architecture or directly integrated into the instructions of the "master" processor.
  • Operation 1 corresponding to lines 5 and 6 of algorithm 5 is carried out as follows: a) the value U [p-1] is transferred from the external memory to the register U and the register RBN is set to zero by the RESET command so that the result of the multiplication carried out by the multiplier-accumulator is zero.
  • the MUXl is placed in position 2 in such a way that the output of the multiplier-accumulator returns the value of the register U (U [p-1]) which will then be stored in the register (HI, LO) which thus contains (0, U [p-1]).
  • the value U [p-2] is transferred from the external memory to the register U and the register RBN is set to zero by a RESET command so that the result of the multiplication is zero.
  • the MUXl is placed in position 1 in such a way that the output of the multiplier-accumulator returns the value of the register LO concatenated with that of the register U (U [p-2]). In the end, (HI, LO) will therefore contain (U [p-1], U [p-2]). It will be noted that operation 1, which corresponds to operations for loading data into memory, could be carried out by the "master" processor; however, it is used here in parallel to initialize the coprocessor before performing operation 2 below.
  • Operation 2 corresponding to line 7 of algorithm 5 simply consists in transferring the value of A [i] from the external memory to the register A of the present architecture via the "INJ3US" bus.
  • Operation 3 corresponding to line 8, 14 or 19 of algorithm 5 is simply done by: a) Transfer of B [p-1] (or B [j] and B [0] respectively to lines 14 and 19) from the external memory to the RBN register. b) MUX2 and MUXl are placed in position 0. c) the result at the output of the multiplier-accumulator is placed in the register (HI, L0)
  • Operation 5 corresponding to line 10 (or lines 15 or 20) of algorithm 5 is carried out as follows: a) N [p-1] (respectively N [j] and N [0] for the lines 15 and 20) is transferred to the RBN register. b) The MUXl is placed in position 0 and the MUX2 is placed in position 1. c) The result at the output of the multiplier-accumulator is placed in the register (HI, LO). Operation 6, corresponding to lines 12 and 13, is carried out as follows: a) The value U [j-1] is transferred from the external memory to the register U. b) The register RBN is set to zero (RESET ) so that the result of the multiplication is zero. c) The MUXl is placed in position 1 in such a way that the output of the multiplier-accumulator returns the value (LO, U [j-1]) which will then be stored in the register in dark gray (HI, LO).
  • Operation 7 corresponding to lines 16 or 21 is carried out as follows: HI is transferred to the external memory via the bus "0UT_BUS" at the desired location (U [j + 1] and U [l] respectively).
  • Operation 8 corresponding to line 18 is carried out as follows (operation on line 11 is identical but had been grouped with that of line 12 to do the work more quickly, operations can be simultaneous): a) registers U and RBN are reset (RESET). b) the MUXl is placed in position 1. c) the result at the output of the accumulator multiplier is stored in (HI, LO)
  • Operation 9 corresponding to line 22 can be done by performing an operation 8 followed by an operation 7 on U [0]. The two operations can be performed together if necessary to improve the speed.

Abstract

The invention relates to a cryptographic method wherein, in order to carry out a fully polynomial division of type Q (x) = [U (x) / N (x)], wherein Q (x), N (x) and U(x) are polynomials, respectively a result, dividend and a divider, multiplication of the two polynomial is carried out followed by displacement of the bits of the result of the multiplication. The following operation is performed on the body of the polynomials Fp[x]: formula (I). The invention also enables more complex operations to be carried out, including modular operations. The invention is an alternative to the Montgomery method and does not need any correction. It is useful, in particular, for cryptographic methods wherein polynomial operations are carried out on the body F2[x]. The invention also relates to an appropriate coprocessor for carrying out said method. Preferred application: chip cards.

Description

REDUCTION MODULAIRE POUR UN PROCEDE CRyPTOSRAPHIQUE, ET COPROCESSEUR POUR LA REALISATION D'UNE TELLE REDUCTION MODULAIRE MODULAR REDUCTION FOR A CRyPTOSRAPHIC PROCESS, AND CO-PROCESSOR FOR CARRYING OUT SUCH A MODULAR REDUCTION
La présente invention concerne un procédé cryptographique au cours duquel on réalise un division entière polynomiale de type Q (x) = L U(x) / N (x) J, où Q (x) , N(x) et U(x) sont des polynômes, respectivement un quotient, un diviseur et un dividende. L'invention concerne également un composant électronique comprenant des moyens de mise en œuvre d'un tel procédé. L'invention est notamment applicable pour la mise en œuvre de procédés cryptographiques du type à clé publique sur courbe elliptique, par exemple dans des cartes à puce. Les algorithmes à clé publique sur courbe elliptique permettent des applications cryptographiques de type chiffrement, signature numérique, authentification... Ils sont notamment très utilisés dans des applications de type carte à puce, parce qu'ils permettent d'utiliser des clés de faible longueur, autorisant des temps de traitement assez courts. Pour réaliser une réduction modulaire de type S = U mod N, il est connu de réaliser tout d'abord une division entière de type Q = L U/N J, visant à calculer le quotient Q défini par la relation Q*N+S = U, puis de déterminer le reste de la division entière, reste qui est égal au résultat de la réduction modulaire. Un procédé connu pour réaliser des divisions entières sur des nombres entiers est l'algorithme de Montgomery, dit de droite à gauche, décrit notamment dans Dl (Menezes, A., Van Oorschot, P., Vanstone, S. : Handbook of Applied Cryptography, CRC Press 1997) . La pratique montre cependant que, pour réaliser des calculs sur courbes elliptiques, on peut travailler soit sur des entiers (dans Zp) soit sur des polynômes dans Fq (x) , q étant un entier. Dans la présente invention, nous ne traiterons que le cas traitant des polynômes dans Fq(x) . Le procédé initial de Montgomery a donc été adapté pour la réalisation de calculs modulaires sur des polynômes dans le corps F2 [x] . Voir notamment à ce sujet D2 (Koç, c, Acar, T. : Montgomery multiplication in GF(2k), éd. : Designs, Codes and Cryptography, Volume 14, Boston 1998, pp 57-69) . Cet algorithme adapté réalise notamment une division entière polynomiale de U(x) par N(x) notée. Q{x) est défini par la relation U(x) = Q(x) .N(x) + S (x) , S(x) étant le reste de la division. La notation L A(x)/B(x) J signifie partie entière par défaut de A(x)/B(x) . S (x) est le reste de la division entière polynomiale, il est aussi égal au résultat de la réduction modulaire polynomiale U(x) mod N(x). Le degré du polynôme N(x) est noté deg(N). On définit également α = deg(TJ) - deg(N). Dans la plupart des applications, telles que les cryptosystèmes sur courbes elliptiques, N(x) est fixé et constant, du moins lorsqu'on travaille sur une courbe elliptique donnée. L'algorithme de Montgomery adapté est très souvent utilisé pour des implémentations logicielles de cryptosystèmes (ensemble d'un procédé de chiffrement / déchifrement et d'un procédé de signature / authentification) sur courbes elliptiques tels que ECDSA, utilisant des représentations polynômiales. voir par exemple à ce sujet D3 : IEEE Std 1363-2000 standard spécifications for public-key cryptography, New York, 2000) . Le procédé de calcul modulaire sur des polynômes selon Montgomery est certes efficace, mais il présente l'inconvénient d'introduire pendant le calcul un facteur d'erreur, connu sous le nom de constante de Montgomery,' facteur d'erreur qu'il est nécessaire de corriger à la fin d'un calcul pour obtenir un résultat correct. On constate dans la pratique que les étapes nécessaires à l'élimination du facteur d'erreur sont particulièrement consommatrices de temps de calcul et de ressources (place mémoire, nombre d'accès mémoire, nombre d'opérations à réaliser, etc.), ce qui peut être est rédhibitoire pour des applications telles que les cartes à puce où le temps et les ressources sont limitées. Un premier objet de l'invention est de proposer, pour la mise en œuvre d'un procédé cryptographique, une alternative au procédé de Montgomery au moins aussi performante, en terme d'utilisation des ressources ou de temps de calcul, mais ne présentant pas les inconvénients du procédé de calcul de Montgomery. L'invention détermine la partie entière du quotient de deux polynômes, et peut être utilisée pour réaliser des opérations plus complexes, y compris des opérations modulaires dans le corps des polynômes . Ainsi, selon l'invention, pour réaliser une division entière polynomiale de type Q (x) = L U(x)/N(x) J, où Q(x), N(x) et U{x) sont des polynômes, respectivement un résultat, un dividende et un diviseur, on réalise une multiplication de deux polynômes puis un décalage des bits du résultat de la multiplication. On réalise la multiplication des deux polynômes suivants : [U(x) / xpJ, correspondant au dividende décalé de p bits, p étant la taille du diviseur N, et xp P / N(x) , résultat de la division d'un monôme χP+β par le diviseur N, β étant un entier supérieur ou égal à α. On décale ensuite de β bits le résultat de la multiplication. On réalise finalement l'opération globale suivante :The present invention relates to a cryptographic method during which a polynomial integer division of the type Q (x) = LU (x) / N (x) J is carried out, where Q (x), N (x) and U (x) are polynomials, respectively a quotient, a divisor and a dividend. The invention also relates to an electronic component comprising means for implementing such a method. The invention is particularly applicable for the implementation of cryptographic methods of the public key type on an elliptical curve, for example in smart cards. Public key algorithms on an elliptical curve allow cryptographic applications such as encryption, digital signature, authentication, etc. They are particularly widely used in smart card applications, because they allow the use of short keys. , allowing fairly short processing times. To achieve a modular reduction of type S = U mod N, it is known to first of all carry out an integer division of type Q = LU / NJ, aimed at calculating the quotient Q defined by the relation Q * N + S = U , then determine the remainder of the whole division, which remains equal to the result of the modular reduction. A known method for performing whole divisions on whole numbers is the Montgomery algorithm, said from right to left, described in particular in Dl (Menezes, A., Van Oorschot, P., Vanstone, S.: Handbook of Applied Cryptography , CRC Press 1997). Practice shows, however, that, to carry out calculations on elliptic curves, one can work either on integers (in Zp) or on polynomials in Fq (x), q being an integer. In the present invention, we will only deal with the case dealing with polynomials in Fq (x). The initial Montgomery process has therefore been adapted for the realization of modular calculations on polynomials in the body F2 [x]. See in particular on this subject D2 (Koç, c, Acar, T.: Montgomery multiplication in GF (2 k ), ed.: Designs, Codes and Cryptography, Volume 14, Boston 1998, pp 57-69). This adapted algorithm notably performs a polynomial integer division of U (x) by N (x) noted. Q {x) is defined by the relation U (x) = Q (x) .N (x) + S (x), S (x) being the remainder of the division. The notation LA (x) / B (x) J means the default integer part of A (x) / B (x). S (x) is the remainder of the polynomial integer division, it is also equal to the result of the modular polynomial reduction U (x) mod N (x). The degree of the polynomial N (x) is noted deg (N). We also define α = deg (TJ) - deg (N). In most applications, such as cryptosystems on elliptic curves, N (x) is fixed and constant, at least when working on a given elliptic curve. The adapted Montgomery algorithm is very often used for software implementations of cryptosystems (set of an encryption / decryption process and a signature / authentication process) on elliptic curves such as ECDSA, using polynomial representations. see for example D3: IEEE Std 1363-2000 standard specifications for public-key cryptography, New York, 2000). The modular calculation method on polynomials according to Montgomery is certainly effective, but it has the disadvantage of introducing during the calculation an error factor, known as the Montgomery constant, 'error factor that it is necessary to correct at the end of a calculation to obtain a correct result. We observes in practice that the steps necessary to eliminate the error factor consume particularly computation time and resources (memory space, number of memory accesses, number of operations to be performed, etc.), which can be prohibitive for applications such as smart cards where time and resources are limited. A first object of the invention is to propose, for the implementation of a cryptographic process, an alternative to the Montgomery process which is at least as efficient, in terms of resource use or calculation time, but not having the drawbacks of Montgomery's calculation process. The invention determines the integer part of the quotient of two polynomials, and can be used to perform more complex operations, including modular operations in the body of the polynomials. Thus, according to the invention, to perform a polynomial integer division of type Q (x) = LU (x) / N (x) J, where Q (x), N (x) and U {x) are polynomials, respectively a result, a dividend and a divisor, one carries out a multiplication of two polynomials then a shift of the bits of the result of the multiplication. The following two polynomials are multiplied: [U (x) / x p J, corresponding to the dividend shifted by p bits, p being the size of the divisor N, and x p P / N (x), result of the division d 'a monomial χP + β by the divisor N, β being an integer greater than or equal to α. The result of the multiplication is then shifted by β bits. The following global operation is finally carried out:
Comme on le verra mieux par la suite, la mise en œuvre pratique d'une telle opération ne nécessite pas plus de ressources, et peut être exécutée aussi rapidement que l'algorithme de Montgomery. Par ailleurs, comme on le verra plus en détail également par la suite, le procédé selon l'invention produit un résultat exact, il n'introduit pas d'erreur et aucune correction d'erreur n'est nécessaire à la fin du procédé ; les besoins en mémoire pour les données et en ROM pour le code sont donc plus faibles que pour les procédés équivalents connus, notamment l'algorithme de Montgomery. Ceci est notamment intéressant pour des applications à contrainte (ex carte à puce) . Le procédé selon l'invention est en pratique basé sur un procédé de division modulaire sur des entiers, procédé dit de gauche à droite décrit par Barrett dans le document D4 (Barrett, P : Implementing the Rivest Shamir and Adleman public key encryption algorithm on a standard digital procèssor, CRYPTO'86, volume 263 of Lecture Notes in Computer Science, Springer Verlag 1987, pp 311-323) . As will be seen more clearly below, the practical implementation of such an operation does not require more resources, and can be executed as quickly as the Montgomery algorithm. Furthermore, as will also be seen in more detail below, the method according to the invention produces an exact result, it does not introduce any error and no error correction is necessary at the end of the method; the memory requirements for the data and in ROM for the code are therefore lower than for the known equivalent methods, in particular the Montgomery algorithm. This is particularly interesting for constrained applications (eg smart card). The method according to the invention is in practice based on a modular division method on integers, a method said from left to right described by Barrett in document D4 (Barrett, P: Implementing the Rivest Shamir and Adleman public key encryption algorithm on a standard digital processor, CRYPTO'86, volume 263 of Lecture Notes in Computer Science, Springer Verlag 1987, pp 311-323).
L'algorithme de Barrett est basé sur la méthode scolaire de division, consistant à mettre à zéro les bits de poids les plus forts du numérateur, puis à ajouter ou retrancher un multiple du dénominateur. L'algorithme de Barrett est modifié selon l'invention pour réaliser le calcul d'un quotient dans le corps Fp[x] des polynômes (ie l'ensemble des polynômes dont le coefficient de chaque monôme est un entier compris entre 0 et p-1) . On définit Q(x) par la relation suivante :Barrett's algorithm is based on the school division method, which consists in zeroing the most significant bits of the numerator, then adding or subtracting a multiple of the denominator. The Barrett algorithm is modified according to the invention to perform the computation of a quotient in the field F p [x] of the polynomials (ie the set of polynomials whose coefficient of each monomial is an integer between 0 and p -1). We define Q (x) by the following relation:
et on va montrer ci-dessous que, pour une valeur appropriée de β, Q(x) est égal au quotient Q(x) recherché défini par la relation Q(x) = L U(x) / N(x) J. Pour cela, on note Np(x) pour indiquer que le polynôme N(x) est de taille p. On définit par ailleurs : où Φα(x) et (pp-i (x) sont respectivement le quotient et le reste de la division de U(x) par xP. De la même manière on peut écrire : où Tβ (x) et λp_ι (x) sont respectivement le quotient et le reste de la division de χP+β par N(x) . On peut écrire : and we will show below that, for an appropriate value of β, Q (x) is equal to the quotient Q (x) sought defined by the relation Q (x) = LU (x) / N (x) J. For this, we denote Np (x) to indicate that the polynomial N (x) is of size p. We also define: where Φ α (x) and (pp-i (x) are respectively the quotient and the remainder of the division of U (x) by xP. In the same way we can write: where Tβ (x) and λp_ι (x) are respectively the quotient and the remainder of the division of χP + β by N (x). We can write :
(U(x) / xp) X (xp+β / N(x) ) Q(x) = x1"(U (x) / x p ) X (x p + β / N (x)) Q (x) = x 1 "
Les trois derniers termes du développement de Q(x) sont nuls si β > α. Dans ce cas, on a : The last three terms of the development of Q (x) are zero if β> α. In this case, we have:
Il n'y a pas d'intérêt à choisir β > α. De plus un tel choix demande plus de calcul que de choisir β = α puisque R{x) serait plus long. En d'autres termes, en choisissant β = = deg(U) - deg(N), le quotient Q(x) peut être calculé par 1 ' équation 1 :There is no point in choosing β> α. In addition, such a choice requires more calculation than choosing β = α since R {x) would be longer. In other words, by choosing β = = deg (U) - deg (N), the quotient Q (x) can be calculated by equation 1:
On rappelle que diviser un numérateur par xβ revient à décaler les bits du dit numérateur de β bits vers la droite. Par ailleurs, p, β et N(x) étant fixés, on peut calculer dans une phase initiale R(x) = L χP+b / N(x) J. Ainsi, selon le procédé de l'invention, le calcul du quotient se réduit à un décalage de p bits, une multiplication polynomiale T(x)*R{x) et un décalage de β bits . Le procédé selon l'invention, mettant en œuvre l'équation 1, est utilisable sur le corps Fp[x] des polynômes, quel que soit p. Le procédé selon l'invention peut être mis en œuvre dans tout polynôme d'architecture t-bits, par exemple 32 bits, dans lequel la multiplication modulaire polynomiale est implémentée. Le procédé selon l'invention est notamment avantageusement utilisable pour réaliser des réductions modulaires polynômiales dans le corps F2 [x] . Dans F2 [x] , les coefficients n^ du nombre polynomial N(x) = np.χP + np_ι.χP-1 + ... + n .x1 + no sont égaux soit à 1 soit à 0. Ceci donne une représentation binaire des polynômes dans F2_x] : les bits de poids les plus forts de la représentation (= un nombre binaire associé au polynôme) sont les coefficients associés aux monômes de plus forte puissance du polynôme. Par exemple, le polynôme x5 + x3 + 1 peut être représenté par le nombre binaire '101001'. La multiplication modulaire dans 2_x] est une des opérations les plus importantes dans la cryptographie sur courbes elliptiques sur le corps de Gallois GF(2P) de taille p. On va montrer ci-dessous qu'on peut obtenir, avec le procédé selon l'invention décrit de manière générale dans les paragraphes précédents, des performances similaires à ce qu'on peut obtenir en utilisant la multiplication modulaire de Montgomery dans GF(2) (voir Dl) . La multiplication modulaire polynomiale A(x)B(x) mod (x) peut être écrite comme une somme de produits : PA-I J J_ Q(x) = £ A±(x) x B(x) X xι mod N(x) = U(x) mod N(x) (E . 2) i=0 avec Aι(x) un polynôme de degré t-1, PA-I it A(x) = ∑ A±(x) X x , pA=rp /t], et pa le degré de 1=0 A(x). La notation I X 1 signifie partie entière par excès de X. Avant de décrire plus longuement la réduction modulaire dans F2[x] selon l'invention, il convient de rappeler quelques caractéristiques des calculs polynomiaux dans F2 (x) . * Le produit d'un polynôme de degré t-1 (qui peut être représenté comme un vecteur binaire de t bits) par un polynôme de degré n-1 est un polynôme de degré n+t-2 représenté comme un vecteur de n+t-1 bits . En comparaison, sur les entiers, le résultat du produit d'un nombre de t bits par un nombre de n bits est un entier de n+t bits. * Le résultat de l'addition polynomiale de deux polynômes de degré p est un polynôme de degré p (même nombre de bits dans sa représentation binaire) . Sur les entiers, le résultat d'une addition peut avoir un bit de plus dans sa représentation binaire à cause d'une éventuelle propagation de retenue. * L'opération "πtodulo" (le reste de la division de deux polynômes) donne un polynôme de degré strictement plus petit que le diviseur appelé module. Cela signifie que le vecteur binaire représentant le reste a toujours un bit de moins que le vecteur représentant le module. * Sur les entiers, le reste est plus petit que le module mais peut avoir le même nombre de bits dans sa représentation binaire. On va maintenant évaluer comment changer le quotient Q(x) de l'équation 1 (calcul général dans Fp[x]) dans le cas de l'équation 2 (appliqué au calcul dans F2[x]). Pour réduire la mémoire nécessaire et le nombre d'accès à la mémoire, l'équation 2 peut être réalisée en entrelaçant la multiplication depuis le plus fort index de A jusqu'au plus faible avec la réduction par N(x) . On obtient l'algorithme 1 ci-dessous qui réalise une multiplication modulaire dans F2 (x) : 1: ϋ(x) = 0 2 : Pour i variant de pj - 1 à 0 3: U(x) = U(x) , t / Aι(x)B(x) 5: ϋ(x) = U(x) / Q(x)N(x) (équivalent à U(x) = U(x)mod N(x) ) 6: Fin pour 7: Retourner Q(x) A est le mot de poids i de A, / est la fonction logique XOR. On note que, pour réaliser une multiplication modulaire selon l'algorithme 1, seules des multiplications standard sont nécessaires, de même que dans 1 ' algorithme de Montgomery décrit dans D2. Pour la méthode de Montgomery, une multiplication polynomiale de t bits (avec des polynômes de degré t-1) et une division par xfc (un décalage de t bits) sont nécessaires (voir D2) . Pour l'algorithme 1, une multiplication polynomiale de t bits et une division par xt_1 sont nécessaires. Le reste des calculs est le même pour la méthode de l'invention et celle de Montgomery. Seul l'ordre dans lequel les calculs sont effectués est différent : dans l'invention, on commence à partir du mot de poids le plus fort ApA_! au lieu du mot de poids le plus faible Ao comme dans Montgomery. Dans l'algorithme 1, il est possible de réduire les accès mémoire quand on manipule U(x). Ceci est très important car les accès mémoire sont un important goulot d'étranglement en terme de réduction de vitesse d'exécution, particulièrement pour les applications cartes à puce. Pour cela, le premier calcul Apa(x)B(x) est sorti de la boucle sur i (cf algorithme 2) de sorte que la boucle sur i puisse commencer avec le calcul du quotient (Q(x)) et les deux calculs de U(x) aux lignes 3 et 5 de l'algorithme 1 peuvent être regroupés en la ligne It is recalled that dividing a numerator by xβ amounts to shifting the bits of said numerator by β bits to the right. Furthermore, p, β and N (x) being fixed, it is possible to calculate in an initial phase R (x) = L χP + b / N (x) J. Thus, according to the method of the invention, the calculation of the quotient is reduced to a shift of p bits, a polynomial multiplication T (x) * R {x) and a shift of β bits. The method according to the invention, implementing equation 1, can be used on the body Fp [x] of the polynomials, whatever p. The method according to the invention can be implemented in any polynomial of t-bit architecture, for example 32 bits, in which the polynomial modular multiplication is implemented. The method according to the invention is in particular advantageously usable for achieving modular polynomial reductions in the body F2 [x]. In F2 [x], the coefficients n ^ of the polynomial number N (x) = n p .χP + n p _ι.χP -1 + ... + n .x 1 + no are equal to either 1 or 0. This gives a binary representation of the polynomials in F2_x]: the most significant bits of the representation (= a binary number associated with the polynomial) are the coefficients associated with the highest power monomials of the polynomial. For example, the polynomial x 5 + x 3 + 1 can be represented by the binary number '101001'. The modular multiplication in 2 _x] is one of the most important operations in cryptography on elliptic curves on the body of Welsh GF (2P) of size p. We will show below that with the method according to the invention described in general in the preceding paragraphs, it is possible to obtain performance similar to that which can be obtained using the modular multiplication of Montgomery in GF (2). (see Dl). The polynomial modular multiplication A (x) B (x) mod (x) can be written as a sum of products: PA-I J J_ Q (x) = £ A ± (x) x B (x) X x ι mod N (x) = U (x) mod N (x) (E. 2) i = 0 with Aι (x) a polynomial of degree t-1, PA-I it A (x) = ∑ A ± (x) X x, p A = r p / t ], and p has the degree of 1 = 0 A (x). The notation IX 1 signifies an integer part by excess of X. Before describing the modular reduction in F 2 [x] according to the invention in more detail, it is worth recalling some characteristics of the polynomial calculations in F 2 (x). * The product of a polynomial of degree t-1 (which can be represented as a binary vector of t bits) by a polynomial of degree n-1 is a polynomial of degree n + t-2 represented as a vector of n + t-1 bits. In comparison, on integers, the result of the product of a number of t bits by a number of n bits is an integer of n + t bits. * The result of the polynomial addition of two polynomials of degree p is a polynomial of degree p (same number of bits in its binary representation). On integers, the result of an addition can have a bit of more in its binary representation because of a possible propagation of restraint. * The operation "πtodulo" (the remainder of the division of two polynomials) gives a polynomial of degree strictly smaller than the divider called module. This means that the binary vector representing the remainder always has one bit less than the vector representing the module. * On integers, the rest is smaller than the module but can have the same number of bits in its binary representation. We will now evaluate how to change the quotient Q (x) of equation 1 (general calculation in F p [x]) in the case of equation 2 (applied to the calculation in F2 [x]). To reduce the memory required and the number of accesses to memory, Equation 2 can be carried out by interlacing the multiplication from the highest index of A to the lowest with the reduction by N (x). We obtain algorithm 1 below which performs a modular multiplication in F2 (x): 1: ϋ (x) = 0 2: For i varying from pj - 1 to 0 3: U (x) = U (x) , t / Aι (x) B (x) 5: ϋ (x) = U (x) / Q (x) N (x) (equivalent to U (x) = U (x) mod N (x)) 6: End for 7: Return Q (x) A is the weight word i of A, / is the logic function XOR. We note that, to achieve a modular multiplication according to algorithm 1, only standard multiplications are necessary, as in the Montgomery algorithm described in D2. For Montgomery's method, a polynomial multiplication of t bits (with polynomials of degree t-1) and a division by x fc (an offset of t bits) are necessary (see D2). For algorithm 1, a polynomial multiplication of t bits and a division by x t_1 are necessary. The rest of the calculations are the same for the method of the invention and that of Montgomery. Only the order in which the calculations are performed is different: in the invention, one starts from the most significant word A pA _ ! instead of the least significant word Ao as in Montgomery. In algorithm 1, it is possible to reduce memory accesses when handling U (x). This is very important because memory accesses are a major bottleneck in terms of reduction in execution speed, particularly for smart card applications. For this, the first calculation A pa (x) B (x) is taken out of the loop on i (see algorithm 2) so that the loop on i can start with the calculation of the quotient (Q (x)) and the two calculations of U (x) in lines 3 and 5 of algorithm 1 can be grouped in line
5 de l'algorithme 2 ci-dessous (multiplication entrelacée dans F2 (x) ) : 1: U(x) = ApA-1(x) .B(x) 2 Pour i variant de PA-2 à 0 3 Q(x) = L (T(x) .R(x))/χt-l J 4 Pour j variant de 0 à PN-I 5 U(x) = [U(x) / Q(x)Nj (x)] ,χt- (j+l) / Ai(x) .B(j) .xfc 6 Fin pour j 7 Fin pour i 8 Q = L (T(x) .R(x))/χt-l J 9 U(x) = U(x) / Q(χ) .N(x) Ces modifications nécessitent une réduction finale en dehors de la boucle i (lignes 8 et 9 de l'algorithme 2). Le seul désavantage d'entrelacer la multiplication et la phase de réduction en utilisant une unique boucle j est que le nombre de Nj (x) et de Bj (x) doit être identique (PB = PN) r signifiant que si, par exemple, le degré de B (x) est plus petit que celui de N(x), on doit compléter par des zéros lorsqu'on le mémorise dans les B[j]. Cependant, ceci n'influence pas la vitesse des implémentations pratiques puisque B(x) est normalement considéré de taille identique à N(x) . Une implémentation logicielle de l'algorithme 2 sur un processeur d'architecture t-bits va maintenant être décrite. Pour des soucis de clarté et de facilité de comparaison avec une implémentation existante, on supposera dans l'exemple ci-dessous que p = p& = PN, en d'autres termes que les nombres A et N sont de p bits. Le détail de 1 ' implémentation donnée à titre d'exemple correspond à l'algorithme 4. Dans cet algorithme 4, (HI, LO) est un registre virtuel de 2t bits (un tel registre est classique dans une architecture RISC réalisant une multiplication de t*t bits avec un résultat sur 2t bits) qui correspond à la valeur résultant d'une concaténation de deux registres HI et LO, chacun de t bits. HI et LO sont respectivement la partie supérieure (les bits de poids les plus forts) et la partie inférieure (les bits de poids les plus faibles) du registre (HI, LO) de 2t bits. L'expression " (HI, LO)»t" signifie que le contenu du registre virtuel (HI, LO) est décalé à droite de t bits, t étant la taille des registres, le résultat est HI = 0 et LO = HI . Dans l'algorithme 4, / représente une opération XOR bit à bit et ® représente une multiplication polynomiale dans F2_ ] sur des polynômes de degré au plus t-1.5 of algorithm 2 below (interleaved multiplication in F2 (x)): 1: U (x) = A pA-1 (x) .B (x) 2 For i varying from PA-2 to 0 3 Q (x) = L (T (x) .R (x)) / χt- l J 4 For j varying from 0 to PN-I 5 U (x) = [U (x) / Q (x) N j ( x)], χt- (j + l ) / Ai (x) .B (j) .x fc 6 End for j 7 End for i 8 Q = L (T (x) .R (x)) / χt- l J 9 U (x) = U (x) / Q (χ) .N (x) These modifications require a final reduction outside the loop i (lines 8 and 9 of algorithm 2). The only disadvantage of interleaving multiplication and the reduction phase using a single loop j is that the number of N j (x) and Bj (x) must be identical (P B = PN) r meaning that if, for example, the degree of B (x) is smaller than that of N (x), we must complete with zeros when it is stored in B [j]. However, this does not influence the speed of practical implementations since B (x) is normally considered to be the same size as N (x). A software implementation of algorithm 2 on a processor of t-bit architecture will now be described. For the sake of clarity and ease of comparison with an existing implementation, it will be assumed in the example below that p = p & = P N , in other words that the numbers A and N are p bits. The detail of the implementation given by way of example corresponds to algorithm 4. In this algorithm 4, (HI, LO) is a virtual register of 2t bits (such a register is conventional in a RISC architecture realizing a multiplication of t * t bits with a result on 2t bits) which corresponds to the value resulting from a concatenation of two registers HI and LO, each of t bits. HI and LO are respectively the upper part (the most significant bits) and the lower part (the least significant bits) of the 2t-bit register (HI, LO). The expression "(HI, LO)» t "means that the content of the virtual register (HI, LO) is shifted to the right by t bits, t being the size of the registers, the result is HI = 0 and LO = HI. In algorithm 4, / represents a bit-by-bit XOR operation and ® represents a polynomial multiplication in F 2 _] on polynomials of degree at most t-1.
L'opération (HI, LO)/ ≈ A®B est un calcul de multiplication et accumulation du résultat dans HI, LOThe operation (HI, LO) / ≈ A®B is a calculation of multiplication and accumulation of the result in HI, LO
(présent sur la plupart des processeurs RISCs ou DSP) où les retenues internes dans les multiplications et les additions sont invalidées . Une représentation algorithmique de ce calcul (HI, LO)/ = A ® B est montrée à l'algorithme 3 ci-dessous.(present on most RISCs or DSP processors) where the internal deductions in the multiplications and the additions are invalidated. A representation algorithmic of this calculation (HI, LO) / = A ® B is shown in algorithm 3 below.
Pour i variant de 0 à t-1 (HI,LO) = (HI,L0) / ( (A. ( (B» i) ET 1)) « i) Fin pour i Note : ((B»i)ET 1) est en pratique le iè e bit de BFor i varying from 0 to t-1 (HI, LO) = (HI, L0) / ((A. ((B "i) AND 1))" i) End for i Note: ((B "i) AND 1) is in practice the i th bit of B
Un tel calcul est déjà implémenté comme une instruction dans certains processeurs de pointe pour carte à puce pour améliorer les calculs sur courbes elliptiques dans GF (2P) . Dans l'algorithme 4 également, la notation A[j] représente le polynôme Aj (x) de degré t-1 tel que décrit à l'équation 2 (EQ2) . Enfin, USUp utilisé aux lignes 10 et 26 de l'algorithme 4 est en général égal à la valeur courante dans LO. Ceci est seulement vrai si le bit de poids le plus fort (MSB) de N[p-1] correspond au degré le plus significatif de N(x). Dans les autres cas, Usup = (LO«k) + (Rs»(t-k)) où k est la valeur de décalage nécessaire pour aligner le coefficient de poids le plus fort de N(x) mémorisé dans N[p-1] sur le bit de poids le plus fort de N[p-1] . Sur 1 ' algorithme 4 est également montré le nombre d'instructions de multiplication et d'accumulation sans retenues (colonne #®) et le nombre d'accès à la mémoire (colonnes #Load et #Store) . En comparaison avec le document D2, nous avons exactement le même nombre de multiplications sans retenues, mais sans opérations XOR additionnelles. Pour être correct, la plupart des XOR sont inclus dans notre opération de multiplication et accumulations . Ci-dessus est détaillé l'algorithme 4 de multiplication modulaire entrelacée dans F2 [x] . #® #Load tstore 1 HI = 0 2 LO = 0 3 Ap-1 = A[p-1] 1 4 Pour j variant de 0 à p-1 5 (HI,LO)@ = Ap-1 © B[j] P P 6 RS = LO ; U[j] = RS 7 (HI, LO)»t 8 Fin pour j 9 Pour i variant de p-2 à 0 1( ): Q = (Usup ® R) » (t-1) p-1 1] L: Ai = A[i] p-1 1. >: HI = U[0] p-1 î: 3: LO = 0 1* 1: (HI, LO)® = Ai®B[0] p-1 p-1 u 5: ϋ[0] = LO p-i li 5: (HI, LO) » t Y 7: Pour j variant de 1 à p-1 lî 3: HI = U[j] (P-D2 lï 3: (HI, LO)θ = Ai®B[j] (P-D2 (P-D2 2C ): (HI, LO)® = Q®N[j-l] (p-1)2 (P-D2 2] L: RS= LO; U[j] = RS (p-l): 2. .: (HI, LO) » t 2: i : Fin pour j 2^ 1: (HI, LO)θ = Q®N[p-l] p-1 p-1 2< 5: Fin pour i 2f 5: Q = (Usup®R)»(t-l) 1 2" J: LO = U[0] 1 25 i: Pour j variant de 0 à p-2 2. ): HI = U[j+1] p-1 3C ): (HI, LO)/ = Q®N[j] p-1 p-1 3] .: U[j] = LO p-1 32 ï: (HI, LO)»t 3: i: Fin pour j 34 l: (HI, LO)/ = Q®N[p-l] 1 1 3ï >: ϋ[p-l] = LO total 2p +p 3p2+p p2+pSuch a calculation is already implemented as an instruction in some advanced chip card processors to improve the calculations on elliptic curves in GF (2P). Also in algorithm 4, the notation A [j] represents the polynomial Aj (x) of degree t-1 as described in equation 2 (EQ2). Finally, U SU p used in lines 10 and 26 of algorithm 4 is generally equal to the current value in LO. This is only true if the most significant bit (MSB) of N [p-1] corresponds to the most significant degree of N (x). In the other cases, U sup = (LO "k) + (Rs" (tk)) where k is the offset value necessary to align the strongest weight coefficient of N (x) stored in N [p-1 ] on the most significant bit of N [p-1]. The algorithm 4 also shows the number of multiplication and accumulation instructions without deductions (column # ®) and the number of accesses to the memory (columns #Load and #Store). In comparison with document D2, we have exactly the same number of multiplications without deductions, but without additional XOR operations. To be correct, most of the XORs are included in our multiplication and accumulations operation. Above is detailed the algorithm 4 of interleaved modular multiplication in F2 [x]. # ® #Load tstore 1 HI = 0 2 LO = 0 3 Ap-1 = A [p-1] 1 4 For j varying from 0 to p-1 5 (HI, LO) @ = Ap-1 © B [j ] PP 6 RS = LO; U [j] = RS 7 (HI, LO) »t 8 End for j 9 For i varying from p-2 to 0 1 (): Q = (Usup ® R)» (t-1) p-1 1] L: Ai = A [i] p-1 1.>: HI = U [0] p-1 î: 3: LO = 0 1 * 1: (HI, LO) ® = Ai®B [0] p- 1 p-1 u 5: ϋ [0] = LO pi li 5: (HI, LO) »t Y 7: For j varying from 1 to p-1 lî 3: HI = U [j] (PD 2 lï 3 : (HI, LO) θ = Ai®B [j] (PD 2 (PD 2 2C): (HI, LO) ® = Q®N [jl] (p-1) 2 (PD 2 2] L: RS = LO; U [j] = RS (pl) : 2..: (HI, LO) »t 2: i: End for j 2 ^ 1: (HI, LO) θ = Q®N [pl] p- 1 p-1 2 < 5: End for i 2f 5: Q = (Usup®R) "(tl) 1 2" J: LO = U [0] 1 25 i: For j varying from 0 to p-2 2 .): HI = U [j + 1] p-1 3C): (HI, LO) / = Q®N [j] p-1 p-1 3].: U [j] = LO p-1 32 ï: (HI, LO) »t 3: i: End for j 34 l: (HI, LO) / = Q®N [pl] 1 1 3ï>: ϋ [pl] = total LO 2p + p 3p 2 + pp 2 + p
Le code de l'algorithme 4 ci-dessus peut être compacté en calculant Ai(x).B(x) entrelacé avec Q(x).N(x) et dans l'ordre inverse (voir algorithme 5), dans lequel j est décrémenté dans l'algorithme 5, ligne 11, contrairement à l'algorithme 4, ligne 17 : on calcule d'abord Ai.B[p-l] et Q(x).N[p-l]. Cela est possible car il n'y a pas de propagation de retenue en travaillant sur F2[χ]»' contrairement à ce qui se passe lorsqu'on travaille sur des entiers. B(x) ayant un degré inférieur à N(x), on simplifie encore les calculs en alignant le modulus N(x) à gauche lorsqu'on le mémorise dans les N[j] (ie lorsqu'on mémorise ses coefficients N[j] dans le répertoire associé à N) , le coefficient supérieur de N (x) correspondant au bit de poids le plus fort (MSB) de N[p-1] (voir algorithme 5) . Ceci nécessite une seule adaptation (décalage à droite final) au tout dernier résultat si le module N est constant sur un ensemble de multiplications. Ceci est notamment le cas avec la plupart des algorithmes cryptographiques tels que ECDSA sur courbes elliptiques dans GF(2p) (D3) . Dans le cas présent (algorithme 5) , Usup est simplement ( (HI, LO) ) / (A[i] ® B[p-1]) »(t-l). En effet, il n'y a pas d'influence du terme A[i]®B[p-2] sur la partie supérieure souhaitée de U(x) car le termeThe code for algorithm 4 above can be compacted by calculating Ai (x) .B (x) interleaved with Q (x) .N (x) and in reverse order (see algorithm 5), in which j is decremented in algorithm 5, line 11, unlike algorithm 4, line 17: we first calculate Ai.B [pl] and Q (x) .N [pl]. This is possible because there is no propagation of restraint when working on F 2 [ χ ] ”'contrary to what happens when we work on integers. B (x) having a degree lower than N (x), the calculations are further simplified by aligning the modulus N (x) to the left when it is stored in the N [j] (ie when its coefficients N [ j] in the directory associated with N), the upper coefficient of N (x) corresponding to the most significant bit (MSB) of N [p-1] (see algorithm 5). This requires a single adaptation (final right shift) to the very last result if the module N is constant over a set of multiplications. This is particularly the case with most cryptographic algorithms such as ECDSA on elliptic curves in GF (2p) (D3). In the present case (algorithm 5), U sup is simply ((HI, LO)) / (A [i] ® B [p-1]) ”(tl). Indeed, there is no influence of the term A [i] ®B [p-2] on the desired upper part of U (x) because the term
A[i]®B[p-2] influence seulement les t-1 premiers bits de (U[p-1], U[p-2])/A[i]®B[p-l]) et il n'y a pas de propagation de retenue. Une autre conséquence avantageuse d'un tel calcul est qu'il n'y a plus besoin de calculer Ap-ι(x)B(x) en avance et aucune réduction finale additionnelle par Q(x)N(x) n'est plus nécessaire de sorte que les lignes 1 à 8 et 26 à 35 de l'algorithme 4 ne sont plus nécessaires dans l'algorithme 5. Ci-dessous est détaillé l'algorithme 5 de multiplication modulaire entrelacée, avec une boucle interne commençant dans l'ordre inverse.A [i] ®B [p-2] influences only the first t-1 bits of (U [p-1], U [p-2]) / A [i] ®B [pl]) and it doesn ' there is no propagation of restraint. Another advantageous consequence of such a calculation is that there is no longer any need to calculate A p -ι (x) B (x) in advance and no additional final reduction by Q (x) N (x) n ' is no longer necessary so that lines 1 to 8 and 26 to 35 of algorithm 4 are no longer necessary in algorithm 5. Below is detailed algorithm 5 of interleaved modular multiplication, with an internal loop starting in reverse order.
#® #Load #Store 1 Pour j variant de 0 à p-1 2 ϋ[j] = 0 p 3 Fin pour j 4 Pour i variant de p-1 à 0 5 HI = U [p-1] p 6 LO = ϋ [p-2] p 7 i = A [i] p 8 (HI , LO) / = Aj ®B [p-l] p p 9 Q = ( (HI , 0) 8Up®R) » (t-l) P 10 (HI , LO) / = Q®N [p-l] p p 11 Pour j variant de p-2 à 1 12 (HI, LO) « t 13 LO = U[j-1] p(p-2) 14 (HI, LO)/ = A±®B[j] P(P"2) p(p-2) 15 (HI, LO)/ = Q®N[j] p(p-2) p(p-2) 16 ϋ[j+l] = HI p(p-2 17 Fin pour j 18 (HI, LO) «t 19 (HI, LO)/ = Ai®B[0] P P 20 (HI, LO)/ = Q®N[0] P P 21 U[l] = HI P 22 U[0] = LO P 23 Fin pour i total 2 2+p 3p2+p P2+P# ® #Load #Store 1 For j varying from 0 to p-1 2 ϋ [j] = 0 p 3 End for j 4 For i varying from p-1 to 0 5 HI = U [p-1] p 6 LO = ϋ [p-2] p 7 i = A [i] p 8 (HI, LO) / = Aj ®B [pl] pp 9 Q = ((HI, 0) 8U p®R) ”(tl) P 10 (HI, LO) / = Q®N [pl] pp 11 For j varying from p-2 to 1 12 (HI, LO) “t 13 LO = U [j-1] p (p-2) 14 (HI, LO) / = A ± ®B [j] P (P" 2) p (p-2) 15 (HI, LO) / = Q®N [j] p (p-2) p (p-2) 16 ϋ [j + l] = HI p (p-2 17 End for j 18 (HI, LO) “T 19 (HI, LO) / = Ai®B [0] PP 20 (HI, LO) / = Q®N [0] PP 21 U [l] = HI P 22 U [0] = LO P 23 End for i total 2 2 + p 3p 2 + p P 2 + P
Comme on le voit sur l'algorithme 5, le nombre total d'opérations est identique à celui de l'algorithme 4, seul la taille du code est un peu plus petite, le code peut donc être mémorisé dans un ROM un peu plus petite. Excepté pour cette dernière raison, le choix entre les deux implémentations se fait en considérant l'architecture utilisée (CPU ou tout autre hardware spécifique) avec lequel les calculs sont effectués et l'application dans lequel il sera utilisé (par exemple ECDSA sur des courbes spécifiques) . L'algorithme 6 présente la multiplication modulaire de Montgomery implémentée de la même manière que l'algorithme de l'invention. La principale différence dans 1 ' implémentation de 1 ' invention par rapport à l' implémentation de Koç et Acar (D2) , est le mélange entre la multiplication et la phase de réduction de l'algorithme pour réduire le nombre d'accès à la mémoire. Le nombre d'accès à la mémoire est bien plus faible dans le cas de l'invention par rapport à celui nécessaire dans le cas de l 'implémentation de Koç et Acar. Ils nécessitent (6p2-p) chargement et (3p2+2p+l) opérations de mémorisation . Ci-dessous est détaillé l'algorithme 6 de multiplication modulaire entrelacée dans F2 [x] , selon Montgomery. #® #Load #store 1 Pour j variant de 0 à p-1 2 ϋ [j ] = 0 3 Fin pour j 4 Pour i variant de 0 à p-1 5 Ai = A[i] P 6 LO = U[0] P 7 HI = U[l] P 8 (Rt, LO)/ = Ai®B[0] P P 9 (HI, Q) = LO®N'0 P 10 (Rt, LO)/ = Q®N[0] P 11 (HI, LO) » t 12 Pour j variant de 1 à p-2 13 HI = U[j+1] p(p-2) 14 (HI, LO)/ = A±®B[j] p(p-2) p(p-2) 15 (HI, LO)/ = Q®N[j] p(p-2) p(p-2) 16 U[j-1] = LO p(p-2) 17 (HI, LO) » t 18 Fin pour j 19 (HI, LO) «t 20 (HI, LO)/ = Ai®B[p-l] P P 21 (HI, LO)/ = Q®N[p-l] P P 22 U[p-2] = LO P 23 U[p-1] ≈ HI P 24 Fin pour i total 2p2+p 3p2+p p2+pAs we see on algorithm 5, the total number of operations is identical to that of algorithm 4, only the size of the code is a little smaller, the code can therefore be stored in a ROM a little smaller . Except for this last reason, the choice between the two implementations is made by considering the architecture used (CPU or any other specific hardware) with which the calculations are carried out and the application in which it will be used (for example ECDSA on curves specific). The algorithm 6 presents the modular multiplication of Montgomery implemented in the same way as the algorithm of the invention. The main difference in the implementation of the invention compared to the implementation of Koç and Acar (D2), is the mixture between the multiplication and the reduction phase of the algorithm to reduce the number of accesses to the memory . The number of accesses to the memory is much lower in the case of the invention compared to that necessary in the case of the implementation of Koç and Acar. They require (6p 2 -p) loading and (3p 2 + 2p + l) storage operations. Below is detailed the algorithm 6 of interleaved modular multiplication in F2 [x], according to Montgomery. # ® #Load #store 1 For j varying from 0 to p-1 2 ϋ [j] = 0 3 End for j 4 For i varying from 0 to p-1 5 Ai = A [i] P 6 LO = U [0] P 7 HI = U [l] P 8 (Rt, LO) / = Ai®B [0] PP 9 (HI, Q) = LO®N ' 0 P 10 (Rt, LO) / = Q®N [0] P 11 ( HI, LO) ”t 12 For j varying from 1 to p-2 13 HI = U [j + 1] p (p-2) 14 (HI, LO) / = A ± ®B [j] p (p- 2) p (p-2) 15 (HI, LO) / = Q®N [j] p (p-2) p (p-2) 16 U [j-1] = LO p (p-2) 17 (HI, LO) ”t 18 End for j 19 (HI, LO)“ t 20 (HI, LO) / = Ai®B [pl] PP 21 (HI, LO) / = Q®N [pl] PP 22 U [p-2] = LO P 23 U [p-1] ≈ HI P 24 End for i total 2p 2 + p 3p 2 + pp 2 + p
N'o (ligne 9) est défini par la relation : N'0 ≈ N[0] (_1) mod xfc. Comme on le voit sur les algorithmes 4, 5 et 6, la méthode selon l'invention est similaire à celle de Montgomery en terme de nombre d'opérations de type multiplication et accumulation sans retenue et de nombre d'accès mémoire. L'avantage de la méthode proposée est qu'elle calcule exactement A(x)B(x) modulo N(x), ce qui n'est pas le cas avec la méthode de Montgomery qui calcule A(x) B(x) χ(_P> modulo N(x) (Dl) . Le seul inconvénient possible de la méthode selon l'invention (cela dépend du contexte) par rapport à la méthode deN'o (line 9) is defined by the relation: N ' 0 ≈ N [0] (_1) mod x fc . As can be seen in algorithms 4, 5 and 6, the method according to the invention is similar to that of Montgomery in terms of number of operations of the multiplication and accumulation type without restraint and number of memory accesses. The advantage of the proposed method is that it calculates exactly A (x) B (x) modulo N (x), which is not the case with the Montgomery method which calculates A (x) B (x) χ (_ P> modulo N (x) (Dl). The only possible drawback of the method according to the invention (it depends on the context) compared to the method of
Montgomery peut être une plus lente extraction de Usup à partir des valeurs intermédiaires de U(x) et également le décalage à droite de t-1 bits lors du calcul de Q. Ce possible inconvénient logiciel peut être simplement (avec un faible coût) pris en compte dans une implémentation hardware. Ce n'est pas le cas pour enlever l'encombrant χ("P> de la multiplication de Montgomery. Le tableau 1 montre les résultats, en termes de cycles d'horloges, obtenus à partir de la méthode de Montgomery (algorithme 6) et de deux versions de la méthode selon l'invention (algorithmes 4 et 5) . Ceci a été réalisé sur un simulateur modifié de l'architecture de processeur MIPS 32 optimisée pour Montgomery et utilisable pour des applications cartes à puce pour réaliser des opérations de multiplications sans retenues internes . multiplication multiplication 256 bits 512 bits algorithme 4 910 3230 algorithme 5 812 3028 algorithme 6 756 2916 tableau vitesse des algorithmes en cycles d'horlogeMontgomery can be a slower extraction of Usup from the intermediate values of U (x) and also the right shift of t-1 bits when calculating Q. This possible software disadvantage can be simply (with a low cost) taken into account in an implementation hardware. This is not the case to remove the bulky χ (" P> from Montgomery's multiplication. Table 1 shows the results, in terms of clock cycles, obtained from the Montgomery method (algorithm 6) and two versions of the method according to the invention (algorithms 4 and 5). This was carried out on a modified simulator of the MIPS 32 processor architecture optimized for Montgomery and usable for smart card applications to carry out operations of multiplication without internal deductions multiplication multiplication 256 bits 512 bits algorithm 4 910 3230 algorithm 5 812 3028 algorithm 6 756 2916 table speed of algorithms in clock cycles
Le tableau 1 donne un avantage à la méthode de Montgomery. Ceci s'explique par la complexité logicielle de l'évaluation du quotient aux lignes 10 et 26 de l'algorithme 4 et à la ligne 8 de l'algorithme 5 par rapport à la ligne 9 de l'algorithme 6 (Montgomery), le processeur utilisé ne possédant pas d'instructions permettant de tirer profit de la nouvelle architecture proposée. Ceci ne donne cependant aucune différence dans une implémentation hardware. Par ailleurs, rappelons que les algorithmes 4 et 5, selon l'invention, présentent l'avantage de fournir un résultat exact. Au contraire, l'algorithme 6 fournit un résultat à une constante près, qu'il faut enlever à la fin de l'algorithme (ceci n'est pas inclus dans l'algorithme 6 et doit être ajouté). Un deuxième objet de l'invention est de proposer une architecture de processeur particulièrement bien adaptée à la mise en œuvre d'un procédé selon l'invention tel que décrit ci-dessus, et notamment pour la mise en œuvre des opérations spécifiques des algorithmes 4 et 5. Un exemple d'un bloc additionnel selon l'invention est représenté sur la figure unique jointe. Cette architecture est à considérer comme un bloc spécifique (coprocesseur) que l'on peut greffer sur un processeur existant et adapté pour la réalisation de calculs élémentaires (chargement de registre, addition, multiplication, etc.). Le fonctionnement de ce coprocesseur sera détaillé en prenant comme exemple les opérations de l'algorithme 5. A noter que sur la figure, seuls sont représentés les chemins de données. Par souci de simplification, notamment les moyens nécessaires à la commande des différents éléments du coprocesseur n'ont pas été représentés. Le coprocesseur de la figure se greffe sur le chemin de donnée d'un processeur existant par la voie d'un bus d'entrée IN_BUS et d'un bus de sortie "OUT_BUS". Le coprocesseur comprend un circuit de calcul "Multiply-Accu", deux multiplexeurs MUXl et MUX2 et six registres (HI, LO) , U, RBN, A, Q et »k. Le bloc "Multiply-Accu" est un bloc purement combinatoire prenant en entrée 3 valeurs (X, Y et Z) sur deux bus de taille t-bits (X et Y) et un bus de taille 2t bits et donnant en sortie le résultat (sur 2t-bit) de l'opération (X®YθZ) . Le multiplexeur MUXl est un multiplexeur à trois entrées (0, 1, 2) et une sortie (toutes de 2t-bits) , sa sortie est connectée à l'entrée Z du circuit Multiply- Accu" . Le multiplexeur MUX2 comprend trois entrées et une sortie de t-bits chacune, sa sortie est connectée à l'entrée X du circuit "Multiply-Accu". Les multiplexeurs MUXl, MUX2 sont des circuits classiques qui, en fonction d'une commande externe relie une de leurs entrées à leur sortie. Le bloc (HI, LO) est un registre interne de 2t- bits, comprenant une entrée de 2t-bits connectée à la sortie du circuit "Multiply-Accu et une sortie de 2t-bits dont les t-bits de poids les plus forts sont connectés à l'entrée du bus 0UT_BUS . De plus, les 2t-bits de la sortie du bloc (HI, LO) sont connectés à l'entrée 0 du multiplexeur MUXl et les t bits de poids faibles de la sortie du bloc (HI, LO) sont connectés aux t bits de poids forts de l'entrée 1 du multiplexeur MUXl. Le bloc U est un registre interne de t-bits comprenant une entrée de t-bits connectée au bus IN_BUS et une sortie de t bits connectés aux t bits de poids f ibles des entrées 1 et 2 du multiplexeur MUXl . Les t bits de poids forts de l'entrée 2 du multiplexeur MUXl sont forcés à zéro. Le registre U comprend également une entrée d'initialisation RESET.Le registre U est utilisé pour mémoriser le nombre U[...] utilisé dans l'algorithme 5. Le registre RBN de t-bits comprend une entrée de t- bits connectée au bus IN_BUS et une sortie de t-bits connectée à l'entrée Y du circuit Multiply-Accu. Le registre RBN est utilisé pour mémoriser le nombre B[...] ou le nombre N[...] . Le registre A de t-bits comprend une entrée de t- bits connectée au bus IN_BUS et une sortie connectée à l'entrée 0 du multiplexeur MUX2. Le registre A est utilisé pour mémoriser le nombre A[...] . Le registre Q de t-bits comprend une sortie de t- bits connectée à l'entrée 1 du multiplexeur MUX2 et une entrée de t-bits connectée aux t-bits de poids t-1 à 2t-2 de la sortie du circuit Multiply-Accu (le bit de poids le plus fort 2t-l est nul et les bits de poids les plus faibles ne sont pas significatifs) . Le registre Q est utilisé pour mémoriser une donnée intermédiaire de calcul. Le registre »k de t bits comprend une entrée de 2t-bits connectée à la sortie du registre (HI, LO) et une sortie de t-bits connectée à l'entrée 2 du multiplexeur MU 2. Le bloc »k est un registre à décalage qui prend en entrée une valeur de 2t-bit, la décale de k-bit vers la droite (ce qui revient à diviser le nombre entrant par 2k) et donne un résultat de t-bit en sortie (les t premiers bits du résultat de la division par 2k) . Les opérations de lecture mémoire (faisant intervenir U [...], B[...], N[...] et A[...]) chargent une donnée dans les registres U, RBN ou A de taille t, les données venant d'une mémoire externe (non représentée) par l'intermédiaire du bus d'entrée "IN_BUS". Les données résultant d'une opération dans le coprocesseur seront écrites en mémoire externe par l'intermédiaire du bus "OUT_bus". Les données devant être écrites en mémoire externe seront toujours stockées dans le registre "Hi" (correspondant au t-bits de poids les plus forts du registre (HI, LO) . Le fonctionnement du coprocesseur va maintenant être décrit dans le cadre de la mise en œuvre de l'algorithme 5. Comme il a été dit précédemment, le coprocesseur n'est le plus souvent pas utilisé pour des opérations de base telles que des opérations de boucle ou l'initialisation de données en mémoire. Par exemple, les lignes 1, 2, 3, 4, 11 17 et 23 de la figure 5 ne sont pas traitées par le coprocesseur mais par le processeur général auquel il est associé. De manière générale, le processeur "maître" exécute l'algorithme et fait appel ponctuellement au coprocesseur (et donc pilote le coprocesseur) pour réaliser certaines opérations spécifiques que l'on va décrire ci-dessous. Ces opérations spécifiques pourraient par exemple être appelées par des instructions de type coprocesseur dans une architecture dédiée ou directement intégrées aux instructions du processeur "maître".Table 1 gives an advantage to the Montgomery method. This is explained by the software complexity of the quotient evaluation on lines 10 and 26 of algorithm 4 and on line 8 of algorithm 5 compared to line 9 of algorithm 6 (Montgomery), the processor used that does not have instructions to take advantage of the new architecture proposed. However, this does not make any difference in a hardware implementation. Furthermore, remember that algorithms 4 and 5, according to the invention, have the advantage of providing an exact result. On the contrary, algorithm 6 provides a result to within a constant, which must be removed at the end of the algorithm (this is not included in algorithm 6 and must be added). A second object of the invention is to propose a processor architecture which is particularly well suited to the implementation of a method according to the invention as described above, and in particular for the implementation of specific operations of the algorithms 4 and 5. An example of an additional block according to the invention is shown in the attached single figure. This architecture is to be considered as a specific block (coprocessor) that can be grafted onto an existing processor and suitable for carrying out elementary calculations (register loading, addition, multiplication, etc.). The operation of this coprocessor will be detailed by taking as an example the operations of algorithm 5. Note that in the figure, only the data paths are represented. For the sake of simplification, in particular the means necessary for controlling the various elements of the coprocessor have not been shown. The coprocessor in the figure is grafted onto the data path of an existing processor by way of an IN_BUS input bus and an "OUT_BUS" output bus. The coprocessor includes a "Multiply-Accu" calculation circuit, two multiplexers MUXl and MUX2 and six registers (HI, LO), U, RBN, A, Q and »k. The "Multiply-Accu" block is a purely combinatorial block taking as input 3 values (X, Y and Z) on two buses of size t-bits (X and Y) and one bus of size 2t bits and outputting the result (on 2t-bit) of the operation (X®YθZ). The MUXl multiplexer is a multiplexer with three inputs (0, 1, 2) and an output (all of 2t-bits), its output is connected to input Z of the Multiply-Accu "circuit. The MUX2 multiplexer includes three inputs and an output of t-bits each, its output is connected to input X of the "Multiply-Accu" circuit. The multiplexers MUXl, MUX2 are conventional circuits which, depending an external command connects one of their inputs to their output. The block (HI, LO) is an internal 2t-bit register, comprising a 2t-bit input connected to the output of the "Multiply-Accu circuit and a 2t-bit output including the most significant t-bits are connected to the input of the bus 0UT_BUS. In addition, the 2t-bits of the output of the block (HI, LO) are connected to input 0 of the multiplexer MUXl and the t least significant bits of the output of the block ( HI, LO) are connected to the t most significant bits of the input 1 of the multiplexer MUXl. The block U is an internal register of t-bits comprising an input of t-bits connected to the bus IN_BUS and an output of t bits connected at the t most significant bits of inputs 1 and 2 of the multiplexer MUXl. The most significant t bits of input 2 of the multiplexer MUXl are forced to zero. The register U also includes an initialization input RESET. is used to store the number U [...] used in algorithm 5. The RBN register of t-bits includes an entry of t-bit s connected to the IN_BUS bus and a t-bit output connected to the Y input of the Multiply-Accu circuit. The RBN register is used to store the number B [...] or the number N [...]. The t-bit register A includes a t-bit input connected to the IN_BUS bus and an output connected to input 0 of the MUX2 multiplexer. Register A is used to store the number A [...]. The t-bit register Q includes a t-bit output connected to input 1 of the MUX2 multiplexer and a t-bit input connected to t-bits of weight t-1 to 2t-2 of the Multiply circuit output -Accu (the most significant bit 2t-l is zero and the least significant bits are not significant). The Q register is used to store intermediate calculation data. The register »k of t bits includes a 2t-bit input connected to the output of the register (HI, LO) and a t-bit output connected to input 2 of the MU 2 multiplexer. The block» k is a register shift which takes an input value of 2t-bit, shifts it by k-bit to the right (which amounts to dividing the incoming number by 2k ) and gives a result of t-bit at output (the first t bits of the result of the division by 2 k ). The memory read operations (involving U [...], B [...], N [...] and A [...]) load data into the registers U, RBN or A of size t , the data coming from an external memory (not shown) via the input bus "IN_BUS". The data resulting from an operation in the coprocessor will be written in external memory via the bus "OUT_bus". The data to be written in external memory will always be stored in the "Hi" register (corresponding to the most significant t-bits of the register (HI, LO). The operation of the coprocessor will now be described in the context of setting implementation of algorithm 5. As mentioned above, the coprocessor is most often not used for basic operations such as loop operations or the initialization of data in memory. 1, 2, 3, 4, 11 17 and 23 of FIG. 5 are not processed by the coprocessor but by the general processor with which it is associated. Generally, the "master" processor executes the algorithm and calls from time to time to the coprocessor (and therefore controls the coprocessor) to carry out certain specific operations which will be described below. These specific operations could for example be called by instructions of the coprocessor type in a dedicated architecture or directly integrated into the instructions of the "master" processor.
L'opération 1 correspondant aux lignes 5 et 6 de l'algorithme 5 est réalisée de la manière suivante : a) la valeur U[p-1] est transférée de la mémoire externe vers le registre U et le registre RBN est mis à zéro par la commande RESET afin que le résultat de la multiplication réalisée par le multiplieur-accumulateur soit nul. Le MUXl est placé en position 2 de telle manière que la sortie du multiplieur-accumulateur renvoie la valeur du registre U (U[p-1]) qui sera alors stockée dans le registre (HI, LO) qui contient ainsi (0, U[p-1]). b) la valeur U[p-2] est transférée de la mémoire externe vers le registre U et le registre RBN est mis à zéro par une commande RESET afin que le résultat de la multiplication soit nul. Le MUXl est placé en position 1 de telle manière que la sortie du multiplieur- accumulateur renvoie la valeur du registre LO concaténée avec celle du registre U (U[p-2]). Au final, (HI,LO) va donc bien contenir (U [p-1] , U[p-2] ) . On notera que l'opération 1, qui correspond à des opérations de chargement de données en mémoire, pourrait être réalisée par le processeur "maître" ; elle est toutefois utilisée ici en parallèle pour initialiser le coprocesseur avant la réalisation de l'opération 2 ci- dessous .Operation 1 corresponding to lines 5 and 6 of algorithm 5 is carried out as follows: a) the value U [p-1] is transferred from the external memory to the register U and the register RBN is set to zero by the RESET command so that the result of the multiplication carried out by the multiplier-accumulator is zero. The MUXl is placed in position 2 in such a way that the output of the multiplier-accumulator returns the value of the register U (U [p-1]) which will then be stored in the register (HI, LO) which thus contains (0, U [p-1]). b) the value U [p-2] is transferred from the external memory to the register U and the register RBN is set to zero by a RESET command so that the result of the multiplication is zero. The MUXl is placed in position 1 in such a way that the output of the multiplier-accumulator returns the value of the register LO concatenated with that of the register U (U [p-2]). In the end, (HI, LO) will therefore contain (U [p-1], U [p-2]). It will be noted that operation 1, which corresponds to operations for loading data into memory, could be carried out by the "master" processor; however, it is used here in parallel to initialize the coprocessor before performing operation 2 below.
L'opération 2 correspondant à la ligne 7 de l'algorithme 5 consiste simplement à transférer la valeur de A[i] de la mémoire externe vers le registre A de la présente architecture via le bus "INJ3US".Operation 2 corresponding to line 7 of algorithm 5 simply consists in transferring the value of A [i] from the external memory to the register A of the present architecture via the "INJ3US" bus.
L'opération 3 correspondant à la ligne 8, 14 ou 19 de l'algorithme 5 se fait simplement par: a) Transfert de B[p-1] (ou B[j] et B[0] respectivement aux lignes 14 et 19) de la mémoire externe vers le registre RBN. b) Les MUX2 et MUXl sont placés en position 0. c) le résultat en sortie du multiplieur- accumulateur est placé dans le registre (HI,L0)Operation 3 corresponding to line 8, 14 or 19 of algorithm 5 is simply done by: a) Transfer of B [p-1] (or B [j] and B [0] respectively to lines 14 and 19) from the external memory to the RBN register. b) MUX2 and MUXl are placed in position 0. c) the result at the output of the multiplier-accumulator is placed in the register (HI, L0)
L'opération 4 correspondant à la ligne 9 de l'algorithme 5 est effectuée de la manière suivante: a) la valeur de la constante R, en provenance d'une mémoire externe, est placée dans le registre RBN via le bus externe "IN_BUS". b) Le registre U est remis à zéro (RESET) . c) Le registre à décalage (»k) est programmé pour un décalage de t-1 (k=t-l) bits. d) Les MUXl et MUX2 sont placés en position 2. e) La partie supérieure du résultat du calcul en sortie du multiplieur-accumulateur est stockée dans Q. Le choix de la partie supérieur du résultat est automatique (et immédiat) puisque la sortie supérieure du multiplieur-accumulateur correspondant à ce résultat est câblée directement à l'entrée du registre Q. Il est important de noter que le registre (HI, LO) ne doit pas être mis à jour par cette opération.Operation 4 corresponding to line 9 of algorithm 5 is carried out as follows: a) the value of the constant R, coming from an external memory, is placed in the register RBN via the external bus "IN_BUS ". b) The register U is reset to zero (RESET). c) The shift register (»k) is programmed for a shift of t-1 (k = t-l) bits. d) The MUXl and MUX2 are placed in position 2. e) The upper part of the result of the calculation at the output of the multiplier-accumulator is stored in Q. The choice of the upper part of the result is automatic (and immediate) since the upper output of the multiplier-accumulator corresponding to this result is wired directly to the input of the Q register. It is important to note that the register (HI, LO) must not be updated by this operation.
L'opération 5 correspondant à la ligne 10 (ou aux lignes 15 ou 20) de l'algorithme 5 est effectuée de la manière suivante: a) N[p-1] (respectivement N[j] et N[0] pour les lignes 15 et 20) est transféré dans le registre RBN. b) Le MUXl est placé en position 0 et le MUX2 est placé en position 1. c) Le résultat en sortie du multiplieur- accumulateur est placé dans le registre (HI, LO) . L'opération 6, correspondant aux lignes 12 et 13 est réalisée de la manière suivante: a) La valeur U[j-1] est transférée de la mémoire externe vers le registre U. b) Le registre RBN est mis à zéro (RESET) afin que le résultat de la multiplication soit nul. c) Le MUXl est placé en position 1 de telle manière que la sortie du multiplieur-accumulateur renvoie la valeur (LO, U[j-1]) qui sera alors stockée dans le registre en gris foncé (HI, LO) .Operation 5 corresponding to line 10 (or lines 15 or 20) of algorithm 5 is carried out as follows: a) N [p-1] (respectively N [j] and N [0] for the lines 15 and 20) is transferred to the RBN register. b) The MUXl is placed in position 0 and the MUX2 is placed in position 1. c) The result at the output of the multiplier-accumulator is placed in the register (HI, LO). Operation 6, corresponding to lines 12 and 13, is carried out as follows: a) The value U [j-1] is transferred from the external memory to the register U. b) The register RBN is set to zero (RESET ) so that the result of the multiplication is zero. c) The MUXl is placed in position 1 in such a way that the output of the multiplier-accumulator returns the value (LO, U [j-1]) which will then be stored in the register in dark gray (HI, LO).
L'opération 7 correspondant aux lignes 16 ou 21 est effectuée de la manière suivante: HI est transféré à la mémoire externe via le bus "0UT_BUS" à l'emplacement voulu (U[j+1] et U[l] respectivement) .Operation 7 corresponding to lines 16 or 21 is carried out as follows: HI is transferred to the external memory via the bus "0UT_BUS" at the desired location (U [j + 1] and U [l] respectively).
L'opération 8 correspondant à la ligne 18 est effectuée de la manière suivante (l'opération en ligne 11 est identique mais avait été regroupée avec celle de la ligne 12 pour effectuer le travail plus rapidement, opérations pouvant être simultanées) : a) Les registres U et RBN sont remis à zéro (RESET) . b) le MUXl est placé en position 1. c) le résultat en sortie du multiplieur accumulateur est stocké dans (HI, LO)Operation 8 corresponding to line 18 is carried out as follows (operation on line 11 is identical but had been grouped with that of line 12 to do the work more quickly, operations can be simultaneous): a) registers U and RBN are reset (RESET). b) the MUXl is placed in position 1. c) the result at the output of the accumulator multiplier is stored in (HI, LO)
L'opération 9 correspondant à la ligne 22 peut se faire en effectuant une opération 8 suivie d'une opération 7 sur U[0] . Les deux opérations peuvent être effectuées ensemble si nécessaire pour améliorer la vitesse.Operation 9 corresponding to line 22 can be done by performing an operation 8 followed by an operation 7 on U [0]. The two operations can be performed together if necessary to improve the speed.
Remarques : * les "sous opérations" a)...d) peuvent (doivent) en générale être effectuées simultanément (parallélisme) ou en utilisant une architecture "pipeline" donnant l'impression qu'elles s'effectuent réellement en une seule fois. * Les opérations nécessitant un transfert d'une mémoire externe de/vers un registre interne pourront être réalisées par des opérations de type coprocesseur ou processeur prenant en argument l'emplacement mémoire dans lequel il faut aller chercher ou mettre la valeur traitée (opérations 1, 2, 3, 5, 6 et 7) Notes: * the "sub operations" a) ... d) can (must) generally be carried out simultaneously (parallelism) or by using a "pipeline" architecture giving the impression that they are really carried out in one go. * The operations requiring a transfer from an external memory to / from an internal register can be carried out by operations of the coprocessor or processor type taking as an argument the memory location in which it is necessary to fetch or put the processed value (operations 1, 2, 3, 5, 6 and 7)

Claims

REVENDICATIONS
1. Procédé cryptographique caractérisé en ce que, pour réaliser une division entière polynomiale de type Q(x) = L ϋ(x) / N(x) J, où Q(x), U(x) et N(x) sont des polynômes, respectivement un résultat, un dividende et un diviseur, on réalise une multiplication de deux polynômes puis un décalage des bits du résultat de la multiplication . 1. Cryptographic method characterized in that, to perform a polynomial integer division of type Q (x) = L ϋ (x) / N (x) J, where Q (x), U (x) and N (x) are polynomials, respectively a result, a dividend and a divisor, we carry out a multiplication of two polynomials then an offset of the bits of the result of the multiplication.
2. Procédé selon la revendication 1, au cours duquel on réalise la multiplication des deux polynômes suivants : U(x) / xp , correspondant au dividende décalé de p bits, p étant la taille du diviseur N P+β / N(x)J, résultat de la division d'un monôme χP+P par le diviseur N, β étant un entier supérieur ou égal à α. 2. Method according to claim 1, during which the following two polynomials are multiplied: U (x) / x p , corresponding to the dividend shifted by p bits, p being the size of the divider N P + β / N (x ) J, result of the division of a monomial χP + P by the divisor N, β being an integer greater than or equal to α.
3. Procédé selon la revendication 2, dans lequel on décale de β bits le résultat de la multiplication. 3. Method according to claim 2, in which the result of the multiplication is shifted by β bits.
4. Procédé selon l'une des revendications 1 à 3, dans lequel on réalise l'opération suivante :4. Method according to one of claims 1 to 3, in which the following operation is carried out:
5. Procédé selon l'une des revendications précédentes, dans lequel : - le dividende est obtenu par la multiplication de deux polynômes A(x), B(x), - les polynômes A(x), B(x), le dividende U(x), le diviseur N(x) et le résultat S (x) sont des polynômes définis sur F2 [x] , à chaque polynôme étant associé un nombre binaire dont la valeur et le poids de chaque bit correspond à la valeur et au poids d'un coefficient du polynôme associé, et le quotient est calculé selon les étapes suivantes : El •: Initialisation des coefficients du polynôme U(X) 1: Pour j variant de 0 à p-1 2: U[j] = 0 3: Fin pour j 5. Method according to one of the preceding claims, in which: - the dividend is obtained by the multiplication of two polynomials A (x), B (x), - the polynomials A (x), B (x), the dividend U (x), the divisor N (x) and the result S (x) are polynomials defined on F2 [x], with each polynomial being associated a binary number whose value and weight of each bit corresponds to the value and the weight of a coefficient of the associated polynomial, and the quotient is calculated according to the following steps: El •: Initialization of the coefficients of the polynomial U (X) 1: For j varying from 0 to p-1 2: U [j] = 0 3: End for j
E2 : Décrémentation de la variable i de p-1 à 0 et pour chaque valeur de i, réalisation des étapes suivantes (a à j) : 4: Pour i variant de p-1 à 0 a : initialisation des registres HI, LO, Ai 5 HI = U[p-1] 6 LO = U[p-2] 7 A± = A[i] b : multiplication sans retenue de Ai par B[p-1] et accumulation du résultat dans un registre virtuel (HI, LO) constitué des registres HI et LO 8: (HI, LO)/ = Ai®B[p-l] c : multiplication sans retenue de (HI, LO) SUp par , et mémorisation dans le registre Q du résultat décalé de t-1 bits vers la droite 9: Q = ((HI, LO) sup®R) » (t-1) d : multiplication sans retenue du registre Q par N[p-1], et mémorisation dans le registre virtuel (HI, LO) 10 (HI, LO)/ = Q®N[p-l] e : décrémentation de la variable j de p-2 à 0 et pour chaque valeur de j réalisation des étapes aa à ee suivantes : 11 Pour j variant de p-2 à 1 aa : décalage de t bits vers la gauche dans le registre virtuel (HI, LO) 12: (HI, LO) « t bb : mémorisation du coefficient de polynôme U[j-1] dans le registre LO 13: LO = ϋ[j-l] ce : multiplication sans retenue de Ai par B[j] et accumulation du résultat dans le registre virtuel (HI, LO) 14: (HI, LO)/ = Ai®B[j] dd : multiplication sans retenue de Q par N[j] et accumulation du résultat dans le registre virtuel (HI, LO) 15: (HI, LO)/ = Q®N[j] ee : mémorisation du contenu du registre HI dans le coefficient de polynôme U[j+1] 16: ϋ[j+l] = HI 17: Fin pour j f : décalage de t bits vers la gauche du contenu du registre virtuel (HI, LO) 18: (HI, LO) «t g : multiplication sans retenue de Ai par B[0] et accumulation du résultat dans le registre virtuel (HI, LO) 19: (HI, LO)/ = Ai®B[0] h : multiplication sans retenue de Q par N[0] et accumulation du résultat dans le registre virtuel (HI, LO) 20: (HI, LO)/ = Q®N[0] i : mémorisation du registre HI dans le coefficient de polynôme [11 21: U[l] = HI j : mémorisation du registre LO dans le coefficient de polynôme U[0] 22: U[0] = LO 23: Fin pour i 6. Procédé selon l'une des revendications 1 à 4, dans lequel : - le dividende est obtenu par la multiplication de deux polynômes A(x), B(x), - les polynômes A(x) , B(x), le dividende U(x), le diviseur N(x) et le résultat S (x) sont des polynômes définis sur F2 [x] , à chaque polynôme étant associé un nombre binaire dont la valeur et le poids de chaque bit correspond à la valeur et au poids d'un coefficient du polynôme associé, et le quotient est calculé selon les étapes suivantes :E2: Decrementation of the variable i from p-1 to 0 and for each value of i, realization of the following steps (a to j): 4: For i varying from p-1 to 0 a: initialization of the registers HI, LO, Ai 5 HI = U [p-1] 6 LO = U [p-2] 7 A ± = A [i] b: unrestricted multiplication of Ai by B [p-1] and accumulation of the result in a virtual register ( HI, LO) consisting of the registers HI and LO 8: (HI, LO) / = Ai®B [pl] c: multiplication without restraint of (HI, LO) SU p by, and memorization in the register Q of the result shifted by t-1 bits to the right 9: Q = ((HI, LO) sup ®R) ”(t-1) d: multiplication without restraint of the Q register by N [p-1], and storage in the virtual register ( HI, LO) 10 (HI, LO) / = Q®N [pl] e: decrementing the variable j from p-2 to 0 and for each value of j carrying out the following steps aa to ee: 11 For j varying from p-2 to 1 aa: shift of t bits to the left in the virtual register (HI, LO) 12: (HI, LO) “t bb: memorization of the coefficient of polynomial U [j-1] in the register LO 13: LO = ϋ [jl] ce: multiplication without restraint of Ai by B [j] and accumulation of the result in the virtual register (HI, LO) 14: (HI, LO ) / = Ai®B [j] dd: multiplication without restraint of Q by N [j] and accumulation of the result in the virtual register (HI, LO) 15: (HI, LO) / = Q®N [j] ee : storage of the content of the HI register in the polynomial coefficient U [j + 1] 16: ϋ [j + l] = HI 17: End for jf: shift of t bits to the left of the content of the virtual register (HI, LO ) 18: (HI, LO) “tg: multiplication without restraint of Ai by B [0] and accumulation of the result in the virtual register (HI, LO) 19: (HI, LO) / = Ai®B [0] h : multiplication without restraint of Q by N [0] and accumulation of the result in the virtual register (HI, LO) 20: (HI, LO) / = Q®N [0] i: memorization of the register HI in the coefficient of polynomial [11 21: U [l] = HI j: storage of the register LO in the polynomial coefficient U [0] 22: U [0] = LO 23: End for i 6. Method according to one of claims 1 to 4, in which: - the dividend is obtained by the multiplication of two polynomials A (x), B (x), - the polynomials A (x), B (x), the dividend U (x), the divisor N (x) and the result S (x) are polynomials defined on F 2 [x], with each polynomial being associated a binary number whose value and weight of each bit corresponds to the value and weight of a coefficient of the associated polynomial, and the quotient is calculated according to the following steps :
El : Initialisation des registres HI, LO, p_ι 1 HI = 0 2 LO = 0 3 Ap-l = A[p-1]El: Initialization of registers HI, LO, p _ι 1 HI = 0 2 LO = 0 3 Ap-l = A [p-1]
E2 : Incrémentation de la variable j de 0 à p-1 et pour chaque valeur de j, réalisation des étapes suivantes (a à c) : 4: Pour j variant de 0 à p-1 a : multiplication sans retenue de Ap-l par B[j] et mémorisation du résultat dans un registre virtuel (HI, LO) constitué des registres HI et LO du coefficient de polynôme 6: RS = LO ; ϋ[j] = RS c : décalage de t bits vers la droite dans le registre (HI, LO) 7: (HI, LO)»t 8: Fin pour j E3 : Décrémentation de la variable i de p-2 à 0 et pour chaque valeur de i, réalisation des étapes suivantes (al à gl) : 9: Pour i variant de p-2 à 0 al : multiplication sans retenue de ϋsup par R et mémorisation du résultat décalé de t bits vers la droite dans le registre virtuel (HI, LO) 10: Q = (Usup ® R) » (t-1) bl : initialisation des registres Ai, HI, LO 11: Ai = A[i] 12: HI = U[0] 13: LO = 0 cl : multiplication sans retenue de Ai par B[0] et mémorisation du résultat dans le registre virtuel (HI, LO) 14: (HI, LO)Θ = Ai®B[0] dl : initialisation du coefficient de polynôme U[0] 15: U[0] = LO el : décalage de t bits vers la droite dans le registre (HI, LO) 16: (HI, LO) » t fl : Incrémentation de la variable j de 0 à p-1 et pour chaque valeur de j, réalisation des étapes suivantes (aa à ee) : 17: Pour j variant de 1 à p-1 aa : initialisation du registre HI 18: HI = U[j] bb : multiplication sans retenue de Ai par B[j] et mémorisation du résultat dans le registre virtuel (HI, LO) 19: (HI, LO)θ = Ai®B[j] ce : multiplication sans retenue de Q par N[j-1] et mémorisation du résultat dans le registre virtuel (HI, LO) 20: (HI, LO)θ = Q®N[j-l] dd : initialisation du registre RS et du coefficient de polynôme U[j ] 21: RS= LO; ϋ[j] = RS ee : décalage de t bits vers la droite dans le registre (HI, LO) 22: (HI, LO) » t 23: Fin pour j gl : multiplication sans retenue de Q par N[p-1] et mémorisation du résultat dans le registre virtuel (HI, LO) 24: (HI, LO)θ = Q®N[p-l] 25: Fin pour iE2: Incrementation of the variable j from 0 to p-1 and for each value of j, realization of the following steps (a to c): 4: For j varying from 0 to p-1 a: multiplication without restraint of Ap-l by B [j] and storage of the result in a virtual register (HI, LO) consisting of the registers HI and LO of the polynomial coefficient 6: RS = LO; ϋ [j] = RS c: shift of t bits to the right in the register (HI, LO) 7: (HI, LO) ”t 8: End for j E3: Decrease of the variable i from p-2 to 0 and for each value of i, carrying out the following steps (al to gl): 9: For i varying from p-2 to 0 al: multiplication without restraint of ϋsup by R and memorization of the result shifted by t bits to the right in the virtual register (HI, LO) 10: Q = (Usup ® R) ”(t-1) bl: initialization of the registers Ai, HI, LO 11: Ai = A [i] 12: HI = U [0] 13: LO = 0 cl: unrestricted multiplication of Ai by B [0] and storage of the result in the virtual register (HI, LO) 14: (HI, LO) Θ = Ai®B [0] dl: initialization of the polynomial coefficient U [0] 15: U [0] = LO el: shift of t bits to the right in the register (HI, LO) 16: (HI, LO) »t fl: Increment of the variable j from 0 to p-1 and for each value of j, carrying out of the following steps (aa to ee): 17: For j varying from 1 to p-1 aa: initialization of the register HI 18: HI = U [j] bb: multiplication without restraint of Ai by B [j ] and storage of the result in the virtual register (HI, LO) 19: (HI, LO) θ = Ai®B [j] ce: multiplication without restraint of Q by N [j-1] and storage of the result in the register virtual (HI, LO) 20: (HI, LO) θ = Q®N [jl] dd: initialization of the register RS and the polynomial coefficient U [j] 21: RS = LO; ϋ [j] = RS ee: shift of t bits to the right in the register (HI, LO) 22: (HI, LO) ”t 23: End for j gl: multiplication without restraint of Q by N [p-1 ] and storage of the result in the virtual register (HI, LO) 24: (HI, LO) θ = Q®N [pl] 25: End for i
E4 : multiplication sans retenue de ϋSUp par R, et mémorisation dans le registre Q du résultat décalé de t-1 bits vers la droite 26: Q = (Usup®R)»(t-l) E5 : initialisation du registre LO 27: LO = U[0]E4: multiplication without restraint of ϋ SU p by R, and storage in the register Q of the result shifted by t-1 bits to the right 26: Q = (Usup®R) ”(tl) E5: initialization of the register LO 27: LO = U [0]
E6 : Incrémentation de la variable j de 0 à p-2 et pour chaque valeur de j, réalisation des étapes suivantes (a2 à d2) : 28: Pour j variant de 0 à p-2 a2 : initialisation du registre HI 29: HI = U[j+1] b2 : multiplication sans retenue de Q par N[j] et mémorisation du résultat dans le registre virtuel (HI, LO) 30: (HI, LO)/ = Q®N[j] c2 : initialisation du coefficient de polynôme U[j] 31: U[j] = LO d2 : décalage de t bits vers la droite dans le registre (HI, LO) 32: (HI, LO)»t 33: Fin pour j E7 : multiplication sans retenue de Q par N[j] et mémorisation du résultat dans le registre virtuel (HI, LO) 34: (HI, LO)/ = Q®N[p-l] E8 : mémorisation du coefficient U[p-1] contenu dans le registre LO 35: U[p-1] = LO 7. Coprocesseur comprenant des moyens (RU, RBN, A, Q) pour mémoriser et fournir des nombres de t bits, caractérisé en ce qu'il comprend également : - un moyen (registre »k) pour mémoriser et décaler de k bits un résultat partiel précédemment obtenu (Ai®B[p-l]), - un circuit de calcul pour réaliser une première multiplication polynomiale (®) du résultat partiel précédemment obtenu et décalé par un premier nombre (R) de t bits et mémoriser (registre Q) les t bits de poids forts (HI) du résultat de la première multiplication. 8. Coprocesseur selon la revendication 7, dans lequel le circuit de calcul réalise également une deuxième multiplication polynomiale (Ai®B[p-l]) d'un deuxième nombre (Ai) de t bits par un troisième nombre (B[p-1]) de t-bits pour produire le résultat partiel précédemment obtenu. 9. Coprocesseur selon la revendication 7 ou 8, dans lequel le circuit de calcul réalise également : - une troisième multiplication polynomiale des t bits de poids forts (HI) du résultat de la première multiplication par un quatrième nombre de t-bits (N[p-1]), et une addition du résultat de la troisième multiplication et des bits de poids faibles (LO) du résultat de la première multiplication. 10. Composant électronique pour mettre en œuvre le procédé selon l'une des revendications 1 à β. 11. Composant électronique comprenant un coprocesseur selon l'une des revendications 7 à 9. 12. Carte à puce comprenant un composant électronique selon la revendication 10 ou selon la revendication 11. E6: Incrementation of the variable j from 0 to p-2 and for each value of j, realization of the following steps (a2 to d2): 28: For j varying from 0 to p-2 a2: initialization of the HI register 29: HI = U [j + 1] b2: multiplication without restraint of Q by N [j] and storage of the result in the virtual register (HI, LO) 30: (HI, LO) / = Q®N [j] c2: initialization of the polynomial coefficient U [j] 31: U [j] = LO d2: shift of t bits to the right in the register (HI, LO) 32: (HI, LO) ”t 33: End for j E7: multiplication without Q being retained by N [j] and storage of the result in the virtual register (HI, LO) 34: (HI, LO) / = Q®N [pl] E8: storage of the coefficient U [p-1] contained in the register LO 35: U [p-1] = LO 7. Coprocessor comprising means (RU, RBN, A, Q) for storing and supplying numbers of t bits, characterized in that it also comprises: - a means (register »k) for storing and shifting by k bits a partial result previously obtained (Ai®B [pl]), - a calculation circuit for carrying out a first polynomial multiplication (®) of the partial result previously obtained and shifted by a first number (R) of t bits and memorize (register Q) the t most significant bits (HI) of the result of the first multiplication. 8. Coprocessor according to claim 7, in which the calculation circuit also performs a second polynomial multiplication (Ai®B [pl]) of a second number (Ai) of t bits by a third number (B [p-1] ) of t-bits to produce the partial result previously obtained. 9. Coprocessor according to claim 7 or 8, in which the calculation circuit also performs: - a third polynomial multiplication of the t most significant bits (HI) of the result of the first multiplication by a fourth number of t-bits (N [ p-1]), and an addition of the result of the third multiplication and the least significant bits (LO) of the result of the first multiplication. 10. Electronic component for implementing the method according to one of claims 1 to β. 11. Electronic component comprising a coprocessor according to one of claims 7 to 9. 12. Chip card comprising an electronic component according to claim 10 or according to claim 11.
EP04786388A 2003-09-04 2004-08-23 Modular reduction for a cryptographic process and coprocessor for carrying out said reduction Withdrawn EP1660989A2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
FR0310445A FR2859585A1 (en) 2003-09-04 2003-09-04 MODULAR REDUCTION FOR A CRYPTOGRAPHIC METHOD, AND COPROCESSOR FOR REALIZING SUCH MODULAR REDUCTION
PCT/FR2004/050390 WO2005024627A2 (en) 2003-09-04 2004-08-23 Modular reduction for a cryptographic process and coprocessor for carrying out said reduction

Publications (1)

Publication Number Publication Date
EP1660989A2 true EP1660989A2 (en) 2006-05-31

Family

ID=34178780

Family Applications (1)

Application Number Title Priority Date Filing Date
EP04786388A Withdrawn EP1660989A2 (en) 2003-09-04 2004-08-23 Modular reduction for a cryptographic process and coprocessor for carrying out said reduction

Country Status (4)

Country Link
US (1) US20070162530A1 (en)
EP (1) EP1660989A2 (en)
FR (1) FR2859585A1 (en)
WO (1) WO2005024627A2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8559625B2 (en) * 2007-08-07 2013-10-15 Inside Secure Elliptic curve point transformations
US8233615B2 (en) * 2008-01-15 2012-07-31 Inside Secure Modular reduction using a special form of the modulus
US8619977B2 (en) 2008-01-15 2013-12-31 Inside Secure Representation change of a point on an elliptic curve

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69231110T2 (en) * 1991-03-05 2000-11-16 Canon Kk Computing device and method for encrypting / decrypting communication data using the same
FR2737370B1 (en) * 1995-07-27 1997-08-22 Bull Cp8 CRYPTOGRAPHIC COMMUNICATION METHOD

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See references of WO2005024627A3 *

Also Published As

Publication number Publication date
WO2005024627A3 (en) 2005-06-30
US20070162530A1 (en) 2007-07-12
FR2859585A1 (en) 2005-03-11
WO2005024627A2 (en) 2005-03-17

Similar Documents

Publication Publication Date Title
EP0853275B1 (en) Coprocessor comprising two multiplying circuits operating in parallel
FR2867579A1 (en) Montgomery modular multiplier for computing system, selects one of n-bit modulus numbers as a modulus product and one of n-bit multiplicand numbers as partial product
FR2788867A1 (en) Arithmetic method and implementation for cryptographic processing
EP0443679A1 (en) Coding method, according to the RSA method, by a microcontroller and a device using this method
JP2004280103A (en) Apparatus and method for performing montgomery type modular multiplication
EP1368747A1 (en) Method and device for reducing the time required to perform a product, multiplication and modular exponentiation calculation using the montgomery method
FR2849512A1 (en) MONTGOMERY MODULAR MULTIPLIER AND CORRESPONDING MULTIPLICATION METHOD
FR2724741A1 (en) ELECTRONIC CIRCUIT FOR MODULAR CALCULATION IN A FINISHED BODY
EP0939363B1 (en) Method for implementing modular multiplication according to the Montgomery method
EP0793165B1 (en) Modular arithmetic coprocessor for fast execution of non-modular operations
CA2257907A1 (en) Public key cryptography method
EP0939362A1 (en) Modular arithmetic coprocessor for fast execution of non-modular operations
EP1012703B1 (en) Modular arithmetic coprocessor comprising an integer division circuit
WO2005024627A2 (en) Modular reduction for a cryptographic process and coprocessor for carrying out said reduction
EP0785503B1 (en) Method of producing an error correcting parameter associated with the implementation of modular operations according to the Montgomery method
EP0778518B1 (en) Method of producing a parameter J0 associated with the implementation of modular operations according to the Montgomery method
EP0784262B1 (en) Device and method for improving the processing speed of a modular arithmetic coprocessor
EP0927928B1 (en) Improved method of producing a parameter J0 associated with the implementation of modular operations according to the Montgomery method
EP0947913B1 (en) Improved method of implementing integer division
EP0785502A1 (en) Method of producing an error correcting parameter associated with the implementation of modular operations according to the Montgomery method
FR2818765A1 (en) Modular multiplier for enciphering/deciphering data, comprises buffer memories to store Montgomery algorithm results and operands , multiplexors, multiplier, control unit, bistable circuits and adder
EP0902359B1 (en) Method and apparatus for performing integer division on a modulo arithmetic coprocessor
WO2003093973A1 (en) Montgomery multiplication
FR2821945A1 (en) Method for protecting cryptographic procedures against attacks through current and electromagnetic radiation measurements, comprises random selection of second group isomorphic to first group
FR2839224A1 (en) METHOD FOR PERFORMING A MODULAR MULTIPLICATION PHASE OF TWO OPERANDS IN MULTIPRECISION AND CRYPTOPROCESSOR FOR THE IMPLEMENTATION OF THE METHOD

Legal Events

Date Code Title Description
PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

17P Request for examination filed

Effective date: 20060303

AK Designated contracting states

Kind code of ref document: A2

Designated state(s): AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LI LU MC NL PL PT RO SE SI SK TR

DAX Request for extension of the european patent (deleted)
GRAP Despatch of communication of intention to grant a patent

Free format text: ORIGINAL CODE: EPIDOSNIGR1

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE APPLICATION IS DEEMED TO BE WITHDRAWN

18D Application deemed to be withdrawn

Effective date: 20070912