FR2942560A1 - Data processing method for securing Rivest Shamir Adleman cryptographic algorithms on chip card, involves testing relation between values by comparing values with neutral element of finite group based on internal rule of finite group - Google Patents

Data processing method for securing Rivest Shamir Adleman cryptographic algorithms on chip card, involves testing relation between values by comparing values with neutral element of finite group based on internal rule of finite group Download PDF

Info

Publication number
FR2942560A1
FR2942560A1 FR0951166A FR0951166A FR2942560A1 FR 2942560 A1 FR2942560 A1 FR 2942560A1 FR 0951166 A FR0951166 A FR 0951166A FR 0951166 A FR0951166 A FR 0951166A FR 2942560 A1 FR2942560 A1 FR 2942560A1
Authority
FR
France
Prior art keywords
double
exponentiation
exponent
values
value
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.)
Granted
Application number
FR0951166A
Other languages
French (fr)
Other versions
FR2942560B1 (en
Inventor
Matthieu Rivain
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.)
Idemia France SAS
Original Assignee
Oberthur Technologies 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 Oberthur Technologies SA filed Critical Oberthur Technologies SA
Priority to FR0951166A priority Critical patent/FR2942560B1/en
Publication of FR2942560A1 publication Critical patent/FR2942560A1/en
Application granted granted Critical
Publication of FR2942560B1 publication Critical patent/FR2942560B1/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/3006Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters
    • H04L9/302Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters involving the integer factorization problem, e.g. RSA or quadratic sieve [QS] schemes
    • 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/723Modular exponentiation
    • 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/002Countermeasures against attacks on cryptographic mechanisms
    • H04L9/004Countermeasures against attacks on cryptographic mechanisms for fault attacks
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/72Indexing scheme relating to groups G06F7/72 - G06F7/729
    • G06F2207/7219Countermeasures against side channel or fault attacks
    • G06F2207/7223Randomisation as countermeasure against side channel attacks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/72Indexing scheme relating to groups G06F7/72 - G06F7/729
    • G06F2207/7219Countermeasures against side channel or fault attacks
    • G06F2207/7261Uniform execution, e.g. avoiding jumps, or using formulae with the same power profile

Abstract

The method involves realizing double exponentiation of an element (m) of a finite group by exponents (d, b) for providing corresponding values (R0, R1), where one the exponents is equal to difference between the other exponent and an order or multiple of the finite group (vG). A relation between the values provided by the corresponding exponents is tested by comparing the values with a neutral element (1G) of the finite group based on internal rule of the finite group. An independent claim is also included for a data processing device comprising a double exponentiation calculation unit.

Description

La présente invention concerne un procédé de traitement impliquant une exponentiation, et un dispositif associé. Les calculs d'exponentiation sont fréquemment utilisés dans les algorithmes cryptographiques et font généralement intervenir, dans ce cadre, un secret, c'est-à-dire un nombre stocké par le dispositif qui met en oeuvre l'algorithme cryptographique et qui n'est pas accessible de l'extérieur. Par exemple, les calculs cryptographiques ont recours à l'exponentiation modulaire pour limiter la taille des valeurs à manipuler. L'exponentiation modulaire est notamment très utilisée dans des applications de type carte à puce. The present invention relates to a processing method involving an exponentiation, and an associated device. Exponentiation calculations are frequently used in cryptographic algorithms and generally involve, in this context, a secret, that is to say a number stored by the device that implements the cryptographic algorithm and that is not not accessible from the outside. For example, cryptographic computations use modular exponentiation to limit the size of values to manipulate. Modular exponentiation is particularly used in smart card type applications.

Les étapes qui mettent en oeuvre l'exponentiation, par exemple modulaire, font particulièrement l'objet d'attaques et de cryptanalyse physique de la part de personnes malintentionnées ; il peut s'agir d'attaques par canaux cachés consistant en une analyse de grandeurs physiques (courant électrique circulant dans le dispositif par exemple) lors des calculs cryptographiques ("side channe/ analysis" selon la terminologie anglo-saxonne) ou d'attaques par faute consistant à exploiter un résultat erroné pour en déduire le secret ("fault analysis" selon la terminologie anglo-saxonne). On a de ce fait déjà cherché à protéger ces étapes, en particulier dans le cas où le secret à protéger correspond à l'exposant mis en jeu dans l'exponentiation. Une méthode classique pour protéger un algorithme cryptographique contre les attaques par faute consiste à l'exécuter deux fois, et à comparer les deux résultats obtenus de sorte que s'ils sont égaux, on fournit la valeur calculée à l'extérieur du dispositif cryptographique. Dans la négative, l'attaque a été détectée. Une alternative à cette méthode consiste à décrypter le message crypté lors de l'algorithme pour vérifier qu'il n'a pas été modifié. The stages that implement the exponentiation, for example modular, are particularly the object of attacks and physical cryptanalysis on the part of malicious people; they may be hidden channel attacks consisting of an analysis of physical quantities (electrical current circulating in the device for example) during cryptographic calculations ("side channe / analysis" according to the English terminology) or attacks by fault consisting of exploiting an erroneous result to deduce the secret ("fault analysis" according to the English terminology). We have already sought to protect these steps, especially in the case where the secret to protect corresponds to the exponent involved in the exponentiation. A conventional method for protecting a cryptographic algorithm against fault attacks is to execute it twice, and to compare the two results obtained so that if they are equal, the computed value is provided outside the cryptographic device. If not, the attack has been detected. An alternative to this method is to decrypt the encrypted message during the algorithm to verify that it has not been modified.

Toutefois, ces solutions s'avèrent coûteuses en temps et ressources de traitement lorsqu'elles sont mises en oeuvre pour protéger des procédés cryptographiques impliquant une exponentiation, par exemple le cryptosystème RSA (Rivest Shamir Adleman). Cet inconvénient est d'autant plus vrai que nombre de dispositifs cryptographiques courants sont munis de ressources d'exécution limitées. Le cryptosystème RSA utilise une clé publique composée d'un module public N s'exprimant comme le produit de deux nombres premiers secrets p et q ainsi que d'un exposant public e co-premier avec l'indicatrice d'Euler de N définit par (p(N)=(p-l)(q-l). La clé privée correspondante est composée du module public N ainsi que de l'exposant privé d définit comme l'inverse de e modulo (p(N). La signature RSA (ou encore le déchiffrement) s d'un message m (dont la représentation binaire résulte en un nombre strictement inférieur à N) est obtenue comme suit : s=mdmodN. Les clés et module sont choisis grands, typiquement sur 256, 512 ou 1024 bits. Dans le cadre RSA, les clés sont choisies inférieures à cp(N)=(p-1)(q-1)<N. Un groupe mathématique classiquement utilisé pour l'algorithme RSA est le groupe Z*N représentant les entiers entre 1 et N-1 qui sont inversibles modulo N. Ce groupe correspond à des mots binaires sur log2(N) bits. Une mise en oeuvre de l'exponentiation de 'm' par 'd' est appelée "square and multiply' (termes anglais signifiant "mise au carré et multiplication") où l'on met à jour une variable par multiplication pour chaque bit de l'exposant 'd' valant 1, par une valeur dérivée de 'm'. Au sens mathématique, l'exponentiation est définie comme une loi externe des entiers relatifs sur un groupe (G, .), avec principalement pour tout élément 'x' du groupe G: xn = x.x.x.[...].x (x apparaissant n fois). However, these solutions are costly in time and processing resources when implemented to protect cryptographic processes involving exponentiation, for example the Rivest Shamir Adleman (RSA) cryptosystem. This disadvantage is all the more true as many common cryptographic devices are provided with limited execution resources. The RSA cryptosystem uses a public key composed of a public module N expressing itself as the product of two secret prime numbers p and q as well as a public exponent e co-prime with the Euler indicator of N defined by (p (N) = (pl) (ql) The corresponding private key is composed of the public module N as well as the private exponent d defined as the inverse of e modulo (p (N). The RSA signature (or further decryption of a message m (whose binary representation results in a number strictly less than N) is obtained as follows: s = mdmodN The keys and module are large, typically 256, 512 or 1024 bits. In the RSA frame, the keys are chosen smaller than cp (N) = (p-1) (q-1) <N. A mathematical group conventionally used for the RSA algorithm is the group Z * N representing the integers between 1 and N-1, which are invertible modulo N. This group corresponds to binary words on log2 (N) bits, an implementation of the exponentiation of m 'by' d 'is called' square and multiply 'where we update a variable by multiplication for each bit of the exponent' of 1, by a value derived from 'm'. In the mathematical sense, exponentiation is defined as an external law of relative integers on a group (G,.), With mainly for any element 'x' of the group G: xn = xxx [...]. X (x appearing n times).

