DISPOSITIF DE PERMUTATION DE FILS ÉLECTRIQUES COMMANDÉ ÉLECTRONIQUEMENT ELECTRONICALLY CONTROLLED ELECTRIC WIRE SWITCHING DEVICE
L'invention concerne un dispositif électronique permettant de permuter des fils électriques entre eux, cette permutation étant elle-même commandée électroniquement. La réalisation de l'invention recquiert très peu de composants électroniques, et peut être utilisée dans des dispositifs électro- niques disposant de peu de capacité de calcul, ou de volume de mémoire. Le détail de l'invention est exposé dans une publication intitulée « Fast primitives for internai data scrambling in tamper résistant hardware », à paraître dans les actes de la conférence Ches'2001 (Cryptographie Hardware and Embedded Systems) qui se tiendra à Paris en mai 2001. Le problème de permuter des fils électriques en commandant électroniquement cette permutation est un problème bien connu, qui a des applications dans le domaine des réseaux en théorie de la commutation et également pour la sécurisation de données confidentielles à l'intérieur de dispositifs à intégrité protégée comme des cartes à puce.The invention relates to an electronic device for permuting electrical wires between them, this permutation being itself electronically controlled. The realization of the invention requires very few electronic components, and can be used in electronic devices having little computing capacity, or memory volume. The detail of the invention is exposed in a publication entitled “Fast primitives for internai data scrambling in tamper resistant hardware”, to appear in the proceedings of the Ches'2001 conference (Cryptography Hardware and Embedded Systems) to be held in Paris in May 2001. The problem of permuting electrical wires by electronically controlling this permutation is a well-known problem, which has applications in the field of networks in switching theory and also for securing confidential data inside integrity devices. protected like smart cards.
Plus explicitement, un tel dispositif prend en entrée n fils électriques, et les restitue en n fils qui sont permutés, cette permutation étant déterminée par la valeur numérique de k fils supplémen- taires correspondant à k bits 0/1 commandant la permutation. Cet ensemble de k bits est appelé la commande du dispositif. Les critères techniques souhaités pour un tel dispositif sont en général :More explicitly, such a device takes n electrical wires as input, and restores them to n wires which are permuted, this permutation being determined by the numerical value of k additional wires corresponding to k bits 0/1 controlling the permutation. This set of k bits is called the device command. The technical criteria desired for such a device are generally:
1. Que l'on puisse, grâce aux k bits de commande, engendrer le plus possible de permutations des n fils.1. That we can, thanks to the k control bits, generate as many permutations of the n wires as possible.
2. Que le dispositif comprenne le moins de portes logiques possibles.2. That the device include as few logic gates as possible.
3. Que le nombre de permutations engendrées soit le plus proche possible du nombre de commandes qu'il est possible de choisir.3. That the number of permutations generated be as close as possible to the number of commands that it is possible to choose.
4. Que les permutations engendrées le soient de manière uniforme lorsque l'on choisit la commande avec une probabilité uniforme dans l'ensemble {0, l}k.4. That the permutations generated are in a uniform way when one chooses the command with a uniform probability in the set {0, l} k .
5. Que le temps de traversée du circuit électronique associé soit très court.5. That the crossing time of the associated electronic circuit is very short.
En général, il est difficile de satisfaire tous ces critères. En particulier, il n'existe pas de dispositif de taille très compacte engendrant uniformément des permutations. L'invention comble cette lacune
en proposant un dispositif électronique qui permet d'engendrer un grand nombre de permutations, de manière uniforme, ou presque uniforme, et avec très peu de portes logiques.In general, it is difficult to meet all of these criteria. In particular, there is no device of very compact size uniformly generating permutations. The invention fills this gap by proposing an electronic device which makes it possible to generate a large number of permutations, uniformly, or almost uniformly, and with very few logic gates.
L'invention se décompose en deux dispositifs, qui ont indépendemment des avantages différents par rapport aux critères exposés plus haut.The invention is broken down into two devices, which independently have different advantages compared to the criteria set out above.
Nous exposons maintenant le détail des deux dispositifs. Pour cela, nous introduisons la description d'un dispositif électronique de base, que nous appelons un commutateur. Un commutateur est un circuit électronique qui possède deux fils d'entrée, deux filsd de sortie, et un bit de clé. Selon la valeur de ce bit de clé, les deux fils de sortie sont égaux aux deux fils d'entrée, ou sont égaux aux deux fils d'entrée dont les valeurs sont échangées l'une avec l'autre. La description électronique d'un commutateur est exposé à la figure 1.We now present the details of the two devices. For this, we introduce the description of a basic electronic device, which we call a switch. A switch is an electronic circuit that has two input wires, two output wires, and a key bit. Depending on the value of this key bit, the two output wires are equal to the two input wires, or are equal to the two input wires whose values are exchanged with each other. The electronic description of a switch is shown in Figure 1.
Par la suite, on utilisera davantage une description mathématique qu'une description en terme de dispositifs électroniques, ce qui nous amène à introduire certaines notations et concepts mathématiques. Toutefois, il y a une parfaite équivalence entre le langage mathématique que nous utilisons dans ce qui suit, et une description électronique stricto sensu. On note Sn le groupe des permutations de l'ensemble à n éléments {0, . . . , n — 1}. On a appelle par définition, permutation à clé une application σ de l'ensemble des clés {0, l}m dans l'ensemble Sn, ce qu'on symbolise par :Thereafter, we will use a mathematical description more than a description in terms of electronic devices, which leads us to introduce certain mathematical notations and concepts. However, there is a perfect equivalence between the mathematical language we use in the following, and an electronic description stricto sensu. We denote by S n the group of permutations of the set with n elements {0,. . . , n - 1}. By definition, key permutation is called an application σ of the set of keys {0, l} m in the set S n , which is symbolized by:
σ : {0( l}m → Sn K ^→ σκ . Une permutation à clé est simplement l'équivalent mathématique d'un dispositif permutant des fils électriques, cette permutation étant sélectionnée par une commande électronique K. Une transposition est un élément de Sn qui échange deux éléments de {0, . . . , n — 1}. On note (i, j) la transposition qui échange le symbole i avec le symbole j. D'autre part, le produit de deux permutations r et μ, noté v — τ o μ, ou simplement v = rμ, est défini par v(ï) — r(μ(i)) pour tout i dans {0, . . . , n — 1}. On rappelle un théorème mathématique qui indique que tout élément de Sn peut s'écrire comme un produit de transpositions. Dans notre contexte, la permutation à clé (i, j)b, b étant un bit de clé valant zéro ou un, correspond précisément à un commutateur dont les deux
entrées sont les bits d'indice i et j, et dont le bit de clé est le bit b. Par conséquent, le théorème précédant signifie que l'on peut obtenir toutes les configurations possibles des fils de sortie (i.e. toutes les permutations possibles) en empilant les uns à la suite des autres des commutateurs pour former le dispositif électronique final. Nous exposons maintenant en détail les deux dispositifs de l'invention. Dans les deux cas, ils traitent de la situation où le nombre de fils électriques concernés vaut une puissance de deux, ce qui permet de définir l'entier / tel que π = 2'.σ: {0 ( l} m → S n K ^ → σ κ . A key permutation is simply the mathematical equivalent of a device permuting electrical wires, this permutation being selected by an electronic control K. A transposition is a element of S n which exchanges two elements of {0,..., n - 1} We denote (i, j) the transposition which exchanges the symbol i with the symbol j. On the other hand, the product of two permutations r and μ, noted v - τ o μ, or simply v = rμ, is defined by v (ï) - r (μ (i)) for all i in {0,..., n - 1}. a mathematical theorem which indicates that any element of S n can be written as a product of transpositions. In our context, the key permutation (i, j) b , b being a key bit equal to zero or one, corresponds precisely to a switch both of which inputs are the index bits i and j, and whose key bit is bit b. Consequently, the preceding theorem means that one can obtain all the possible configurations of the output wires (ie all the possible permutations) by stacking one after the other of the switches to form the final electronic device. We now present in detail the two devices of the invention. In both cases, they deal with the situation where the number of electric wires concerned is worth a power of two, which makes it possible to define the whole / such that π = 2 '.
Le premier dispositif est un circuit électronique formé d'un assemblage de commutateurs, et qui vérifie la propriété que le nombre de configurations possibles des fils de sortie est précisément égal au nombre de clés qu'il est possible de choisir pour cette permutation à clé. Ce dispositif est donc une permutation à clé, selon la définition donnée plus haut. Ce dispositif est décrit au paragraphe 3.4 de la publication précitée. La description du dispositif Pn peut se faire par récurrence, comme suit. Ce dispositif est construit à partir de deux sous-blocs identiques à un dispositif n/2- Supposons avoir réalisé notre construction d'une permutation à clé μ/<- pour π/2 fils. Alors, nous pouvons utiliser deux fois μx, avec deux clés différentes K\ et K2, pour permuter d'une part les fils numérotés de 0 à π/2 — 1, et d'autre part, les fils numérotés de π/2 à π — 1. Ensuite, nous ajoutons à cette permutation à clé les transpositions qui échangent le fil 0 avec le fil π/2, le fil 1 avec le fil π/2 +- 1, et ainsi de suite, jusqu'à échanger le fil π/2 — 1 avec le fil π. Ces transpositions sont chacunes commandées par un bit de clé, et la réunion de tous ces bits de clé forme une clé K3. Nous avons ainsi construit une permutation à clé O-(KI ,KÎ,K3) Qui permute l'ensemble {0, . . . , π — 1}. On peut prouver que cette construction a la propriété d'engendrer n"72 configurations différentes des fils de sortie, ce qui est précisément égal au nombre de clés différentes qui permettent de commander les commutateurs impliqués dans la construction. La preuve de ce fait se trouve dans la publication citée ci-dessus. L'intérêt de cette construction réside également dans le fait que le nombre de commutateurs impliqués dans la construction est égal à (π log2 )/2, ce qui est très peu, et donc conduit à un circuit de taille petite, avec un temps de traversée très court.The first device is an electronic circuit formed by an assembly of switches, and which verifies the property that the number of possible configurations of the output wires is precisely equal to the number of keys that it is possible to choose for this key permutation. This device is therefore a key permutation, according to the definition given above. This device is described in paragraph 3.4 of the above publication. The description of the device P n can be done by induction, as follows. This device is constructed from two sub-blocks identical to a n / 2 device - Suppose we have carried out our construction of a key permutation μ / <- for π / 2 wires. So, we can use twice μx, with two different keys K \ and K 2 , to swap on the one hand the wires numbered from 0 to π / 2 - 1, and on the other hand, the wires numbered from π / 2 to π - 1. Then, we add to this key permutation the transpositions which exchange wire 0 with wire π / 2, wire 1 with wire π / 2 + - 1, and so on, until exchanging π / 2 - 1 wire with π wire. These transpositions are each controlled by a key bit, and the combination of all these key bits forms a key K 3 . We have thus constructed a key permutation O- (KI , K Î , K3) which permutes the set {0,. . . , π - 1}. It can be proved that this construction has the property of generating n "7 2 different configurations of the output wires, which is precisely equal to the number of different keys which make it possible to control the switches involved in the construction. The proof of this fact is found in the publication cited above. The advantage of this construction also lies in the fact that the number of switches involved in the construction is equal to (π log 2 ) / 2, which is very little, and therefore leads to a small circuit, with a very short crossing time.
Le deuxième dispositif Qn est également un circuit électronique formé d'un assemblage de commutateurs, qui réalise une permutation à clé. Il est construit à partir de deux sous-blocs iden-
tiques à un dispositif Q„/2. Ce deuxième dispositif engendre davantage de configurations des fils de sortie que la première construction, ce qui est souhaitable. Il peut être également décrit par une construction itérative, exposée dans ce qui suit. Une description complète peut être consultée au paragraphe 3.5 de la publication précitée. Essentiellement, la contruction est très similaire à celle exposée précédemment, à la différence que l'on rajoute encore plusieurs permutations après avoir ajouté les transpositions utilisées dans la construction précédante. Supposons avoir construit une permutation à clé μκ de π/2 fils. Nous appliquons les transformations décrites précédemment pour parvenir à une permutation à clé <J{κx ,κ ,Kz)- Ensuite, nous rajoutons π/4 permutations de la façon suivante. Nous notons c = (0, 2, 1, 3) la permutation de {0, 1, 2, 3} qui envoie 0 sur 2, 2 sur 1, 1 sur 3 et 3 sur 0. Nous notons c, les permutations obtenues pour tout i tel que 0 < i < π/4 en effectuant dans c les substitutionsThe second device Q n is also an electronic circuit formed by an assembly of switches, which performs a key permutation. It is constructed from two identical sub-blocks ticks to a device Q „/ 2 . This second device generates more configurations of the output wires than the first construction, which is desirable. It can also be described by an iterative construction, exposed in what follows. A full description can be found in paragraph 3.5 of the above publication. Essentially, the contruction is very similar to that exposed previously, with the difference that we add several permutations again after adding the transpositions used in the previous construction. Suppose we have constructed a key permutation μ κ of π / 2 children. We apply the transformations described above to achieve a key permutation <J ( κ x, κ , Kz) - Then, we add π / 4 permutations as follows. We denote c = (0, 2, 1, 3) the permutation of {0, 1, 2, 3} which sends 0 over 2, 2 over 1, 1 over 3 and 3 over 0. We denote c, the permutations obtained for all i such that 0 <i <π / 4 by making substitutions in c
0 ι- , 1 H- + 1, 2 ι→ n/2 + i, 3 ι→ π/2 X i l .0 ι-, 1 H- + 1, 2 ι → n / 2 + i, 3 ι → π / 2 X i l.
Nus pouvons maintenant compléter notre construction, en composant r(κ κ2,κ3) ave la permutation CQ° o •. • • o cX*Z{ . où les 6, sont des bits de clé supplémentaires, valant 0 ou 1. On obtient donc à nouveau une permutation à clé. On peut prouver que cette construction à la propriété d'engendrer πQn2_/3n, où et β sont des constantes valant = 0, 65 et β = 0, 15. De plus, la clé associée à une longueur de (3/4)π log2 π bits. En particulier, cette construction a la propriété d'engendrer un grand nombre de permutations différentes, parmi toutes les permutations possibles. Selon l'invention, on peut généraliser cette construction, en étendant le dispositif, en utilisant la construction du premier dispositif, et en rajoutant des permutations constituées de cycles de longueur plus grande que deux, par exemple, quatre, mais toute valeur plus grande que deux est possible. Par ailleurs, le dispositif Pn ou Qn, permutant π/2 fils, est équivalent au dispositif Pn ou Qn permutant π fils. Enfin, lesdits commutateurs comprennent chacun deux fils et un bit de clé, et exécutent une permutation de ces deux fils à la condition que le bit de clé vaut 1 et laisse ces fils inchangés si le bit de clé vaut 0.We can now complete our construction, by composing r ( κ κ 2 , κ 3 ) with the permutation C Q ° o • . • • o cX * Z {. where the 6, are additional key bits, worth 0 or 1. We therefore again obtain a key permutation. We can prove that this construction has the property of generating π Qn 2 _ / 3n , where and β are constants worth = 0, 65 and β = 0, 15. In addition, the key associated with a length of (3 / 4) π log 2 π bits. In particular, this construction has the property of generating a large number of different permutations, among all the possible permutations. According to the invention, this construction can be generalized, by extending the device, by using the construction of the first device, and by adding permutations consisting of cycles of length greater than two, for example four, but any value greater than two is possible. Furthermore, the device P n or Q n , permuting π / 2 wires, is equivalent to the device P n or Q n permuting π wires. Finally, said switches each comprise two wires and a key bit, and execute a permutation of these two wires on the condition that the key bit is equal to 1 and leaves these wires unchanged if the key bit is equal to 0.
La présente invention sera plus facile à comprendre à l'aide des figures ci-jointes qui sont : - figure 1 , représentation électronique d'un commutateur avec des portes logiques.
- figure 2, représentation électronique du premier dispositif de l'invention.The present invention will be easier to understand using the attached figures which are: - Figure 1, electronic representation of a switch with logic gates. - Figure 2, electronic representation of the first device of the invention.
- figure 3, représentation électronique du deuxième dispositif de l'invention.- Figure 3, electronic representation of the second device of the invention.
- figure 4, représentation électronique d'un cycle de longueur quatre.- Figure 4, electronic representation of a cycle of length four.
Une réalisation possible de l'invention est maintenant décrite. Nous nous plaçons dans le cas particuler non-restrictif où le nombre de fils est égal à 8 : π = 8. Alors, selon l'invention, nous pouvons fabriquer un permutation à clé qui engendre 212 configurations de fils différentes pour le premier dispositif, et 214 pour le deuxième dispositif. La taille des clés est respectivement de 12 bits, et de 16 bits. Les circuits correspondants sont exposés avec les trois figures suivantes. La première figure, la figure 1, expose une réalisation électronique d'un commutateur, en utilisant des portes logiques « et » et « ou », selon un symbolisme graphique standard. Les entrées sont référencées par Inl, In2, et les sorties par Outl, Out2. K représente le bit de clé déterminant l'état du commutateur. Dans les deux figures suivantes, nous représentons des circuits électroniques réalisés à partir de commutateurs pour chacun 8 fils numérotés de 0 à 7. Par soucis de simplification, nous représentons ces circuits sous la forme de graphes, où les nœuds correspondent à des commutateurs, et où les arêtes correspondent à des fils. Par soucis de simplicité, on ne représente pas les fils qui correspondent aux bits de clé qui déterminent l'état des commutateurs. La figure 2 représente une réalisation du premier dispositif, dans le cas où π = 8. Pour représenter une réalisation électronique du deuxième dispositif, on utilise également des boîtes rectangulaires, pour représenter les cycles de longueur quatre utilisés dans la construction itérative du deuxième dispositif, comme représenté à la figure 4. Là aussi, les fils correspondant à une clé ne sont pas représentés. La figure 3 représente une réalisation du deuxième dispositif, dans le cas où π = 8. La figure 4 représente une réalisation à l'aide de multiplexeurs d'un cycle de longueur 4, commandé par un bit de clé b, recevant en entrée quatre fils notés eo, e , e , e3, et produisant en sortie quatre fils notés so, SI , s2, s .
A possible embodiment of the invention is now described. We place ourselves in the particular non-restrictive case where the number of wires is equal to 8: π = 8. Then, according to the invention, we can manufacture a key permutation which generates 2 12 different configurations of wires for the first device. , and 2 14 for the second device. The size of the keys is 12 bits and 16 bits respectively. The corresponding circuits are exposed with the following three figures. The first figure, Figure 1, shows an electronic embodiment of a switch, using logic gates "and" and "or", according to a standard graphic symbolism. The inputs are referenced by Inl, In2, and the outputs by Outl, Out2. K represents the key bit determining the state of the switch. In the following two figures, we represent electronic circuits made from switches for each 8 wires numbered from 0 to 7. For the sake of simplification, we represent these circuits in the form of graphs, where the nodes correspond to switches, and where the edges correspond to wires. For the sake of simplicity, the wires which correspond to the key bits which determine the state of the switches are not represented. FIG. 2 represents an embodiment of the first device, in the case where π = 8. To represent an electronic embodiment of the second device, rectangular boxes are also used, to represent the cycles of length four used in the iterative construction of the second device, as shown in Figure 4. Again, the son corresponding to a key are not shown. FIG. 3 represents an embodiment of the second device, in the case where π = 8. FIG. 4 represents an embodiment using multiplexers of a cycle of length 4, controlled by a bit of key b, receiving at input four sons denoted eo, e, e, e 3 , and producing as output four sons denoted s o, S I , s 2 , s.