L'algorithme RSA a été rendu plus efficace par l'utilisation du théorème connu des restes chinois (CRT de l'anglais "Chinese Remainder Theorem"). en calculant séparément sp = m' mod p, où dp = d mod (p-1) et sq = mdg mod q, où dq = d mod (q-1), puis en récupérant s à partir de sp et sq, par exemple à l'aide de la recombinaison de Garner. Pour sécuriser cet algorithme RSA contre les attaques par faute, on a pu introduire un vérification de la signature avant de retourner celle-ci comme résultat des calculs, cette vérification étant menée notamment à l'aide de la formule de décryptage correspondante: se mod N. En cas d'inégalité avec la valeur du message 'm' initiale, une faute est détectée. Cette solution présente cependant l'inconvénient de nécessiter une nouvelle et coûteuse exponentiation modulaire, cette fois-ci de la valeur 's'. The RSA algorithm has been made more efficient by using the known Chinese Remainder Theorem (CRT). by calculating separately sp = m 'mod p, where dp = d mod (p-1) and sq = mdg mod q, where dq = d mod (q-1), then recovering s from sp and sq, by example using the Garner recombination. To secure this RSA algorithm against fault attacks, it was possible to introduce a verification of the signature before returning it as a result of the calculations, this verification being carried out in particular by means of the corresponding decryption formula: In case of inequality with the value of the initial message 'm', a fault is detected. However, this solution has the disadvantage of requiring a new and expensive modular exponentiation, this time of the value 's'.

De ce fait d'autres solutions de protection ont pu être mises au point; d'une part, celles basées sur l'extension du module consistant à ajouter des données de redondance au module public N mais qui ne sont pas satisfaisantes du fait des propriétés cycliques de la fonction modulo appliquée aux données de redondance du module; et d'autre part, celles basées sur une exponentiation auto-protégée ("self secure exponentiation" selon la terminologie anglo- saxonne). Dans ce dernier groupe de solutions, c'est l'algorithme même d'exponentiation qui offre un moyen direct pour vérifier la cohérence des calculs cryptographiques menés. As a result, other protection solutions have been developed; on the one hand, those based on the extension of the module consisting of adding redundancy data to the public module N but which are not satisfactory because of the cyclic properties of the modulo function applied to the redundancy data of the module; and on the other hand, those based on a self-protected exponentiation ("self secure exponentiation" according to Anglo-Saxon terminology). In this last group of solutions, it is the very exponentiation algorithm that offers a direct means for verifying the consistency of the cryptographic calculations carried out.

On connaît notamment la solution de Giraud "An RSA Implementation Resistant to Fault Attacks and to Simple Power Analysis", IEEE Transactions on Computers, 55(9):1116-1120, Septembre 2006, qui propose un procédé de traitement de données, comprenant une étape de double exponentiation d'un élément appartenant à un groupe fini par un premier exposant, 'd-1', pour fournir une première valeur et par un deuxième exposant, 'd', lié au premier exposant pour fournir une deuxième valeur, et une étape de test d'une relation entre lesdites première et deuxième valeurs. Une solution similaire est décrite dans la demande FR 2 884 004, dans laquelle on réalise une double exponentiation (md md+l) En détail, l'algorithme d'exponentiation de la solution Giraud fait évoluer une paire de variables intermédiaires (ao, a,) stockant les valeurs (ma, m°`+') pour obtenir, à la fins des calculs, les valeurs (md-', md). La cohérence du calcul cryptographique est alors vérifiée en comparant ao.m avec a,. En cas d'inégalité, une faute est détectée. Ces solutions présentent certains inconvénients. D'une part, les calculs pour passer de (1, m) à (md-', md), nécessitant pas moins de (d-1) itérations. D'autre part, ces calculs nécessitent deux multiplications modulaires par bit de l'exposant. Enfin, la comparaison finale fait intervenir à nouveau la valeur du message 'm' conduisant à la détection d'une faute si ce message a été modifié par faute à la fin de l'algorithme alors même que les calculs de ao et a, ont pu être menés correctement. In particular, the Giraud solution "An RSA Implementation Resistant to Fault Attacks and Simple Power Analysis", IEEE Transactions on Computers, 55 (9): 1116-1120, September 2006, which proposes a method of data processing, including a a double exponentiation step of an element belonging to a finite group by a first exponent, 'd-1', to provide a first value and a second exponent, 'd', bound to the first exponent to provide a second value, and a step of testing a relationship between said first and second values. A similar solution is described in application FR 2 884 004, in which a double exponentiation is carried out (md md + 1). In detail, the exponentiation algorithm of the Giraud solution evolved a pair of intermediate variables (ao, a ,) storing the values (ma, m ° `+ ') to obtain, for calculation purposes, the values (md-', md). The consistency of the cryptographic calculation is then verified by comparing ao.m with a ,. In case of inequality, a fault is detected. These solutions have certain disadvantages. On the one hand, the calculations to pass from (1, m) to (md- ', md), requiring no less than (d-1) iterations. On the other hand, these calculations require two modular multiplications per bit of the exponent. Finally, the final comparison again involves the value of the message 'm' leading to the detection of a fault if this message was modified by fault at the end of the algorithm even though the calculations of ao and a, have could be carried out correctly.

Une variante à la solution de Giraud concerne celle de Boscher et al. décrite dans la publication "CRT RSA Algorithm Protected against Fault Attacks", Information Security Theory and Practices û WISTP 2007, volume 4462 of Lecture Notes in Computer Science, pages 229û243, 2007. Tout comme la solution de Giraud, cette dernière solution nécessite également deux multiplications modulaires par bit de l'exposant. En outre, elle présente l'inconvénient d'utiliser, à chaque itération dans le procédé, quatre registres pour mémoriser un triplet (ao, a,, a2) et la valeur 'm' du message. La présente invention vise à proposer une solution alternative à ces solutions connues de l'art antérieur en vue de pallier au moins un des inconvénients susmentionnés. A cet effet, l'invention concerne notamment un procédé de traitement de données, comprenant une étape de double exponentiation d'un élément d'un groupe fini par un premier exposant pour fournir une première valeur et par un deuxième exposant lié au premier exposant pour fournir une deuxième valeur, et une étape de test d'une relation entre lesdites première et deuxième valeurs, procédé dans lequel : - le deuxième exposant est égal à 1eG û d, où d est le premier exposant et 15'6 est l'ordre du groupe ou un multiple de celui-ci ; et - ladite étape de test comprend une comparaison entre lesdites première et deuxième valeurs et l'élément neutre du groupe. L'ordre 15'6 du groupe G est défini comme étant le nombre d'éléments qu'il contient, également dénommé "cardinal". An alternative to the Giraud solution is that of Boscher et al. described in the "RSA Algorithm Protected against Fault Attacks" publication, Information Security Theory and Practices - WISTP 2007, volume 4462 of Lecture Notes in Computer Science, pages 229 and 243, 2007. Like Giraud's solution, the latter solution also requires two modular multiplications by bit of the exponent. In addition, it has the disadvantage of using, at each iteration in the method, four registers for storing a triplet (ao, a ,, a2) and the value 'm' of the message. The present invention aims to propose an alternative solution to these known solutions of the prior art in order to overcome at least one of the aforementioned drawbacks. For this purpose, the invention particularly relates to a method of data processing, comprising a step of double exponentiation of an element of a finite group by a first exponent to provide a first value and a second exponent related to the first exponent for providing a second value, and a step of testing a relationship between said first and second values, wherein: - the second exponent is 1eG û d, where d is the first exponent and 15'6 is the order group or a multiple of it; and said testing step comprises a comparison between said first and second values and the neutral element of the group. The order 15'6 of the group G is defined as the number of elements it contains, also called "cardinal".

Selon l'invention, on s'appuie sur les propriétés reliant cet ordre pour un groupe fini et l'élément neutre de ce groupe pour vérifier, de façon efficace et peu coûteuse, la cohérence du calcul cryptographique mené par exponentiation. Si la comparaison n'est pas concluante, une faute est alors détectée. Notamment, la comparaison finale entre les deux résultats d'exponentiation et l'élément neutre n'implique pas à nouveau l'intervention du message 'm' crypté. Dans un mode de réalisation, lors dudit test, on compare le produit de la première valeur et de la deuxième valeur selon la loi interne dudit groupe avec ledit élément neutre, notamment on vérifie la formule suivante : md . m"-d = 1G. On applique ainsi directement la propriété selon laquelle pour tout élément x d'un groupe fini d'ordre 15.6 et d'élément neutre 1G, on a : xeG = 1G. According to the invention, one relies on the properties connecting this order for a finite group and the neutral element of this group to verify, in an efficient and inexpensive way, the coherence of the cryptographic computation led by exponentiation. If the comparison is inconclusive, a fault is detected. In particular, the final comparison between the two exponentiation results and the neutral element does not imply again the intervention of the message 'm' encrypted. In one embodiment, during said test, the product of the first value and the second value are compared according to the internal law of said group with said neutral element, in particular the following formula is verified: md. m "-d = 1G The property is thus directly applied according to which for every element x of a finite group of order 15.6 and of neutral element 1G, we have: xeG = 1G.

Dans un mode de réalisation, ladite double exponentiation est réalisée de façon itérative, en mettant, à chaque itération, au carré selon la loi du groupe un premier paramètre et à jour deux variables, chacune pour respectivement chaque bit du premier exposant et chaque bit du deuxième exposant, par application dudit premier paramètre selon la loi interne du groupe, généralement une multiplication. On opère ici les deux exponentiations de l'élément selon des mécanismes proches de l'algorithme "square and multiply" dans le cas de l'exponentiation modulaire, également applicable à d'autre type d'exponentiation. Toutefois, dans cette configuration, on évite de mettre au carré deux fois le premier paramètre, réduisant la complexité de la double exponentiation au regard de nombreuses solutions de l'art antérieur. En outre, cette configuration ne requiert l'utilisation que de trois registres: deux pour les deux variables et un pour le paramètre. Dans une variante de réalisation, ladite double exponentiation comprend une étape de calcul desdites première et deuxième valeurs à l'aide d'une double chaîne d'additions, ladite double chaîne étant déterminée pour les deux exposants. Grâce à l'utilisation d'une telle chaîne d'additions, le nombre de multiplication (ou d'addition, selon la loi interne du groupe) lors de l'opération de double exponentiation est nettement réduit par rapport aux solutions de l'art antérieur telles l'algorithme "square and multiply". Corrélativement, l'espace mémoire requis est réduit. In one embodiment, said double exponentiation is performed iteratively, by placing, at each iteration, squared according to the group law a first parameter and up to date two variables, each for respectively each bit of the first exponent and each bit of the second exponent, by application of said first parameter according to the internal law of the group, generally a multiplication. We operate here the two exponentiations of the element according to mechanisms close to the "square and multiply" algorithm in the case of modular exponentiation, also applicable to another type of exponentiation. However, in this configuration, it avoids squaring the first parameter twice, reducing the complexity of the double exponentiation with regard to many solutions of the prior art. In addition, this configuration requires the use of only three registers: two for the two variables and one for the parameter. In an alternative embodiment, said double exponentiation comprises a step of calculating said first and second values using a double chain of additions, said double chain being determined for the two exponents. Thanks to the use of such a chain of additions, the number of multiplication (or addition, according to the internal law of the group) during the double exponentiation operation is significantly reduced compared to the solutions of the art. previous such as the "square and multiply" algorithm. Correlatively, the required memory space is reduced.

C'est notamment en raison du calcul d'un même élément à deux puissances différentes que l'on peut utiliser une telle chaîne d'additions et bénéficier du calcul commun des deux puissances qui en résulte. En particulier, ladite double chaîne d'additions est mémorisée à l'initialisation d'un dispositif mettant en oeuvre la double exponentiation. Dans ce cas, la chaîne d'addition est pré-calculée et stockée en mémoire non-volatile comme un paramètre de l'exponentiation. On évite ainsi de recalculer cette double chaîne à chaque utilisation. Toutefois, une adaptation de l'interface de programmation (API) de la fonction cryptographique (par exemple le RSA) est réalisée afin de ne plus prendre un exposant en paramètre mais une chaîne d'addition. Cette configuration est cependant efficace en ce qu'elle réduit le temps de traitement et les ressources mémoires disponibles. En variante, la double exponentiation comprend une opération de détermination de ladite double chaîne d'additions, notamment lors de la mise en oeuvre de la double exponentiation. Cette configuration permet notamment d'appliquer d'autres mesures protectrices avant le calcul de la double exponentiation, comme par exemple le masquage de l'exposant par l'ajout de valeurs aléatoires comme décrit plus loin. De plus, comme la chaîne est calculée dynamiquement, l'interface de programmation (API) ne change pas. It is notably because of the computation of the same element with two different powers that one can use such a chain of additions and profit from the common calculation of the two powers which results from it. In particular, said dual chain of additions is stored at the initialization of a device implementing the double exponentiation. In this case, the addition string is pre-calculated and stored in non-volatile memory as a parameter of the exponentiation. This avoids to recalculate this double chain with each use. However, an adaptation of the programming interface (API) of the cryptographic function (for example the RSA) is performed in order to no longer take an exponent parameter but an addition string. This configuration is however effective in that it reduces the processing time and the available memory resources. As a variant, the double exponentiation comprises an operation for determining said double chain of additions, in particular during the implementation of the double exponentiation. This configuration makes it possible in particular to apply other protective measures before calculating the double exponentiation, such as for example the masking of the exponent by the addition of random values as described below. In addition, because the string is dynamically calculated, the programming interface (API) does not change.

En particulier, ladite opération de détermination comprend la décomposition itérative des deux exposants en paires de valeurs intermédiaires jusqu'à l'obtention de la paire (0,1), chaque élément d'une paire intermédiaire résultant d'une opération sur les éléments de la paire précédente choisie parmi: - la conservation d'un élément précédent, - la soustraction d'un élément précédent à l'autre, - la division d'un élément précédent par deux, ledit élément précédent étant préalablement décrémenté de 1 lorsqu'il est impair. On voit ici que le nombre d'opérations possibles sur les éléments de la chaîne d'additions sont limités (à la conservation, l'addition, la multiplication par 2 [qui est donc une addition d'un élément à lui-même] et l'incrémentation de 1 [ce dernier étant généralement le premier élément de la chaîne]). Dans cette configuration, on arrive à restreindre la profondeur de mémoire utile à 3, c'est-à-dire à trois fois la taille de l'exposant. La profondeur de mémoire est vue ici comme le nombre maximal de variables intermédiaires à garder simultanément pour pouvoir continuer les calculs. Selon une caractéristique particulière, ladite décomposition comprend les itérations suivantes : (al,13Z/2) sial 13Z/2et (3Zmod2 =0 (î1j31)= (al,(13Zû1)/2) si ai 13i /2 et Pi mod2 =1 , ([3Z ùal,al) sial > Ri /2 où (a°, 130) = (a,b), et on représente ladite chaîne d'additions sous forme de chaîne binaire où chaque bit renseigne du résultat des comparaisons de l'itération. Cette chaîne binaire constitue une représentation très compacte de la chaîne d'additions utilisée pour les calculs de double exponentiation. En particulier, ladite décomposition comprend les opérations suivantes: 1.RZ, 4-a;RZR 4-b;j4-n 2. tant que (RZ,, , RZR ) ≠ (0,1) faire les étapes 3 à 9 ci - dessous 3. RZmP 4-RZR ûR. 4. v-RZR mod2 5. RZR 4- RZR / 2 6. t 4_ (RZR Rla ) 7. coJ_1 t; coi t v v 8. (iu,ip, )F(iA (it.p 9. j jû1û(tO1) 10. retourner cO 1R la y((tO1) A(iî,LR où Ro, RI et R2 sont utilisés pour stocker les valeurs a;, pi et une valeur temporaire, les indices ia, ia, itmp E {0,1,2}, sont tels que Ri,, stocke a;, RZR stocke pi et R. stocke la valeur temporaire, w; désigne un bit d'indice i dans la chaîne binaire (w), n* est la longueur de la chaîne binaire, t et v sont deux variables internes, A représente l'opération logique ET, et v représente l'opération logique OU (par disjonction) et les opérations logiques étant étendues aux espaces {0,1}x {0,1}n _> {0,1}n entre l'argument de gauche et chaque coordonnée de l'argument de droit. Cette réalisation de la décomposition s'appuie sur un algorithme dit "atomique", au sens où les mêmes opérations sont menées quelque soit le secret à protéger. Dans cette configuration, le traitement selon l'invention est résistant aux attaques par analyse de canaux cachés ("side channe/ analysis"). Selon une caractéristique particulière de l'invention, lors de l'exécution des itérations, on utilise un espace mémoire initialement réservé auxdits registres pour stocker au moins partiellement ladite chaîne binaire. In particular, said determination operation comprises the iterative decomposition of the two exponents into pairs of intermediate values until the pair (0,1) is obtained, each element of an intermediate pair resulting from an operation on the elements of the preceding pair chosen from: - the conservation of a preceding element, - the subtraction of a preceding element to the other, - the division of a preceding element by two, said preceding element being previously decremented by 1 when is odd. We see here that the number of possible operations on the elements of the chain of additions are limited (to the conservation, the addition, the multiplication by 2 [which is therefore an addition of an element to itself] and the incrementation of 1 [the latter being generally the first element of the chain]). In this configuration, it is possible to restrict the useful memory depth to 3, that is to say to three times the size of the exponent. The depth of memory is seen here as the maximum number of intermediate variables to keep simultaneously in order to continue the calculations. According to a particular characteristic, said decomposition comprises the following iterations: (a1, 13Z / 2) sial 13Z / 2 and (3Zmod2 = O (III31) = (a1, (13Zu1) / 2) if ai 13i / 2 and Pi mod2 = 1 Where (a, 130) = (a, b), and the said chain of additions is represented in the form of a binary string where each bit informs of the result of the comparisons of the This binary string is a very compact representation of the string of additions used for the double exponentiation calculations, and in particular the decomposition includes the following operations: 1.RZ, 4-a; RZR 4-b; j4- n 2. as long as (RZ ,,, RZR) ≠ (0,1) do steps 3 to 9 below 3. RZmP 4-RZR R 4. RZR mod2 5. RZR 4- RZR / 2 6 4 (RZR Rla) 7. coJ1t; coi tvv 8. (iu, ip,) F (iA (it.p 9. ju1u (tO1) 10. return cO 1R the y ((tO1) A (iii , LR where Ro, RI and R2 are used to store the values a ;, pi and a temporary value, the indices ia, ia, itmp E {0, 1,2}, are such that Ri ,, stores a ;, RZR stores pi and R. stores the temporary value, w; denotes a bit of index i in the bit string (w), n * is the length of the bit string, t and v are two internal variables, A represents the AND logical operation, and v represents the logical OR operation ( by disjunction) and the logical operations being extended to the spaces {0,1} x {0,1} n _> {0,1} n between the left argument and each coordinate of the right argument. This realization of decomposition is based on an algorithm called "atomic", in the sense that the same operations are conducted whatever the secret to protect. In this configuration, the treatment according to the invention is resistant to attacks by analysis of hidden channels ("side channe / analysis"). According to a particular characteristic of the invention, during the execution of the iterations, a memory space initially reserved for said registers is used for at least partially storing said bit string.

Cette gestion économe de la mémoire s'appuie notamment sur le fait que l'algorithme ci-dessus réduit progressivement la taille des données à stocker dans les registres (du fait de la division par deux) alors que la chaîne binaire est progressivement construite. On diminue ainsi l'espace mémoire requis pour le traitement, notamment on peut se limiter à 4,2 I (où I est la longueur des exposants utilisés, la longueur de la chaîne binaire étant estimée en borne supérieure à 2,2 I) au lieu de 5,2 I. Selon une caractéristique de l'invention, la double exponentiation comprend les itérations suivantes : i(ma' , m zb, ) si ti i+I(a, b) = 0 et v i+l(a, b) = 0 (1) (m a- , m b=~) = (m a, , m zbi') si ti i+1(a, b) = 0 et v i+l(a, b) = 1 (2) (m b, , m a,+b,) si t (a, b) =1 (3) OÙ-C.= 0 si a n-i Ç 13,_i /2 1 Si a n-i > 13 n-i /2 et vi = Rn_i mod2 . On observe ici que les valeurs de i et v correspondent aux valeurs stockées dans la chaîne binaire w représentative de la chaîne d'additions 5 correspondante. En particulier, ladite double exponentiation comprend les calculs suivants: R(0,0) 4- 1;R(0,1) m; R(1 0) 4- m y-1; 4-1;i4-0 tant que i < n * faire les étapes ci - dessous t~ct)iAg;V COi+1A R(oror) R(oror).R(( ol),rA ) mod N 1.1 4-tv(v1);y4-ye+t +iA(tO+1) retourner (Rrol , Rr ) où R(o,o), R(o,l) et R(l,o) sont des registres, t, et y sont des variables 10 internes, w est la chaîne binaire et n* est la longueur de la chaîne binaire. Dans ce cas, l'algorithme proposé est également atomique de sorte que la double exponentiation est protégée contre les attaques par analyse de canaux cachés. Dans un mode de réalisation, lesdites paires intermédiaires sont 15 successivement stockées dans une même paire de deux registres, l'association entre chaque registre et un élément des paires étant fonction d'un bit aléatoire généré préalablement. L'introduction d'une valeur aléatoire dans la détermination des registres utilisés rend le traitement selon l'invention résistant aux attaques par faute de type "safe-error", c'est-à-dire lorsque la faute 20 n'impacte pas le résultat directement, mais d'autres valeurs. Dans un autre mode de réalisation, éventuellement combiné, on ajoute, avant ladite double exponentiation et à chacun des premier et deuxième exposants, un multiple de l'ordre dudit groupe fonction respectivement d'une première et d'une deuxième valeurs générées aléatoirement. L'introduction d'un multiple de l'ordre du groupe à chacun des exposants masque le secret à protéger tout en ne modifiant pas l'issue du traitement proposé. Cette disposition permet de se prémunir des attaques de type analyse différentielle de canaux cachés ("Differential Side Channel Analysis"). En particulier, on peut calculer une seule valeur aléatoire que l'on utilise pour les deux exposants. En cryptographie, on utilise généralement le groupe des entiers inversibles modulo un certain module muni de la loi interne multiplicative '.', mais également le groupe constitué des points d'une courbe elliptique muni de la loi interne additive '+'. This economical management of the memory relies in particular on the fact that the algorithm above gradually reduces the size of the data to be stored in the registers (because of the division by two) whereas the binary chain is progressively constructed. This reduces the memory space required for processing, in particular it can be limited to 4.2 I (where I is the length of the exponents used, the length of the bit string being estimated at a limit greater than 2.2 I) 5.2 According to one characteristic of the invention, the double exponentiation comprises the following iterations: i (ma ', m zb,) if t i i + I (a, b) = 0 and v i + 1 ( a, b) = 0 (1) (m a-, mb = ~) = (ma,, m zbi ') if ti i + 1 (a, b) = 0 and v i + l (a, b) = 1 (2) (mb,, ma, + b,) if t (a, b) = 1 (3) OÙ-C. = 0 if a ni Ç 13, _i / 2 1 If a ni> 13 n / 2 and vi = Rn mod2. It is observed here that the values of i and v correspond to the values stored in the binary chain w representative of the corresponding chain of additions. In particular, said double exponentiation comprises the following calculations: R (0,0) 4- 1; R (0,1) m; R (1 0) 4- m y-1; 4-1; i4-0 as long as i <n * do the steps below t ~ ct) iAg; V COi + 1A R (oror) R (oror) .R ((ol), rA) mod N 1.1 4 -tv (v1); y4-ye + t + iA (t0 + 1) return (Rrol, Rr) where R (o, o), R (o, l) and R (l, o) are registers, t , and y are internal variables, w is the binary string and n * is the length of the binary string. In this case, the proposed algorithm is also atomic so that double exponentiation is protected against hidden channel analysis attacks. In one embodiment, said intermediate pairs are successively stored in the same pair of two registers, the association between each register and an element of the pairs being a function of a previously generated random bit. The introduction of a random value in the determination of the registers used renders the treatment according to the invention resistant to "safe-error" type attacks, that is to say when the fault 20 does not impact the result directly, but other values. In another embodiment, possibly combined, is added, before said double exponentiation and each of the first and second exponents, a multiple of the order of said function group respectively of a first and a second randomly generated values. The introduction of a multiple of the order of the group to each of the exponents masks the secret to protect while not modifying the outcome of the proposed treatment. This provision makes it possible to guard against the differential differential channel analysis ("Differential Side Channel Analysis") attacks. In particular, one can calculate a single random value that is used for both exponents. In cryptography, one generally uses the group of invertible integers modulo a certain module provided with the multiplicative internal law '.', But also the group constituted by the points of an elliptic curve provided with the additive internal law '+'.

Selon une caractéristique de l'invention, ledit groupe présente une loi interne de type multiplication modulaire et la double exponentiation est une double exponentiation modulaire. Ce peut être par exemple le groupe Z*N muni de l'opération multiplication classiquement connue. Dans un mode de réalisation spécifique, on calcule la double exponentiation modulaire, de module N, de l'élément m à l'aide des restes chinois en réalisant les étapes suivantes : une première double exponentiation modulaire, de module p, de l'élément m par un premier exposant dérivé dp égal à d mod (p-1) et un deuxième exposant dérivé égal à n.(p-1)-dp, de sorte à fournir une première valeur intermédiaire et une deuxième valeur intermédiaire; - une deuxième double exponentiation modulaire, de module q, de l'élément m par un troisième exposant dérivé dq égal à d mod (q-1) et un quatrième exposant dérivé égal à n'.(q-l)-dq, de sorte à fournir une troisième valeur intermédiaire et une quatrième valeur intermédiaire; où p et q sont deux entiers premiers tels que N=p.q, et n, n' sont deux entiers positifs non nuls, et ladite étape de test comprend une étape de recombinaison desdites première et troisième valeurs intermédiaires de sorte à obtenir ladite première valeur, et au moins une étape de comparaison entre ladite première valeur obtenue, l'élément neutre et les deuxième et quatrième valeurs intermédiaires. According to one characteristic of the invention, said group has an internal law of modular multiplication type and the double exponentiation is a double modular exponentiation. This may be for example the group Z * N provided with the operation conventionally known multiplication. In a specific embodiment, the modular double exponentiation of the N element of the element m is calculated using the Chinese remainders by carrying out the following steps: a first modular double exponentiation, of module p, of the element m by a first derivative exponent dp equal to d mod (p-1) and a second derivative exponent equal to n (p-1) -dp, so as to provide a first intermediate value and a second intermediate value; a second double modular exponentiation, of modulus q, of the element m by a third derived exponent dq equal to d mod (q-1) and a fourth derived exponent equal to n '(ql) -dq, so as to providing a third intermediate value and a fourth intermediate value; where p and q are two prime integers such that N = pq, and n, n 'are two non-zero positive integers, and said test step comprises a step of recombining said first and third intermediate values so as to obtain said first value, and at least one step of comparing between said first value obtained, the neutral element and the second and fourth intermediate values.

Ces réalisations mettent en oeuvre le théorème des restes chinois dans le cadre de la présente invention. Les deuxième et quatrième valeurs peuvent individuellement comparées à la première valeur recombinée, ou peuvent être recombinée avant que le résultat de la recombinaison soit comparé à ladite première valeur recombinée. Selon une variante, ledit groupe présente une loi interne de type addition sur une courbe elliptique et la double exponentiation est une double multiplication scalaire sur la courbe elliptique. Cette configuration correspond plus spécifiquement à la cryptographie basée sur les courbes elliptiques. Le groupe correspondant est constitué des points d'une courbe elliptique, auxquels est classiquement associée une loi interne additive "+" que nous ne détaillons pas plus ici. Corrélativement, l'invention vise également un dispositif de traitement 15 de données, comprenant - des moyens aptes à calculer une double exponentiation d'un élément d'un groupe fini par un premier exposant pour fournir une première valeur et par un deuxième exposant lié au premier exposant pour fournir une deuxième valeur, 20 - des moyens de test d'une relation entre lesdites première et deuxième valeurs dispositif dans lequel: - le deuxième exposant est égal à 1eG û d, où d est le premier exposant et 15'6 est l'ordre du groupe ou un multiple de celui-ci ; et 25 - les moyens de test sont aptes à comparer lesdites première et deuxième valeurs et l'élément neutre du groupe. De façon optionnelle, le dispositif peut comprendre des moyens se rapportant aux caractéristiques du procédé de traitement exposé précédemment. 30 Selon un mode de réalisation, le dispositif comprend des moyens de détermination d'une double chaîne d'additions en fonction desdits deux exposants de sorte à calculer ladite double exponentiation à partir de ladite double chaîne. En particulier, lesdits moyens de détermination comprennent un espace mémoire initialement dédié à des registres pour le stockage de valeurs intermédiaires de ladite chaîne et progressivement libéré pour le stockage au moins partiel d'une chaîne binaire représentative de ladite chaîne d'additions. These embodiments implement the Chinese remains theorem in the context of the present invention. The second and fourth values may individually be compared to the first recombined value, or may be recombined before the result of the recombination is compared to said first recombined value. According to one variant, said group has an internal addition type law on an elliptic curve and the double exponentiation is a double scalar multiplication on the elliptic curve. This configuration corresponds more specifically to cryptography based on elliptic curves. The corresponding group consists of the points of an elliptic curve, which is classically associated with an additive internal law "+" that we do not detail here. Correlatively, the invention also provides a data processing device, comprising - means capable of calculating a double exponentiation of an element of a finite group by a first exponent to provide a first value and a second exponent related to the first exponent. first exponent for providing a second value; means for testing a relationship between said first and second device values wherein: the second exponent is equal to 1G-d, where d is the first exponent and 15'6 is the order of the group or a multiple of it; and the test means are able to compare said first and second values and the neutral element of the group. Optionally, the device may comprise means relating to the characteristics of the treatment method described above. According to one embodiment, the device comprises means for determining a double chain of additions as a function of said two exponents so as to calculate said double exponentiation from said double chain. In particular, said determination means comprise a memory space initially dedicated to registers for storing intermediate values of said string and progressively released for the at least partial storage of a bit string representative of said additive string.

Les avantages de tels dispositifs sont similaires aux avantages du procédé présentant des caractéristiques correspondantes. L'invention a également trait à une carte à microcircuit comprenant un dispositif ci-dessus, et présente des avantages similaires. D'autres particularités et avantages de l'invention apparaîtront encore dans la description ci-après, illustrée par les dessins ci-joints, dans lesquels : - la figure 1 représente schématiquement les éléments principaux d'une forme de réalisation possible pour une carte à microcircuit ; - la figure 2 représente l'allure physique générale de la carte à microcircuit de la figure 1 ; - la figure 3 représente, sous forme de logigramme, des étapes du procédé selon l'invention ; - la figure 4 représente, sous forme de logigramme, des étapes de double exponentiation mise en oeuvre lors des étapes de la figure 3 ; - la figure 5 représente, sous forme de logigramme, des étapes de calcul d'une chaîne d'additions de la figure 4 ; - la figure 6 représente, sous forme de logigramme, un autre exemple de double exponentiation ; et - la figure 7 représente, sous forme de logigramme, un autre exemple de l'invention. La figure 1 représente schématiquement un dispositif de traitement de données 40 dans lequel la présente invention est mise en oeuvre. Ce dispositif 40 comprend un microprocesseur 10, auquel est associée d'une part une mémoire vive 60, par exemple au moyen d'un bus 70, et d'autre part une mémoire non volatile 20 (par exemple du type EEPROM), par exemple à travers un bus 50. The advantages of such devices are similar to the advantages of the process having corresponding characteristics. The invention also relates to a microcircuit card comprising a device above, and has similar advantages. Other features and advantages of the invention will become apparent in the following description, illustrated by the accompanying drawings, in which: - Figure 1 shows schematically the main elements of a possible embodiment for a card to microcircuit; FIG. 2 represents the general physical appearance of the microcircuit card of FIG. 1; FIG. 3 represents, in the form of a logic diagram, steps of the method according to the invention; FIG. 4 represents, in the form of a logic diagram, double exponentiation steps implemented during the steps of FIG. 3; FIG. 5 represents, in the form of a logic diagram, steps for calculating a chain of additions of FIG. 4; FIG. 6 represents, in the form of a logic diagram, another example of double exponentiation; and FIG. 7 represents, in the form of a logic diagram, another example of the invention. Figure 1 schematically shows a data processing device 40 in which the present invention is implemented. This device 40 comprises a microprocessor 10, to which is associated on the one hand a random access memory 60, for example by means of a bus 70, and on the other hand a non-volatile memory 20 (for example of the EEPROM type), for example through a bus 50.

Le dispositif de traitement de données 40, et précisément le microprocesseur 10 qu'il incorpore, peuvent échanger des données avec des dispositifs extérieurs au moyen d'une interface de communication 30. On a schématiquement représenté sur la figure 1 la transmission d'une donnée d'entrée E reçue d'un dispositif extérieur (non représenté) et transmise de l'interface de communication 30 au microprocesseur 10. De manière similaire, on a représenté la transmission d'une donnée de sortie S du microprocesseur 10 vers l'interface de communication 30 à destination d'un dispositif extérieur. Cette donnée de sortie S est issue d'un traitement de données par le microprocesseur 10, généralement sur la donnée d'entrée E à l'aide d'une donnée secrète 80 interne au système, par exemple une clé privée. Bien que, pour l'illustration, les données d'entrée et les données de sortie figurent sur deux flèches différentes, les moyens physiques qui permettent la communication entre le microprocesseur 10 et l'interface 30 pourront être réalisés par des moyens uniques, par exemple un port de communication série ou un bus. Le microprocesseur 10 est apte à exécuter un logiciel (ou programme d'ordinateur) qui permet au dispositif de traitement de données 40 d'exécuter un procédé conforme à l'invention dont des exemples sont donnés dans la suite. Le logiciel est composé d'une série d'instructions de commande du microprocesseur 10 qui sont par exemple stockées dans la mémoire 20. En variante, l'ensemble microprocesseur 10 - mémoire non-volatile 20 - mémoire vive 60 peut être remplacé par un circuit à application spécifique qui comprend alors des moyens de mise en oeuvre des différentes étapes du procédé de traitement de données. La figure 2 représente une carte à microcircuit qui constitue un exemple de dispositif de traitement de données conforme à l'invention tel que représenté à la figure 1. L'interface de communication 30 est dans ce cas réalisée au moyen des contacts de la carte à microcircuit. La carte à microcircuit incorpore un microprocesseur 10, une mémoire vive 60 et une mémoire non volatile 20 comme cela est représenté sur la figure 1. The data processing device 40, and precisely the microprocessor 10 that it incorporates, can exchange data with external devices by means of a communication interface 30. FIG. 1 schematically shows the transmission of data input E received from an external device (not shown) and transmitted from the communication interface 30 to the microprocessor 10. Similarly, there is shown the transmission of an output data S of the microprocessor 10 to the interface communication device 30 to an external device. This output data S is derived from a data processing by the microprocessor 10, generally on the input data E using a secret datum 80 internal to the system, for example a private key. Although, for the illustration, the input data and the output data appear on two different arrows, the physical means which allow the communication between the microprocessor 10 and the interface 30 may be made by unique means, for example a serial communication port or a bus. The microprocessor 10 is capable of executing software (or computer program) which enables the data processing device 40 to execute a method according to the invention, examples of which are given hereinafter. The software consists of a series of instructions for controlling the microprocessor 10 which are for example stored in the memory 20. In a variant, the microprocessor assembly 10 - non-volatile memory 20 - random access memory 60 may be replaced by a circuit specific application which then comprises means for implementing the various steps of the data processing method. FIG. 2 represents a microcircuit card which constitutes an example of a data processing device according to the invention as represented in FIG. 1. The communication interface 30 is in this case realized by means of the contacts of the card to microcircuit. The microcircuit card incorporates a microprocessor 10, a random access memory 60 and a non-volatile memory 20 as shown in FIG.

Cette carte à microcircuit est par exemple conforme à la norme ISO 7816 et munie d'un microcontrôleur sécurisé qui regroupe le microprocesseur (ou CPU) 20 et la mémoire vive 60. En variante, le dispositif de traitement de données peut être une clef USB, un document ou un support d'informations papier comportant dans l'une de ses feuilles un microcircuit associé à des moyens de communication sans contact. Il s'agit de manière préférée d'une entité électronique portable ou de poche. This microcircuit card is, for example, in accordance with the ISO 7816 standard and provided with a secure microcontroller which groups together the microprocessor (or CPU) 20 and the random access memory 60. In a variant, the data processing device may be a USB key, a document or a paper information medium comprising in one of its sheets a microcircuit associated with contactless communication means. This is preferably a portable or pocket electronic entity.

En référence à la figure 3, on décrit maintenant un exemple de procédé de traitement selon l'invention au cours duquel le microprocesseur 10 souhaite crypter un message m en une signature s: s = md. Ce procédé permet un calcul d'exponentiation réalisé conformément aux enseignements de l'invention. De façon classique en informatique, les messages m appartenant au groupe G = Z*N muni de la loi de composition interne de type multiplication "." largement connue sont des mots binaires de [log2(N)1 bits ([xl étant la valeur entière supérieure). On note ici que l'élément neutre de ce groupe est 1, que l'on note ci-après 1G. Dans le cas de tels groupes Z*N , composé des entiers entre 1 et N-1 qui sont inversibles modulo N, les multiplications suivantes sur les messages m sont réalisées modulo N (N est le module de chiffrement public). Il s'agit de l'exponentiation dite modulaire, et l'ordre 1G=15.Z, vaut cp(N), cp étant la fonction N With reference to FIG. 3, an example of a processing method according to the invention in which the microprocessor 10 wishes to encrypt a message m into a signature s: s = md is now described. This method allows an exponentiation calculation made in accordance with the teachings of the invention. Conventionally in computer, messages m belonging to the group G = Z * N provided with the law of internal composition type multiplication ". widely known are binary words of [log2 (N) 1 bits ([x1 being the upper integer value). It is noted here that the neutral element of this group is 1, which is noted hereinafter 1G. In the case of such groups Z * N, composed of integers between 1 and N-1 which are invertible modulo N, the following multiplications on the messages m are made modulo N (N is the public encryption module). This is the so-called modular exponentiation, and the order 1G = 15.Z, is cp (N), where cp is the function N

Totient (indicatrice) d'Euler. Si l'ensemble des messages binaires ne forme pas directement le groupe G (ou Z*N ), on peut utiliser une fonction f inversible de mappage qui, à un message m, associe un élément du groupe G. A titre illustratif, si les messages m sont formés de i bits (i < [log2(N)1), on peut utiliser la fonction identité vers Z*N qui vient remplir le message m de bits '0' nécessaires à sa compatibilité avec l'algorithme. Totient (indicator) of Euler. If the set of binary messages does not directly form the group G (or Z * N), it is possible to use an invertible mapping function f which, to a message m, associates an element of the group G. By way of illustration, if the messages m are formed of i bits (i <[log2 (N) 1), it is possible to use the identity function towards Z * N which fills the message m with bits '0' necessary for its compatibility with the algorithm.

A l'étape E100, le microprocesseur reçoit en entrée le message m, la clé secrète d (de longueur /), l'ordre 15'6 du groupe, l'élément neutre 1G et, si nécessaire, le module de chiffrement N pour réaliser le calcul ci-dessus. Comme décrit ci-après, le traitement réalise une double exponentiation de ce message, avec un premier exposant égal à d et un deuxième exposant égal à l'ordre 15'6 du groupe moins d (1eG-d). Les deux résultats, md et meG-d sont alors comparés à l'élément neutre 1G pour garantir que le traitement s'est bien déroulé. Ainsi, à l'étape E102, on initialise les registres du microprocesseur, à savoir l'initialisation à la valeur d d'une première variable a (le premier exposant) et l'initialisation à la valeur 13G-d d'une deuxième variable b (le deuxième exposant). D'une façon générale, on s'assure que l'ordre 13G est supérieur à d, pour que d et 13G-d soient positifs et présentés sur un même nombre de bits. In step E100, the microprocessor receives as input the message m, the secret key d (of length /), the order 15'6 of the group, the neutral element 1G and, if necessary, the encryption module N for perform the calculation above. As described hereinafter, the processing performs a double exponentiation of this message, with a first exponent equal to d and a second exponent equal to the order 15'6 of the group minus d (1eG-d). The two results, md and meG-d are then compared to the neutral element 1G to ensure that the treatment went well. Thus, in step E102, the microprocessor registers are initialized, namely the initialization to the value d of a first variable a (the first exponent) and the initialization to the value 13G-d of a second variable b (the second exponent). In general, it is ensured that the order 13G is greater than d, so that d and 13G-d are positive and presented on the same number of bits.

C'est notamment le cas pour l'algorithme RSA où généralement l'exposant d est l'inverse de la clé publique 'e' modulo cp(N). Si tel n'était pas le cas, on pourra utiliser un multiple de l'ordre 13G auquel on soustrait 'd' de sorte à obtenir une valeur positive, et on exprime d sur un même nombre de bits que le multiple obtenu. This is particularly the case for the RSA algorithm where generally the exponent d is the inverse of the public key 'e' modulo cp (N). If this is not the case, we can use a multiple of the order 13G which we subtract 'd so as to obtain a positive value, and we express d on the same number of bits as the multiple obtained.

A l'étape E104, on détermine si a vaut d, de sorte à détecter une éventuelle faute d'exécution (possiblement en cas d'injection malintentionnée de faute) auquel cas le traitement retourne une erreur E106 et le traitement prend fin. La clé secrète d est notamment chargée depuis une mémoire non volatile du dispositif 40 lors du test E104 afin de déterminer une éventuelle corruption de la valeur d. Dans l'affirmative, on initialise, à l'étape E108, une variable binaire 8 par 1 si a > b et par 0 sinon. On compare, à l'étape E110, la variable 8 à 1. Dans l'affirmative, on intervertit a et b (étape E112) puis on passe à l'étape E114, sinon on passe 30 directement à l'étape E114. Lors de cette dernière, on réalise une double exponentiation telle que décrite ci-après dans différents modes de réalisation, pour obtenir dans des registres Ro et RI, respectivement ma et mb. Lorsque les exponentiations sont modulaires, on recharge à ce moment le module de chiffrement N depuis une mémoire non volatile du dispositif 40 afin de déterminer une éventuelle corruption de cette valeur N. In step E104, it is determined whether a is equal to d, so as to detect a possible execution fault (possibly in the event of malignant injection of fault) in which case the processing returns an error E106 and the processing ends. The secret key d is in particular loaded from a nonvolatile memory of the device 40 during the test E104 in order to determine a possible corruption of the value d. If so, we initialize, in step E108, a binary variable 8 by 1 if a> b and by 0 otherwise. In step E110, the variable 8 to 1 is compared. If so, we invert a and b (step E112) and then go to step E114, otherwise we go directly to step E114. During the latter, a double exponentiation is performed as described hereinafter in different embodiments, to obtain in registers Ro and RI, respectively ma and mb. When the exponentiations are modular, it is reloaded at this time the encryption module N from a nonvolatile memory of the device 40 to determine a possible corruption of this value N.

A l'étape E116, on compare Ro.R1 à l'élément neutre 1G, ici 1, c'est-à-dire qu'on vérifie l'égalité suivante : ma.mb = 1G, soit md.mbG d = 1 G. Comme évoqué ci-dessus, on note ici que dans le cas d'une exponentiation modulaire, la multiplication est réalisée modulo N. In step E116, Ro.R1 is compared to the neutral element 1G, here 1, that is to say that the following equality is satisfied: ma.mb = 1G, ie md.mbG d = 1 G. As mentioned above, we note here that in the case of a modular exponentiation, the multiplication is carried out modulo N.

Si l'égalité est vérifiée, le traitement retourne (étape E118) la valeur RS qui correspond à la valeur attendue md, et le traitement prend fin. Sinon, une erreur est retournée (étape El 06). Le traitement décrit ici se base sur la propriété suivante des groupes finis: mbG = 1G, pour tout élément m du groupe G, afin de détecter efficacement une faute injectée pendant le traitement. Dans l'exemple ci-dessus, on peut s'abstenir d'utiliser la variable 8. Dans ce cas, on choisit une fonction de double exponentiation utilisée lors de l'étape E114 qui réalise elle-même la permutation initiale entre a et b de sorte à avoir a b et retourne dans le registre Ro, la valeur ma (a avant permutation). If the equality is verified, the processing returns (step E118) the value RS which corresponds to the expected value md, and the processing ends. Otherwise, an error is returned (step El 06). The treatment described here is based on the following property of the finite groups: mbG = 1G, for any element m of the group G, in order to effectively detect a fault injected during the treatment. In the above example, we can abstain from using the variable 8. In this case, we choose a double exponentiation function used during the step E114 which itself carries out the initial permutation between a and b so as to have ab and return to the register Ro, the value ma (a before permutation).

L'étape E118 retourne alors Ro. En référence à la figure 4, on décrit maintenant un exemple de calcul de la double exponentiation mise en oeuvre lors de l'étape E114. A l'étape E150, le microprocesseur 10 reçoit en entrée les valeurs m, a et b évoquées à l'étape E114 supra. Step E118 then returns Ro. With reference to FIG. 4, an example of calculation of the double exponentiation implemented during step E114 is now described. In step E150, the microprocessor 10 receives as input the values m, a and b mentioned in step E114 supra.

On initialise, à l'étape E152, le registre Ro évoqué ci-dessus à la valeur 1G (ici 1), le registre RI à la valeur m, une variable y d'un bit à la valeur 1 et une variable i d'incrémentation d'itérations à la valeur 1. A l'étape E154, on calcule une chaîne binaire w = (w;); pour les valeurs a et b comme décrit plus bas en référence à la figure 5. In step E152, the register Ro referred to above is initialized to the value 1G (here 1), the register RI to the value m, a variable y of a bit to the value 1 and a variable i of incrementing iterations to the value 1. In step E154, calculating a bit string w = (w;); for the values a and b as described below with reference to FIG.

La chaîne binaire w représente de façon synthétique une double chaîne d'additions liée à a et b. Cette chaîne binaire w peut être calculée dynamiquement lors de chaque double exponentiation telle que décrite ici en lien avec la figure 4, ou être pré-configurée en mémoire volatile du dispositif de traitement avant de procéder aux double exponentiations. Une chaîne d'additions (x;); pour une valeur a est connue comme étant un ensemble de valeurs x;, où chaque élément est la somme de valeurs d'indice inférieur, par exemple telle que : xo=1, xn=a et pour tout k, xk=x;+x1 où i, j < k Une telle chaîne d'additions permet d'effectuer une exponentiation de m par l'exposant a en réduisant le nombre d'opérations de multiplication effectuées. En effet, on calcule mk = mxk = mx,+x; = ml m1 alors que m; et m./ ont déjà été calculées et donc on obtient mä = ma. Une double chaîne d'additions (x;); pour les valeurs a et b est définie comme l'ensemble ci-dessus tel que x;=a (i E {0...n-1}) et xn=b, en particulier xn-1=a. On choisit notamment la double chaîne d'additions composée des valeurs a; et b; telle que : (agi , 2bi ) si t i+1(a, b) = 0 et v i+1(a, b) = 0 (1) (agi+1, bi+1) = (agi ,2bi +1) si t i+1(a, b) = 0 et v +1(a, b) = 1 (2) (bi, ai + bi) si t i+1(a, b) =1 (3) avec (ao, bo) = (0, 1), n tel que (an, bn) = (a, b), et t;+1 = 0 Si a;+1 <ù b;+1 / 2 t;+1 = 1 Si a;+1 > b;+1 / 2 v;+1 = b;+1 mod 2. On décrira ci-après une méthode de calcul de cette chaîne. Cette double chaîne d'additions présente l'intérêt d'avoir une profondeur mémoire de 3. En effet, on limite l'évolution des valeurs intermédiaires (a;, b;) de la chaîne d'additions par les opérations suivantes: addition d'une valeur à elle-même (soit une multiplication par 2), addition des deux valeurs intermédiaires entre elles, et incrémentation d'une valeur par 1. Il en résulte qu'à un instant donné, il n'est nécessaire que de stocker ces deux valeurs intermédiaires (a;, b;) ainsi que la valeur 1 (ces valeurs correspondant respectivement à ma, mb et m dans les calculs de double exponentiation). Au contraire, les solutions classiques d'utilisation de simples chaînes d'additions nécessitent un grand espace mémoire afin de stocker l'ensemble des puissances intermédiaires m, utilisées pour le calcul des puissances suivantes. L'invention n'est cependant pas limitée à cette double chaîne d'additions et toute double chaîne plus ou moins longue peut être utilisée. The binary string w represents in a synthetic way a double chain of additions related to a and b. This binary string w can be calculated dynamically during each double exponentiation as described here in connection with FIG. 4, or it can be pre-configured in volatile memory of the processing device before proceeding with double exponentiation. A string of additions (x;); for a value a is known as a set of values x ;, where each element is the sum of lower subscript values, for example such that: xo = 1, xn = a and for all k, xk = x; x1 where i, j <k Such a chain of additions makes it possible to carry out an exponentiation of m by the exponent a by reducing the number of multiplication operations carried out. Indeed, we calculate mk = mxk = mx, + x; = ml m1 whereas m; and m / have already been calculated and so we get m = ma. A double chain of additions (x;); for the values a and b is defined as the set above such that x; = a (i E {0 ... n-1}) and xn = b, in particular xn-1 = a. We choose in particular the double chain of additions composed of the values a; and B; such that: (agi, 2bi) if t i + 1 (a, b) = 0 and v i + 1 (a, b) = 0 (1) (agi + 1, bi + 1) = (agi, 2bi + 1) if t i + 1 (a, b) = 0 and v +1 (a, b) = 1 (2) (bi, ai + bi) if t i + 1 (a, b) = 1 (3) with (ao, bo) = (0, 1), n such that (an, bn) = (a, b), and t; +1 = 0 If a; +1 <ù b; +1 / 2 t; +1 = 1 If a; +1> b; +1 / 2 v; +1 = b; +1 mod 2. A method for calculating this string will be described below. This double chain of additions has the advantage of having a memory depth of 3. In fact, the evolution of the intermediate values (a; b;) of the chain of additions is limited by the following operations: addition of a value to itself (ie a multiplication by 2), addition of the two intermediate values between them, and incrementation of a value by 1. It follows that at a given instant, it is only necessary to store these two intermediate values (a;, b;) and the value 1 (these values respectively corresponding to ma, mb and m in the double exponentiation calculations). On the contrary, conventional solutions for using simple addition strings require a large memory space in order to store the set of intermediate powers m, used for the calculation of the following powers. The invention is however not limited to this double chain of additions and any longer or shorter chain may be used.

La chaîne binaire w est composée, pour i croissant, des valeurs Ti suivies chacune lorsque Ti = 0 de la valeur v;. Cette chaîne binaire est une représentation compressée de la double chaîne d'additions permettant d'optimiser la mémoire du dispositif 40. On comprend ici que les opérations susmentionnés liant les valeurs (a;+1, b;+1) et (a;, b;) ne sont pas limitatives et peuvent être plus nombreuses. Le choix restreint ci-dessus permet cependant d'obtenir une chaîne binaire w très compacte en raison du faible nombre de bits utilisés pour coder chaque opération. Grâce à cette double chaîne d'additions, on va calculer les deux exponentiations souhaitées : (m°^,mbn )_ (m°,mb) par itérations des paires m b' )i=o... n De retour à la figure 4, on poursuit en comparant w; à 0 (afin de déterminer les opérations reliant (a;+1, b;+1) à (a;, b;)) lors de l'étape E156. Si w;=0 à l'étape E156 (correspondant à Ti = 0), on monte au carré (étape E158, correspondant au fait que b;+1 = f (2b;)) le registre R7. Ce registre correspond initialement à la valeur 0 et au fur et à mesure où y est modifié, le registre R7 stocke à tout instant la valeur mb= On incrémente également l'indice i = i+1 de sorte à récupérer le bit suivant dans la chaîne w (comprenant ici la valeur v;). The binary string w is composed, for increasing i, of values Ti each followed when Ti = 0 of the value v ;. This binary chain is a compressed representation of the double chain of additions making it possible to optimize the memory of the device 40. It is understood here that the aforementioned operations linking the values (a; +1, b; +1) and (a; b;) are not limiting and may be more numerous. The restricted choice above, however, makes it possible to obtain a very compact bit string w because of the small number of bits used to code each operation. Thanks to this double chain of additions, we will compute the two desired exponentiations: (m ° ^, mbn) _ (m °, mb) by iterations of the pairs mb ') i = o ... n Back to the figure 4, we continue by comparing w; to 0 (to determine the operations connecting (a; +1, b; +1) to (a ;, b;)) in step E156. If w; = 0 in step E156 (corresponding to Ti = 0), one goes up to the square (step E158, corresponding to the fact that b; +1 = f (2b;)) the register R7. This register corresponds initially to the value 0 and as it is modified, the register R7 stores at any time the value mb = One also increments the index i = i + 1 so as to recover the next bit in the string w (here including the value v;).

A l'étape El 60, ce nouveau bit w; est comparé à 1. En cas d'égalité, le registre R7 est multiplié par le message m au cours de l'étape E162, pour prendre en compte que l'on incrémente 2b; obtenu précédemment pour obtenir b;+1 (équation (2)). On poursuit à l'étape E164. Si ce nouveau bit w; est égal à 0, on va directement à l'étape E164. In step El 60, this new bit w; is compared to 1. In case of equality, the register R7 is multiplied by the message m during the step E162, to take into account that it increments 2b; previously obtained to obtain b; +1 (equation (2)). We continue at step E164. If this new bit w; is 0, go directly to step E164.

En effet, l'équation (1) n'implique pas d'incrémentation de la valeur 2b;. Indeed, equation (1) does not imply incrementation of the value 2b;

Suite au test de l'étape E156, si le bit w; est égal à 1 (Ti = 1), on multiplie (étape El 66) les deux registres R7 et R701 et on stocke le résultat dans le registre R701. On remplace ensuite y par yO1, ainsi le résultat du calcul précédent est désormais stocké dans R7 (celui qui stocke mbi+1) et R701 comprend mai+1 = mb= comme on le voit dans la formule (3). Et on poursuit à l'étape E164. A cette dernière étape, on incrémente la valeur i pour passer au bit w; suivant (étape E164). On compare, à l'étape E168, l'indice i avec la valeur n*, où n* est la longueur de la chaîne binaire w; (déterminée lors de l'étape E154 par exemple). Si i < n*, on retourne à l'étape E156 de sorte à parcourir la suite de la chaîne w et calculer successivement tous les (ma',mb )i=o...n . Si i n*, la chaîne w a été parcourue entièrement. On dispose donc dans les registres Ro et RI des valeurs ma et mb. On retourne (E170) donc les valeurs stockées dans ces registres sous forme (R701, R7), c'est-à-dire (ma, mb). Le calcul de la double exponentiation prend alors fin. Le traitement pour le calcul de double exponentiation présenté ici en référence à la figure 4 a l'avantage de réaliser en moyenne 1,65 multiplication par bit composant l'exposant, alors que des algorithmes de l'art antérieur tel Giraud nécessitent deux multiplications par bit d'exposant. Afin d'éviter toute corruption de l'indice y juste avant de retourner la valeurs des registres à l'étape E170 (ce qui provoquerait une interversion entre ma et mb et donc une sortie erronée à l'étape E118, alors même que l'égalité ma.mb=1 est toujours vérifiée), on envisage de stocker tout du long de l'algorithme de la figure 4 deux fois la valeur y dans deux registres distincts. A l'étape E170, il est alors procédé à une comparaison de ces deux registres qui doivent contenir la même valeur y pour que les registres (R701, R7) soient retournés. Cette protection de l'indice y est mise en oeuvre en particulier lors des algorithmes CRT-RSA explicités ci-après. Following the test of step E156, if the bit w; is equal to 1 (Ti = 1), the two registers R7 and R701 are multiplied (step El 66) and the result is stored in the register R701. We then replace y with yO1, so the result of the previous calculation is now stored in R7 (the one that stores mbi + 1) and R701 includes mai + 1 = mb = as we see in formula (3). And we continue at step E164. At this last step, the value i is incremented to go to the bit w; following (step E164). In step E168, the index i is compared with the value n *, where n * is the length of the bit string w; (determined during step E154 for example). If i <n *, we return to step E156 so as to traverse the sequence of the chain w and successively calculate all the (ma ', mb) i = o ... n. If i n *, the string w has been traversed entirely. We thus have in the registers Ro and RI values ma and mb. We return (E170) therefore the values stored in these registers in form (R701, R7), that is to say (ma, mb). The calculation of the double exponentiation then ends. The processing for the double exponentiation calculation presented here with reference to FIG. 4 has the advantage of averaging 1.65 multiplication per component bit of the exponent, whereas algorithms of the prior art such as Giraud require two multiplications per exponent bit. In order to avoid any corruption of the index y just before returning the values of the registers in step E170 (which would cause a reversal between ma and mb and therefore an erroneous output in step E118, even though the equality ma.mb = 1 is always verified), it is planned to store throughout the algorithm of FIG. 4 twice the value y in two distinct registers. In step E170, a comparison is then made between these two registers, which must contain the same value y for the registers (R701, R7) to be returned. This protection of the index is implemented in particular during the CRT-RSA algorithms explained below.

Par ailleurs, afin d'éviter toute modification intentionnelle de la chaîne d'additions w, par exemple par remplacement d'un bit final "1" en deux bits finaux "01" ou "00", on prévoit à l'étape El 70 de procéder à une vérification plus précise de l'indice 'i' comparativement à la valeur n*: - si i = n*, les registres peuvent être retournés, - si i > n*, un message d'erreur est alors retourné. On décrit maintenant en référence à la figure 5 la détermination de la chaîne binaire w évoquée à l'étape E154. La solution retenue ici consiste à partir de la paire (a, b) et à diminuer ces valeurs jusqu'à (0, 1) en se limitant aux opérations de division par deux, de soustraction des valeurs intermédiaires et de décrémentation par 1. En effet, si ao Ro alors on a les propriétés suivantes: ai pi il existe n tel que (an, tan) = (0, 1). Moreover, in order to avoid any intentional modification of the additive chain w, for example by replacing a final bit "1" in two final bits "01" or "00", provision is made in step El 70 to carry out a more precise verification of the index 'i' compared to the value n *: - if i = n *, the registers can be returned, - if i> n *, an error message is then returned. The determination of the binary string w evoked in step E154 is now described with reference to FIG. The solution adopted here consists of starting from the pair (a, b) and decreasing these values up to (0, 1) by limiting itself to the operations of division by two, subtraction of the intermediate values and decrementation by 1. In indeed, if ao Ro then we have the following properties: ai pi there exists n such that (an, tan) = (0, 1).

Ce calcul des valeurs (a;, 13;) est effectué à l'aide des relations suivantes : (ai,(3i /2) siai 13i /2 et (3i mod2=0 (î1j31)= (ai,(t3 -1)/2) siaiRi /2et(3i mod2=1 (13i -ai,ai) si ai >'3i /2 où les valeurs a et 13 sont donc telles que: (ao, 130) = (a, b) et (an, (3n) = (0, 1). This computation of the values (a ;, 13;) is carried out using the following relations: (ai, (3i / 2) siai 13i / 2 and (3i mod2 = 0 (il31) = (ai, (t3 -1 ) / 2) siaiRi / 2and (3i mod2 = 1 (13i -ai, ai) if ai> '3i / 2 where the values a and 13 are such that: (ao, 130) = (a, b) and ( an, (3n) = (0, 1).

On intervertit initialement a et b de telle sorte que ao (30. On remarque que (a;, b;) = (an_;, 13n_;) et que pour obtenir w;, on a : tii=0sian_i13n_i/2 ti;=1 sian_;>(3n_;/2 v;=13n_;mod 2. We initially invert a and b so that ao (30) We notice that (a ;, b;) = (an_ ;, 13n_;) and that to obtain w; we have: tii = 0sian_i13n_i / 2 ti = 1 sian _;> (3n _; / 2 v; = 13n_; mod 2.

On cherche ici à diminuer au plus vite les valeurs a; et 13;, en diminuant progressivement 13; jusqu'à ce qu'il soit proche de a; (limite à a;>13;/2). On soustrait alors a; à 13; et on intervertit les deux valeurs de sorte à conserver la propriété a; 13;. On diminuer ainsi plus vite le plus grand des nombres, comparé à une simple division par 2. En conséquence, la chaîne d'additions est plus courte et les calculs d'exponentiation plus rapides. De retour à la figure 5, on calcule donc les valeurs intermédiaires (a;, pi) et on en déduit les bits Ti et v; composant la chaîne w : A l'étape E200, le microprocesseur reçoit en entrée les valeurs a et b avec a b. On initialise, à l'étape E202, un premier registre Ro à la valeur a (c'est-à-dire ao) et un deuxième registre RI à la valeur b (c'est-à-dire (3o). De même, un booléen y (servant par la suite à indiquer le registre Ry stockant pi, Ryal stockant a;) est initialisé à 1 alors qu'une variable j d'incrémentation est elle initialisée à n* correspondant à la longueur de la chaîne w. A ce stade, la chaîne w n'est pas connue donc n* non plus. On peut cependant démontrer que n* est statistiquement borné (borne supérieure) par la valeur 2,2 log2 b. On prévoit donc de stocker w dans une mémoire tampon Q. de longueur 2,2 log2 b en initialisant j par l'index de bit final de cette mémoire tampon: j =1-2,2 log2 dl -1. A l'étape E204, on vérifie si (Ryal, Ry) est égal à (0, 1) auquel cas on a fini la décomposition de (a, b). Dans le cas où cette égalité n'est pas vérifiée, on compare Ry/2 et Ryal (étape E206), afin de déterminer quelle décomposition parmi les trois formules ci-dessus on applique. On note ici que le résultat de cette comparaison correspond à la valeur de i pour cette décomposition. Si Ry/2 Ryal (i = 0), alors on mémorise 52.1 = Ti = 0, puis s = v; = Ry mod 2 et on divise (Ry - Ry mod 2) par deux (les indices 'i' sont renseignés ici à titre indicatif en référence à a; et pi, et varient non linéairement avec l'indice 'j'). Lorsque la division ne conserve que la partie entière du quotient, on peut effectuer uniquement la division de Ry par deux. On décrémente j de 2 (étape E208). Si Ry/2 < Ryal (i = 1), on passe à l'étape E210 où l'on mémorise ni = Ti = 1, on soustrait Ryal à Ry (ce qui permet d'obtenir pi-ai), puis on modifie le bit y = yO1 de sorte que le résultat obtenu soit dans Ryal c'est-à-dire corresponde à a; conformément aux opérations prévus ci-dessus. On décrémente de 1 l'index j. A la suite des étapes E208 et E210, on retourne à l'étape E204 pour déterminer si on a fini la décomposition de (a, b). Dans l'affirmative de la comparaison E204, la décomposition est finie et on retourne la chaîne w à l'étape E212. Il est à noter que la chaîne w retournée est formée des seuls bits g+1 à g-2,2 log dl-1 (on a donc n* _ 1-2,2 loge dl -j-1) car aucune valeur t ou v n'a été enregistrée dans les bits ni à no. Dans ce cas, la longueur de la chaîne w utilisée lors de l'étape E168 ne comptabilise que les bits retournés ici. Dans un mode de réalisation on prévoit de réaliser les opérations des figures 4 et 5 sous forme d'algorithmes atomiques de sorte à contrecarrer d'éventuelles attaques de type side channe/ analysis. Pour ce faire, la détermination de la chaîne w (figure 5) est réalisée 15 comme suit : 1.Ri,, 4-a;Rip 4-b;j4-[2,21og2blû1 2. tant que (R.~ , R~p) ≠ (0,1) faire les étapes 3 à 9 ci - dessous 3. R. 4- R. û ~tp ~p 4. v~R. mode 5. RZR 4- RZR /2 6. t - (R~p R~e, ) 7. t;SZ14-tvv 8. (la , l R lep) (t /~ (Ltmp La ,i(3 )) v ((t 0 l) A (La ,i(3 )) 9. j4- jû1û(tO1) 10. retournerw = (52;+1,...,~~z,zlogzbi_1) Ro, R1 et R2 sont utilisés pour stocker les valeurs a;, pi et une valeur temporaire. Les indices ia, ia, itmp e {0,1,2}, sont tels que Ri,, stocke a;, RZR stocke 20 R; et R. stocke la valeur temporaire. A représente l'opération logique ET, v représente l'opération logique OU (par disjonction) et les opérations logiques sont étendues aux espaces {0,1}x {0,1}n _> {0,1}n entre l'argument de gauche et chaque coordonnée de l'argument de droite. T - (A B) représente l'opération qui retourne '1' si la comparaison (A B) est vérifiée et '0' sinon (A > B). We seek here to reduce as quickly as possible the values a; and 13, decreasing progressively 13; until he is close to a; (limit to a;> 13; / 2). We subtract then a; at 13; and the two values are inverted to retain property a; 13 ;. The largest of the numbers is thus reduced faster than a simple division by 2. As a result, the chain of additions is shorter and the exponentiation calculations are faster. Returning to FIG. 5, the intermediate values (a;, pi) are thus calculated and the bits Ti and v are deduced therefrom; component w chain: In step E200, the microprocessor receives as input the values a and b with a b. In step E202, a first register Ro is initialized to the value a (that is to say ao) and a second register RI to the value b (that is to say (3o). , a boolean y (later used to indicate the register Ry storing pi, Ryal storing a;) is initialized to 1 while an incrementation variable j is initialized to n * corresponding to the length of the string w. At this stage, the string w is not known, therefore n * either, but we can prove that n * is statistically bounded (upper bound) by the value 2.2 log2 b, so we plan to store w in a memory Q buffer of length 2.2 log2b by initializing j by the final bit index of this buffer: j = 1-2,2 log2 dl -1 At step E204, it is checked whether (Ry, Ry ) is equal to (0, 1) in which case the decomposition of (a, b) has been completed, and in the case where this equality is not satisfied, Ry / 2 and Ryal are compared (step E206), in order to determine what a decomposition among the three f above, we apply here, and note that the result of this comparison corresponds to the value of i for this decomposition. If Ry / 2 Ryal (i = 0), then we memorize 52.1 = Ti = 0, then s = v; = Ry mod 2 and divide (Ry - Ry mod 2) by two (the indices 'i' are given here as an indication with reference to a, and pi, and vary nonlinearly with the index 'j'). When the division keeps only the entire part of the quotient, one can only perform the division of Ry by two. Decremented by 2 (step E208). If Ry / 2 <Ryal (i = 1), we go to step E210 where we memorize ni = Ti = 1, we subtract Ryal from Ry (which gives pi-ai), then we modify the bit y = yO1 so that the result obtained is in Ryal, that is to say corresponds to a; in accordance with the operations provided for above. We decrement 1 index j. Following steps E208 and E210, return to step E204 to determine if the decomposition of (a, b) has been completed. In the affirmative of the comparison E204, the decomposition is finite and the chain w is returned to the step E212. It should be noted that the returned string w is formed from the only bits g + 1 to g-2.2 log dl-1 (so we have n * _ 1-2,2 box dl -j-1) because no value t or v was not recorded in the bits nor at no. In this case, the length of the string w used in step E168 counts only the bits returned here. In one embodiment, it is planned to carry out the operations of FIGS. 4 and 5 in the form of atomic algorithms so as to thwart any side channe / analysis attacks. To do this, the determination of the chain w (FIG. 5) is carried out as follows: 1.Ri ,, 4-a; Rip 4-b; j4- [2,21og2blu1 2. as long as (R. ~ p) ≠ (0,1) do steps 3 to 9 below 3. R. 4- R. û ~ tp ~ p 4. v ~ R. 5. RZR 4- RZR / 2 6. t - (R ~ p R ~ e,) 7. t; SZ14-tvv 8. (la, l R lep) (t / ~ (Ltmp La, i (3) ) v ((t 0 l) A (La, i (3)) 9. j4-jû1û (tO1) 10. returnw = (52; +1, ..., ~~ z, zlogzbi_1) Ro, R1 and R2 are used to store the values a ;, pi and a temporary value The indices ia, ia, itmp e {0,1,2}, are such that Ri ,, stores a ;, RZR stores 20 R; the temporary value A represents the AND logical operation, v represents the OR logical operation (by disjunction) and the logical operations are extended to the spaces {0,1} x {0,1} n _> {0,1} n between the left argument and each coordinate of the right argument T - (AB) represents the operation that returns '1' if the comparison (AB) is true and '0' otherwise (A> B).

Ici, on observe que toutes les opérations sont calculées à chaque itération quelques soient les valeurs de t (correspondant à i) et de v (correspondant à v). L'algorithme est donc bien atomique. On a vu ci-dessus que la longueur de la chaîne w a une limite supérieure égale à 2,2 loge b soit 2,2 / où lest la longueur des exposants. Here, we observe that all operations are calculated at each iteration, whatever the values of t (corresponding to i) and v (corresponding to v). The algorithm is therefore atomic. It has been seen above that the length of the chain w has an upper limit equal to 2.2 housing b or 2.2 / where the length of the exponents.

Au lieu de prévoir une mémoire de 5,2 / pour stocker w et les trois registres, on réserve initialement 1,2 / de mémoire pour les bits w; de plus grand index. Puis au cours des calculs ci-dessus, notamment lorsque l'on a rempli ces 1,2 / bits et que les valeurs a; et pi (après les nombreuses opérations ci-dessus) ont une longueur sensiblement également à / = 2, on peut compresser les trois registres sur 2/ bits et récupérer ainsi / bits pour stocker les bits w; de plus faibles index. De façon similaire aux calculs de la chaîne binaire w, on peut envisager une réalisation atomique du calcul de double exponentiation (figure 4) comme suit : 1. R(0,0) 1; R(0,1) m; R(1,0) m 2.y 4-1;g 1;i 4- 0 3.w 4- f (a, b) où f est l' algorithme atomique ci - dessus de calcul de la chaîne w 4. tant que i < n * faire les étapes 5 à 8 ci - dessous 5. t(oi Ag;v(0i+in 6. R(oror) 4- R(orot).R(( oi),rA ) modN 7. tv(vO1);y4-yOt 8. i-i+1.t+gA(tO1) 9. retourner (Rron, Rr ) On utilise ici trois registres : R(o,7el) et R(o, Y) stockant respectivement les valeurs intermédiaires mai et mbj, ainsi que R(l,o) stockant m. La variable correspond, quant à elle, à v de sorte à indiquer s'il y a lieu de procéder à une multiplication par m (R(l,o du registre R(o, 7) ou pas. Instead of providing a memory of 5.2 / to store w and the three registers, initially 1.2 / memory is reserved for the bits w; larger index. Then during the above calculations, especially when one filled these 1.2 / bits and the values a; and pi (after the many operations above) have a length substantially equally at / = 2, it is possible to compress the three registers on 2 / bits and thus to recover / bits for storing the bits w; lower indexes. Similar to the calculations of the binary string w, an atomic realization of the double exponentiation calculation (FIG. 4) can be envisaged as follows: 1. R (0,0) 1; R (0.1) m; R (1.0) m 2.y 4-1; g 1; i 4- 0 3.w 4- f (a, b) where f is the above atomic algorithm for calculating the chain w 4. as long as steps 5 to 8 below are carried out in the following manner: ## EQU1 ## where R (or) R (orot) 4 R (orot) .R ((oi), rA) modN 7 tv (vO1); y4-yOt 8. i-i + 1.t + gA (tO1) 9. return (Rron, Rr) Three registers are used here: R (o, 7el) and R (o, Y) storing the intermediate values mai and mbj, as well as R (l, o) storing m The variable corresponds, for its part, to v so as to indicate if it is necessary to proceed with a multiplication by m (R ( l, o of the register R (o, 7) or not.

En référence maintenant à la figure 6, on illustre un autre exemple de réalisation du calcul de double exponentiation de l'étape E114. Cet exemple est de type square and multiply . A l'étape E300, le microprocesseur reçoit en entrée les paramètres m, a={a,_1...ao} et b={b1_1...bo} prévus lors de l'étape E114. A l'étape E302, on initialise deux variables A et B chacune à la valeur 1, une variable M à la valeur m, et une variable i d'itération à O. On poursuit à l'étape E304 en comparant le bit a; à 1. En cas d'égalité, on effectue l'opération A = A.M à l'étape E306 puis on passe à l'étape E308. En cas d'inégalité, on passe directement à l'étape E308. A cette dernière, on compare le bit b; à 1. En cas d'égalité, on effectue l'opération B = B.M à l'étape E310 puis on passe à l'étape E312. En cas d'inégalité, on passe directement à l'étape E312. On incrémente alors la valeur i lors de l'étape E312. Referring now to FIG. 6, another exemplary embodiment of the double exponentiation calculation of step E114 is illustrated. This example is of type square and multiply. In step E300, the microprocessor receives as input the parameters m, a = {a, _1 ... ao} and b = {b1_1 ... bo} provided during step E114. In step E302, two variables A and B are initialized each to the value 1, a variable M to the value m, and an iteration variable i to 0. Proceed to step E304 by comparing the bit a; to 1. In the case of a tie, the operation A = A.M is performed in step E306 and then step E308. In case of inequality, go directly to step E308. At the latter, we compare the bit b; to 1. In the case of a tie, the operation B = B.M is performed in step E310 and then step E312. In case of inequality, go directly to step E312. The value i is then incremented during step E312.

Si i=l (test à l'étape E314), c'est-à-dire si on a parcouru tous les bits des exposants a et b, il est mis fin au traitement en retournant les valeurs A et B correspondant aux exponentiations ma et mb souhaitées (E316). Si le test de l'étape E314 est faux, on poursuit à l'étape E318 en élevant au carré la variable M, et on retourne à l'étape E304. If i = l (test in step E314), that is to say if all the bits of the exponents a and b have been traversed, the processing is ended by returning the values A and B corresponding to the exponentiations ma and mb desired (E316). If the test of step E314 is false, step E318 is continued by squaring the variable M, and return to step E304.

On décrit maintenant en référence à la figure 7 une adaptation des enseignements de l'invention au cas d'un cryptage de type RSA-CRT, s'appuyant sur des exponentiations modulaires. Dans le cas spécifique du groupe Z*N, le module de chiffrement N vaut p.q (deux grands nombres premiers) et l'ordre du groupe vaut l'indicatrice d'Euler cp(N)=(p-1).(q-1). Comme vu plus haut dans le cas CRT, la signature s est déterminée à partir de sp et sq, par exemple à l'aide de la recombinaison de Garner : s = CRT(sp, Sc) = sq + q.((q-' mod p).(sp - Sc) mod p). Dans les conditions de l'invention, on calcule les paires (sp, cp) et (Sc', 30 cq) où cp = mp-1 dP mod p et cq = mq-1 dg mod q , puis on combine ces deux paires à l'aide de la fonction CRT pour obtenir (md, m`'R-d) mod N. An adaptation of the teachings of the invention to the case of RSA-CRT type encryption, based on modular exponentiations, will now be described with reference to FIG. In the specific case of the group Z * N, the encryption module N is worth pq (two large prime numbers) and the group order is equal to the Euler indicator cp (N) = (p-1). 1). As seen above in the CRT case, the signature is determined from sp and sq, for example using Garner's recombination: s = CRT (sp, Sc) = sq + q. mod p). (sp - Sc) mod p). Under the conditions of the invention, we calculate the pairs (sp, cp) and (Sc ', cq) where cp = mp-1 dP mod p and cq = mq-1 dg mod q, then we combine these two pairs using the CRT function to get (md, m`'Rd) mod N.

En détail, les étapes E100' à E114' sont similaires aux étapes E100 à E114 susmentionnées, à ceci près que les données d'entrée sont m, d, N et (p(N) pour effectuer des exponentiations modulaires lors de l'étape E114'. A l'étape E116', le traitement fournit en sortie la paire (Ra, Rso1) correspondant à (md, m`'n-d) et prend fin. Ces étapes sont donc utilisées pour calculer (sp, cp) [respectivement (sq, cq)] en fournissant, comme données d'entrée, les valeurs m mod p, dp, p et cp(p)=(p-1) [respectivement m mod q, dq, q et 9(q)=(q-1)]. On effectue alors la combinaison de ces deux paires: s <_ CRT(sp, sq) c <ù CRT(cp, Cq). Puis conformément à l'enseignement de l'invention, on vérifie la relation reliant les deux exponentiations calculées et l'élément neutre 1 zN (ici 1) du groupe (étape E116 de la figure 3). On vérifie donc si l'égalité s.c mod(p.q) = 1 est obtenue. Dans l'affirmative, on retourne la signature s calculée. Dans la négative, une erreur est retournée. En variante, on peut vérifier les deux égalités suivantes et retourner une erreur s'il l'une d'entre elles n'est pas vérifiée: s.cpmodp=1 s. cg mod q = 1 Afin de garantir la sécurité de l'algorithme CRT-RSA eu égard à des attaques pouvant avoir lieu sur le message m avant chacune des doubles exponentiations, on prévoit de calculer, au début de l'algorithme CRT-RSA, un code contrôle de redondance cyclique (CRC) pour chacune des valeurs m modulo p et m modulo q (ces valeurs sont prises en premiers paramètres lors de l'étape E114') (respectivement, m modulo N dans le cas de l'étape E114 pour une exponentiation modulaire). Ces codes CRC sont mémorisés. Puis, au début de la double exponentiation de l'étape E114', on recalcule m modulo p (resp. m modulo q; resp. m modulo N pour l'étape E114) à partir de la valeur m, on stocke ces valeurs dans deux registres (R1 [étape E152] et le registre stockant m [utilisé à l'étape E162]), puis on vérifie l'intégrité de cette valeur nouvellement calculée en comparant son CRC avec celui calculé initialement. En cas de vérification négative, une erreur est retournée, sinon la double exponentiation peut être menée. Toute corruption ultérieure (après le début de la double exponentiation correspondante) de ces valeurs m modulo p et m modulo q (resp. m modulo N) est détectable au travers de la vérification finale (après l'étape E116'). Dans un mode de réalisation visant à protéger l'invention contre des attaques par faute de type "safe-error", on rend aléatoires les indices des registres impliqués dans les traitements visés ci-dessus (par exemple ceux des figures 4 et 5). Notamment, on génère au début de chaque traitement spécifique une valeur aléatoire r, et les traitements sont réalisés sur les registres R7 e r, R7 e 1 O+ r, RS O+ r et RS O+ 1 O+ r• De même, dans un mode de réalisation visant à protéger l'invention contre des attaques de type analyse différentielle des canaux cachés (ou "differential side channe/ analysis"), on ne manipule pas directement la valeur secrète d (également p et q) que l'on masque. Pour ce faire, on ajoute aux différents exposants un multiple aléatoire de l'ordre 13G du groupe. On génère deux nombres entiers aléatoires ri et r2 pour les deux exposants de la double exponentiation. In detail, the steps E100 'to E114' are similar to the aforementioned steps E100 to E114, except that the input data is m, d, N and (p (N) to perform modular exponentiations during the step E114 'In step E116', the process outputs the pair (Ra, Rso1) corresponding to (md, m`'nd) and ends, so these steps are used to calculate (sp, cp) [respectively (sq, cq)] providing, as input data, the values m mod p, dp, p and cp (p) = (p-1) [respectively m mod q, dq, q and 9 (q) = (q-1)] The combination of these two pairs is then carried out: s <_ CRT (sp, sq) c <ù CRT (cp, Cq) Then, in accordance with the teaching of the invention, the relationship between the two exponentiations calculated and the neutral element 1 zN (here 1) of the group (step E116 of Figure 3) .Therefore we check whether the equality sc mod (pq) = 1 is obtained. we return the calculated signature s If no, an error is returned Alternatively, one can check the two following equalities and return an error if one of them is not verified: s.cpmodp = 1 s. cg mod q = 1 In order to guarantee the security of the CRT-RSA algorithm with regard to attacks that can take place on the message m before each of the double exponentiations, it is expected to calculate, at the beginning of the CRT-RSA algorithm, a cyclic redundancy check code (CRC) for each of the values m modulo p and m modulo q (these values are taken as first parameters during step E114 ') (respectively, m modulo N in the case of step E114 for a modular exponentiation). These CRC codes are stored. Then, at the beginning of the double exponentiation of the step E114 ', we recalculate m modulo p (respectively m modulo q; resp. M modulo N for the step E114) starting from the value m, we store these values in two registers (R1 [step E152] and the storing register m [used in step E162]), and then checking the integrity of this newly calculated value by comparing its CRC with that initially calculated. In case of negative verification, an error is returned, otherwise the double exponentiation can be conducted. Any subsequent corruption (after the beginning of the corresponding double exponentiation) of these values m modulo p and m modulo q (respectively m modulo N) is detectable through the final verification (after step E116 '). In one embodiment for protecting the invention against "safe-error" type attacks, the indexes of the registers involved in the above-mentioned processes (for example those in FIGS. 4 and 5) are randomized. In particular, a random value r is generated at the beginning of each specific processing, and the processes are carried out on the registers R7, R7 and O + r, RS O + r and RS O + 1 O + r. Similarly, in one embodiment to protect the invention against attacks of the type of differential analysis of the hidden channels (or "differential side channe / analysis"), one does not directly manipulate the secret value d (also p and q) that one masks. To do this, we add to the different exponents a random multiple of the order 13G of the group. Two random integers ri and r2 are generated for the two exponents of the double exponentiation.

Ainsi, on calcule, selon les cas, (md+r1.14G 13G-d), md,,+n(P(P)mod p, mr2(P(P)-dp mod p , d4+ri.(p(q) modq mrr(P(q)-dq modq). Et la vérification E116 selon l'invention est toujours menée: md+ri.14G .mr2.$G-d _ m(ri+r2).14G = 1G . En particulier, r1=0 et r2=2 permet d'obtenir plus aisément la condition a<_b recherchée lors des étapes E112 et E112'. De la sorte, on calcule de façon générale: md et m2ù''Gùd. La table ci-après compare les performances théoriques de l'invention par rapport aux solutions de l'art antérieur pour un cryptage RSA-CRT de longueur 1024. La solution Vigilant est décrite par exemple dans la publication "RSA with CRT: A New Cost-Effective Solution to Thwart Fault Attacks", Cryptographic Hardware and Embedded Systems û CHES 2007, volume 5154 of Lecture Notes in Computer Science, pages 130-145. Printemps 2008. Pour cette solution, on a effectué des mesures pour une extension de module de {68, 80} bits pour une exponentiation à fenêtre glissante de valeur q. Algorithme de protection Temps (10b.to) Mémoire (Kb) Vigilant q=1 {511, 484} {2,4; 2,3} Vigilant q=2 {468, 444} {2,6; 2,5} Vigilant q=3 {440, 417} {3,7; 3,6} Giraud 537 3,5 Invention 443 2,5 (+1,1) L'invention fournit donc une des solutions les plus efficaces pour lutter contre les analyses par faute pour une mise en oeuvre RSA 1024, et ainsi sécuriser des algorithmes cryptographiques. Les exemples qui précèdent ne sont que des modes de réalisation 10 de l'invention qui ne s'y limite pas. Notamment, nous avons illustré ci-dessus l'invention à l'aide d'un groupe G muni d'une loi interne de composition "." et expliqué les adaptations pour le cas de l'exponentiation modulaire. L'invention, qui vise tout groupe G, est notamment adaptée à la cryptographie sur courbe elliptique. Dans ce cas, le 15 groupe G, constitué des points d'une ellipse, est muni d'une loi de composition interne additive '+' et l'exponentiation correspond à une multiplication scalaire. On dispose alors d'une fonction inversible f associant à tout message m binaire un point P du groupe G, constitué des points d'une ellipse. Pour chiffrer le message avec un clé d en une signature s, on calcule 20 alors l'exponentiation de P par d, ce qui correspond à une multiplication scalaire de P par d: s=P.d Selon les enseignements de l'invention, on calcule également l'exponentiation de P par 1eG-d: c=P.(1G-d) On vérifie ensuite, sur la base de la propriété P.1G=1 G, que c+s=1 G.Thus, we calculate (md + r1.14G 13G-d), md ,, + n (P (P) mod p, mr2 (P (P) -dp mod p, d4 + ri. (q) modq mrr (P (q) -dq modq) and the verification E116 according to the invention is always carried out: md + ri.14G .mr2. $ Gd_m (ri + r2) .14G = 1G. In particular, r1 = 0 and r2 = 2 make it possible to obtain more easily the condition a <_b sought during the steps E112 and E112 'Thus, in general, md and m2u''Gdd are computed. after compare the theoretical performance of the invention with respect to the solutions of the prior art for an RSA-CRT encryption of length 1024. The Vigilant solution is described for example in the publication "RSA with CRT: A New Cost-Effective Solution to Thwart Fault Attacks ", Cryptographic Hardware and Embedded Systems - CHES 2007, Volume 5154 of Lecture Notes in Computer Science, pages 130-145, Spring 2008. For this solution, measurements were made for a module extension of {68, 80 } bits for a sliding window exponentiation of v alue q Protection algorithm Time (10b.to) Memory (Kb) Vigilant q = 1 {511, 484} {2,4; 2,3} Vigilant q = 2 {468, 444} {2,6; 2.5} Vigilant q = 3 {440, 417} {3.7; 3.6} Giraud 537 3.5 Invention 443 2.5 (+1.1) The invention thus provides one of the most effective solutions to fight against fault analysis for an implementation RSA 1024, and thus secure cryptographic algorithms. The foregoing examples are only embodiments of the invention which are not limited thereto. In particular, we illustrated above the invention using a group G provided with an internal composition law "." and explained the adaptations for the case of modular exponentiation. The invention, which targets any group G, is particularly suitable for cryptography on elliptic curve. In this case, the group G, consisting of the points of an ellipse, is provided with an additive internal composition law '+' and the exponentiation corresponds to a scalar multiplication. We then have an invertible function f associating with any binary message a point P of the group G, consisting of the points of an ellipse. To encrypt the message with a key d in a signature s, then the exponentiation of P by d is calculated, which corresponds to a scalar multiplication of P by d: s = Pd According to the teachings of the invention, we calculate also the exponentiation of P by 1G-d: c = P (1G-d) One then checks, on the basis of the property P.1G = 1G, that c + s = 1G.

25 Dans l'affirmative, on peut retourner la signature s attendue. If yes, we can return the expected signature.

Claims (19)

REVENDICATIONS1. Procédé de traitement de données, comprenant une étape de double exponentiation (E114, E114') d'un élément (m) d'un groupe fini (G) par un premier exposant (a) pour fournir une première valeur (Ro, R8, ma) et par un deuxième exposant (b) lié au premier exposant pour fournir une deuxième valeur (RI, RSOl, mb), et une étape de test (E116) d'une relation entre lesdites première et deuxième valeurs caractérisé en ce que : - le deuxième exposant (b) est égal à 1eG û d, où d est le premier exposant et 15'6 est l'ordre du groupe (G) ou un multiple de celui-ci ; et - ladite étape de test comprend une comparaison entre lesdites première et deuxième valeurs et l'élément neutre (1 G) du groupe. REVENDICATIONS1. A data processing method comprising a double exponentiation step (E114, E114 ') of an element (m) of a finite group (G) by a first exponent (a) to provide a first value (Ro, R8, ma) and a second exponent (b) bound to the first exponent to provide a second value (R1, RSO1, mb), and a test step (E116) of a relationship between said first and second values characterized in that: the second exponent (b) is equal to 1eG-d, where d is the first exponent and 15'6 is the order of the group (G) or a multiple thereof; and said testing step comprises a comparison between said first and second values and the neutral element (1 G) of the group. 2. Procédé selon la revendication 1, dans lequel lors dudit test (E116), on compare le produit de la première valeur et de la deuxième valeur selon la loi interne (*) dudit groupe (G) avec ledit élément neutre (1G). 2. Method according to claim 1, wherein during said test (E116), comparing the product of the first value and the second value according to the internal law (*) of said group (G) with said neutral element (1G). 3. Procédé selon l'une des revendications 1 et 2, dans lequel ladite double exponentiation (E114, E114') est réalisée de façon itérative, en mettant, à chaque itération, au carré (E318) selon la loi du groupe un premier paramètre (M) et à jour deux variables (A, B), chacune pour respectivement chaque bit (a;) du premier exposant (a) et chaque bit (b;) du deuxième exposant (b), par application dudit premier paramètre (M) selon la loi interne du groupe. 3. Method according to one of claims 1 and 2, wherein said double exponentiation (E114, E114 ') is performed iteratively, putting, at each iteration, squared (E318) according to the law of the group a first parameter (M) and up to date two variables (A, B), each for each bit (a;) of the first exponent (a) and each bit (b;) of the second exponent (b), respectively, by applying said first parameter (M ) according to the internal law of the group. 4. Procédé selon l'une des revendications 1 et 2, dans lequel ladite double exponentiation (E114, E114') comprend une étape de calcul desdites première et deuxième valeurs à l'aide d'une double chaîne d'additions (w), ladite double chaîne étant déterminée pour les deux exposants (a, b). 4. Method according to one of claims 1 and 2, wherein said double exponentiation (E114, E114 ') comprises a step of calculating said first and second values using a double chain of additions (w), said double chain being determined for the two exponents (a, b). 5. Procédé selon la revendication 4, dans lequel ladite double chaîne d'additions (w) est mémorisée à l'initialisation d'un dispositif mettant en oeuvre la double exponentiation. 5. Method according to claim 4, wherein said dual additions chain (w) is stored at the initialization of a device implementing the double exponentiation. 6. Procédé selon la revendication 4, la double exponentiation (E114, E114') comprend une opération de détermination (E154) de ladite double chaîne d'additions (w). 6. The method of claim 4, the double exponentiation (E114, E114 ') comprises an operation of determination (E154) of said double chain of additions (w). 7. Procédé selon la revendication précédente, dans lequel ladite opération de détermination (E154) comprend la décomposition itérative des deux exposants (a, b) en paires de valeurs intermédiaires (a;, 13;) jusqu'à l'obtention de la paire (0,1), chaque élément d'une paire intermédiaire (a;, 13;) résultant d'une opération sur les éléments de la paire précédente (a;_,, choisie parmi : - la conservation d'un élément précédent, - la soustraction d'un élément précédent à l'autre, - la division d'un élément précédent par deux, ledit élément précédent étant préalablement décrémenté de 1 lorsqu'il est impair. 7. Method according to the preceding claim, wherein said determination operation (E154) comprises the iterative decomposition of the two exponents (a, b) into pairs of intermediate values (a ;, 13;) until the pair is obtained. (0,1), each element of an intermediate pair (a ;, 13;) resulting from an operation on the elements of the preceding pair (a; _ ,, chosen from: - the conservation of a preceding element, the subtraction of a preceding element to the other, the division of a preceding element by two, said preceding element being previously decremented by 1 when it is odd. 8. Procédé selon la revendication précédente, dans lequel ladite décomposition (E154) comprend les itérations suivantes : (ai,(3i /2) siai 13i /2 et (3i mod2=0 (î1j31)= (ai,(t3 -1)12) siai13i /2et(3i mod2=1 , (13i ùai,ai) si ai >'3i /2 où (ao, 13o) = (a,b), et on représente ladite chaîne d'additions sous forme de chaîne binaire (w) où chaque bit (w;) renseigne du résultat des comparaisons de l'itération. 8. Method according to the preceding claim, wherein said decomposition (E154) comprises the following iterations: (ai, (3i / 2) siai 13i / 2 and (3i mod2 = 0 (il31) = (ai, (t3 -1) 12) siai13i / 2et (3i mod2 = 1, (13i ùai, ai) if ai> 3i / 2 where (ao, 13o) = (a, b), and we represent the said chain of additions in the form of a binary string (w) where each bit (w;) gives the result of the comparisons of the iteration. 9. Procédé selon la revendication précédente, dans lequel ladite décomposition (E154) comprend les opérations suivantes: 1. Ri,, 4-a;Rip 4_b;j4_n* 2. tant que (Ri,, , Rip ) ≠ (0,1) faire les étapes 3 à 9 ci - dessous 3. R. mP 4- R~~ ûR. 4. v - RZR mod2 5. RZR 4- RZR /2 6. t 4_ (R. ≤R. a ) 7. coj_1 t; coi t v v 8. (la,ip,lbnp) (t(Ltmp,La,L(3))v((t01)n(La,L(3,ibnp) 9. j jû1û(t$1) 9. The method according to the preceding claim, wherein said decomposition (E154) comprises the following operations: 1. R 1, 4-a; Rip 4_b; j4_n * 2. while (Ri ,,, Rip) ≠ (0.1 ) do steps 3 to 9 below 3. R. mP 4- R ~~ R. 4. v - RZR mod2 5. RZR 4- RZR / 2 6. t 4_ (R. ≤R a) 7. coj_1 t; 8. (la, ip, lbnp) (t (Ltmp, La, L (3)) v ((t01) n (La, L (3, ibn)) 10. retourner cO où Ro, RI et R2 sont utilisés pour stocker les valeurs a;, Ri et une valeur temporaire,les indices ia, ia, itmp E {0,1,2}, sont tels que Ria stocke a;, RiR stocke stocke la valeur temporaire, w; désigne un bit d'indice i dans la chaîne binaire (w), n* est la longueur de la chaîne binaire, t et v sont deux variables internes, A représente l'opération logique ET, et v représente l'opération logique OU (par disjonction) et les opérations logiques étant étendues aux espaces {0,1}x {0,1}n _> {0,1}n entre l'argument de gauche et chaque coordonnée de 10 l'argument de droite. 10. Procédé selon la revendication précédente, dans lequel, lors de l'exécution des itérations, on utilise un espace mémoire initialement réservé auxdits registres (Ro, RI, R2) pour stocker au moins partiellement ladite chaîne binaire (w). 15 10. return where 0, R1 and R2 are used to store the values a; R1 and a temporary value, the indices ia, ia, itmp E {0,1,2}, are such that Ria stores a ;, RiR stores the temporary value, w; denotes a bit of index i in the bit string (w), n * is the length of the bit string, t and v are two internal variables, A represents the AND logical operation, and v represents the logical OR operation ( by disjunction) and the logical operations being extended to the spaces {0,1} x {0,1} n _> {0,1} n between the left argument and each coordinate of the right argument. 10. Method according to the preceding claim, wherein, when performing the iterations, using a memory space initially reserved for said registers (Ro, RI, R2) for at least partially storing said bit string (w). 15 11. Procédé selon l'une des revendications 8 à 10, dans lequel la double exponentiation (E114) comprend les itérations suivantes : (mai ,mzb,) si ti i+1(a, b) = 0 et v i+1(a, b) = 0 (1) (m a , m zb'+1) si ti i+1(a, b) = 0 et v i+1(a, b) =1 (2) (mb' ma'+b, ) si 2 i+1(a,b) =1 (3) OÙ T.= 1 Si a n-i > 13 n-i /2 et vi =Rn-imod2. 20 11. Method according to one of claims 8 to 10, wherein the double exponentiation (E114) comprises the following iterations: (May, mzb,) if ti i + 1 (a, b) = 0 and v i + 1 ( a, b) = 0 (1) (ma, m zb '+ 1) if ti i + 1 (a, b) = 0 and v i + 1 (a, b) = 1 (2) (mb' ma ' + b,) if 2 i + 1 (a, b) = 1 (3) where T. = 1 If a ni> 13 ni / 2 and vi = Rn-imod2. 20 12. Procédé selon la revendication précédente, dans lequel ladite double exponentiation (E114, E114') comprend les calculs suivants: pi et Ri,,,, 5 0 si a n-i Ç R n-i / 2R(0,0) 4- 1; R(0,1) m; R(1,0) 4- m y4-1; 4-1;i4-0 tant que i < n * faire les étapes ci - dessous t 4ù Ct)i A i; V COQ+1 A R(oror) R(oror).R(( ol),rA ) mod N 1.1 4-tv(v0+1);y4-yO+t i4-i+1.1+iA(t0+1) retourner (Rrol , Rr ) où R(o,o), R(o,l) et R(l,o) sont des registres, t, .i et y sont des variables internes, w est la chaîne binaire et n* est la longueur de la chaîne binaire. 12. The method according to the preceding claim, wherein said double exponentiation (E114, E114 ') comprises the following calculations: pi and Ri ,,,, 5, if a n-i Ç R n-i / 2R (0,0) 4- 1; R (0.1) m; R (1.0) 4- m y4-1; 4-1; i4-0 as long as i <n * do the steps below t 4ù Ct) i A i; V COQ + 1 AR (oror) R (oror) .R ((ol), rA) mod N 1.1 4-tv (v0 + 1); y4-y0 + t i4-i + 1.1 + iA (t0 + 1) return (Rrol, Rr) where R (o, o), R (o, l) and R (l, o) are registers, t, .i and y are internal variables, w is the binary string and n * is the length of the binary string. 13. Procédé selon l'une quelconque des revendications précédentes, dans lequel on ajoute, avant ladite double exponentiation (E114, E114') et à chacun des premier et deuxième exposants (a, b), un multiple de l'ordre (1o) dudit groupe fonction respectivement d'une première et d'une deuxième valeurs (ri, r2) générées aléatoirement. 13. A method according to any one of the preceding claims, wherein before said double exponentiation (E114, E114 ') and to each of the first and second exponents (a, b) is added a multiple of the order (1o). said group respectively function of randomly generated first and second values (ri, r2). 14. Procédé selon l'une des revendications 1 à 13, dans lequel ledit groupe (G) présente une loi interne de type multiplication modulaire et la double exponentiation est une double exponentiation modulaire. 14. Method according to one of claims 1 to 13, wherein said group (G) has an internal law of modular multiplication type and the double exponentiation is a double modular exponentiation. 15. Procédé selon la revendication précédente, dans lequel on calcule la double exponentiation modulaire, de module N, de l'élément m à l'aide des restes chinois en réalisant les étapes suivantes : _ une première double exponentiation modulaire, de module p, de l'élément m par un premier exposant dérivé dp égal à d mod (p-1) et un deuxième exposant dérivé égal à n.(p-1)-dp, de sorte à fournir une première valeur intermédiaire (sp) et une deuxième valeur intermédiaire (cp); - une deuxième double exponentiation modulaire, de module q, de l'élément m par un troisième exposant dérivé dq égal à d mod (q-1) et un quatrième exposant dérivé égal à n'.(q-l)-dq, de sorte à fournir une troisième valeur intermédiaire (Sc') et une quatrième valeur intermédiaire (cq); où p et q sont deux entiers premiers tels que N=p.q, et n, n' sont deux entiers positifs non nuls, et ladite étape de test comprend une étape de recombinaison desdites première et troisième valeurs intermédiaires (sp, sq) de sorte à obtenirladite première valeur (s), et au moins une étape de comparaison entre ladite première valeur obtenue (s), l'élément neutre (1 G) et les deuxième et quatrième valeurs intermédiaires (cp, cq); 15. Method according to the preceding claim, in which the modular double exponentiation of the N module of the element m is calculated using the Chinese remains by carrying out the following steps: a first double modular exponentiation, of module p, of the element m by a first derivative exponent dp equal to d mod (p-1) and a second derivative exponent equal to n (p-1) -dp, so as to provide a first intermediate value (sp) and a second intermediate value (cp); a second double modular exponentiation, of modulus q, of the element m by a third derived exponent dq equal to d mod (q-1) and a fourth derived exponent equal to n '(ql) -dq, so as to providing a third intermediate value (Sc ') and a fourth intermediate value (cq); where p and q are two prime integers such that N = pq, and n, n 'are two non-zero positive integers, and said test step comprises a step of recombining said first and third intermediate values (sp, sq) so as to obtainingladite first value (s), and at least one step of comparing said first obtained value (s), the neutral element (1G) and the second and fourth intermediate values (cp, cq); 16. Procédé selon l'une des revendications 1 à 13, dans lequel ledit groupe (G) présente une loi interne de type addition sur une courbe elliptique et la double exponentiation est une double multiplication scalaire sur la courbe elliptique. 16. Method according to one of claims 1 to 13, wherein said group (G) has an internal addition type law on an elliptic curve and the double exponentiation is a double scalar multiplication on the elliptic curve. 17. Dispositif de traitement de données, comprenant - des moyens aptes à calculer une double exponentiation d'un élément (m) d'un groupe fini (G) par un premier exposant (a) pour fournir une première valeur (Ro, R8, ma) et par un deuxième exposant (b) lié au premier exposant pour fournir une deuxième valeur (RI, Rso1, mb) - des moyens de test d'une relation entre lesdites première et deuxième valeurs caractérisé en ce que : - le deuxième exposant (b) est égal à 1eG ù d, où d est le premier exposant et 15'6 est l'ordre du groupe (G) ou un multiple de celui-ci ; et - les moyens de test sont aptes à comparer lesdites première et deuxième valeurs et l'élément neutre (1 G) du groupe. A data processing device, comprising - means for calculating a double exponentiation of an element (m) of a finite group (G) by a first exponent (a) to provide a first value (Ro, R8, ma) and by a second exponent (b) linked to the first exponent to provide a second value (R1, Rso1, mb) - means for testing a relationship between said first and second values characterized in that: - the second exponent (b) is equal to 1eG ù d, where d is the first exponent and 15'6 is the order of the group (G) or a multiple of it; and the test means are able to compare said first and second values and the neutral element (1 G) of the group. 18. Dispositif selon la revendication précédente, comprenant des moyens de détermination d'une double chaîne d'additions en fonction desdits deux exposants de sorte à calculer ladite double exponentiation à partir de ladite double chaîne. 18. Apparatus according to the preceding claim, comprising means for determining a double chain of additions as a function of said two exponents so as to calculate said double exponentiation from said double chain. 19. Carte à microcircuit comprenant un dispositif selon l'une des revendications 17 et 18. 19. Microcircuit card comprising a device according to one of claims 17 and 18.
FR0951166A 2009-02-24 2009-02-24 METHOD FOR PROCESSING DATA INVOLVING EXPONENTIATION AND ASSOCIATED DEVICE Expired - Fee Related FR2942560B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
FR0951166A FR2942560B1 (en) 2009-02-24 2009-02-24 METHOD FOR PROCESSING DATA INVOLVING EXPONENTIATION AND ASSOCIATED DEVICE

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
FR0951166A FR2942560B1 (en) 2009-02-24 2009-02-24 METHOD FOR PROCESSING DATA INVOLVING EXPONENTIATION AND ASSOCIATED DEVICE

Publications (2)

Publication Number Publication Date
FR2942560A1 true FR2942560A1 (en) 2010-08-27
FR2942560B1 FR2942560B1 (en) 2015-06-26

Family

ID=41261672

Family Applications (1)

Application Number Title Priority Date Filing Date
FR0951166A Expired - Fee Related FR2942560B1 (en) 2009-02-24 2009-02-24 METHOD FOR PROCESSING DATA INVOLVING EXPONENTIATION AND ASSOCIATED DEVICE

Country Status (1)

Country Link
FR (1) FR2942560B1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2779519A1 (en) * 2013-03-11 2014-09-17 Thomson Licensing A method and a device for fault-resistant exponentiation in cryptographic systems
US9323604B2 (en) 2011-03-23 2016-04-26 Infineon Technologies Ag Signature update by code transformation
US9400636B2 (en) 2011-02-11 2016-07-26 Infineon Technologies Ag Apparatus and method for calculating a result in a scalar multiplication

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2884004A1 (en) * 2005-03-30 2006-10-06 Oberthur Card Syst Sa DATA PROCESSING METHOD INVOLVING MODULAR EXPONENTIATION AND ASSOCIATED DEVICE

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2884004A1 (en) * 2005-03-30 2006-10-06 Oberthur Card Syst Sa DATA PROCESSING METHOD INVOLVING MODULAR EXPONENTIATION AND ASSOCIATED DEVICE

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
ARNAUD BOSCHER ET AL: "CRT RSA Algorithm Protected Against Fault Attacks", 9 May 2007, INFORMATION SECURITY THEORY AND PRACTICES. SMART CARDS, MOBILE AND UBIQUITOUS COMPUTING SYSTEMS; [LECTURE NOTES IN COMPUTER SCIENCE;;LNCS], SPRINGER BERLIN HEIDELBERG, BERLIN, HEIDELBERG, PAGE(S) 229 - 243, ISBN: 9783540723530, XP019079368 *
BOS J ET AL: "ADDITION CHAIN HEURISTICS", ADVANCES IN CRYPTOLOGY. SANTA BARBARA, AUG. 20 - 24, 1989; [PROCEEDINGS OF THE CONFERENCE ON THEORY AND APPLICATIONS OF CRYPTOLOGY], NEW YORK, SPRINGER, US, vol. CONF. 9, 20 August 1989 (1989-08-20), pages 400 - 407, XP000135674 *
DE MACEDO MOURELLE L ET AL: "Reconfigurable Hardware for Addition Chains Based Modular Exponentiation", INFORMATION TECHNOLOGY: CODING AND COMPUTING, 2005. ITCC 2005. INTERNA TIONAL CONFERENCE ON LAS VEGAS, NV, USA 04-06 APRIL 2005, PISCATAWAY, NJ, USA,IEEE, vol. 1, 4 April 2005 (2005-04-04), pages 603 - 607, XP010795915, ISBN: 9780769523156 *
GIRAUD C: "An RSA Implementation Resistant to Fault Attacks and to Simple Power Analysis", IEEE TRANSACTIONS ON COMPUTERS, IEEE SERVICE CENTER, LOS ALAMITOS, CA, US, vol. 55, no. 9, 1 September 2006 (2006-09-01), pages 1116 - 1120, XP002460785, ISSN: 0018-9340 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9400636B2 (en) 2011-02-11 2016-07-26 Infineon Technologies Ag Apparatus and method for calculating a result in a scalar multiplication
US9323604B2 (en) 2011-03-23 2016-04-26 Infineon Technologies Ag Signature update by code transformation
EP2779519A1 (en) * 2013-03-11 2014-09-17 Thomson Licensing A method and a device for fault-resistant exponentiation in cryptographic systems
EP2779521A1 (en) * 2013-03-11 2014-09-17 Thomson Licensing A method and a device for fault-resistant exponentiation in cryptographic systems

Also Published As

Publication number Publication date
FR2942560B1 (en) 2015-06-26

Similar Documents

Publication Publication Date Title
FR2789535A1 (en) METHOD FOR SECURING AN ELECTRONIC SECRET KEY CRYPTOGRAPHY ASSEMBLY AGAINST PHYSICAL ANALYSIS ATTACKS
EP2296086B1 (en) Protection of prime number generation against side-channel attacks
WO2002063821A1 (en) Secure encryption method and component using same
FR3010210A1 (en) PROTECTION OF CALCULATION AGAINST HIDDEN CHANNEL ATTACKS
WO2010112739A1 (en) Method for performing a cryptographic task in an electronic component
EP3117555A1 (en) Countermeasure method for an electronic component implementing an elliptic curve cryptography algorithm
FR2888690A1 (en) CRYPTOGRAPHIC PROCESS FOR THE SECURE IMPLEMENTATION OF AN EXPONENTIATION AND ASSOCIATED COMPONENT
EP2280511A1 (en) Method for processing data protected against attacks by fault and associated device
EP1493078B1 (en) Cryptographic method protected against side channel attacks
FR2919739A1 (en) FAT GENERATION ATTACKED DATA PROCESSING METHOD AND ASSOCIATED DEVICE
FR2942560A1 (en) Data processing method for securing Rivest Shamir Adleman cryptographic algorithms on chip card, involves testing relation between values by comparing values with neutral element of finite group based on internal rule of finite group
EP2296307A1 (en) Cryptographic data processing method secured against fault attacks
WO2006070092A1 (en) Data processing method and related device
EP2336931B1 (en) Method for signature verification
EP2530867A1 (en) Cryptographic data-processing method
EP3407537B1 (en) Method of electronically signing a document with a predetermined secret key
EP3716044B1 (en) Protection of an iterative calculation
FR2864390A1 (en) Cryptographic process for e.g. message encryption and decryption, involves scanning bits of preset value from left to right in loop, and calculating and storing partial updated result equal to exponentiation in accumulator
Tardif Practical considerations on cryptanalytic time-memory trade-offs
FR3135854A1 (en) Secure provision of keys for fully homomorphic encryption
EP3614617A1 (en) Method and device for generating parameter(s) of an asymmetric cryptographic protocol from a blockchain, associated encryption and decryption method and device and computer program
EP3579491A1 (en) Modular inverse determination method and associated cryptographic processing device
FR2899751A1 (en) METHOD FOR CRYPTOGRAPHIC DATA PROCESSING, DEVICE AND PROGRAM THEREOF
EP3929726A1 (en) Cryptographic processing method, associated electronic device and computer program
EP3579493A1 (en) Protection of an iterative calculation

Legal Events

Date Code Title Description
PLFP Fee payment

Year of fee payment: 8

PLFP Fee payment

Year of fee payment: 9

PLFP Fee payment

Year of fee payment: 10

PLFP Fee payment

Year of fee payment: 12

CA Change of address

Effective date: 20200218

CD Change of name or company name

Owner name: IDEMIA FRANCE, FR

Effective date: 20200218

CJ Change in legal form

Effective date: 20200218

PLFP Fee payment

Year of fee payment: 13

ST Notification of lapse

Effective date: 20221005