WO2009074727A1 - Method for accessing a sub-word in a binary word, and related device and software - Google Patents

Method for accessing a sub-word in a binary word, and related device and software Download PDF

Info

Publication number
WO2009074727A1
WO2009074727A1 PCT/FR2007/002062 FR2007002062W WO2009074727A1 WO 2009074727 A1 WO2009074727 A1 WO 2009074727A1 FR 2007002062 W FR2007002062 W FR 2007002062W WO 2009074727 A1 WO2009074727 A1 WO 2009074727A1
Authority
WO
WIPO (PCT)
Prior art keywords
mask
word
index
bit
register
Prior art date
Application number
PCT/FR2007/002062
Other languages
French (fr)
Inventor
Matthieu Rivain
Emmanuel Prouff
Original Assignee
Oberthur Technologies
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 filed Critical Oberthur Technologies
Priority to PCT/FR2007/002062 priority Critical patent/WO2009074727A1/en
Publication of WO2009074727A1 publication Critical patent/WO2009074727A1/en

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/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • 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/003Countermeasures against attacks on cryptographic mechanisms for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/04Masking or blinding
    • H04L2209/046Masking or blinding of operations, operands or results of the operations

Definitions

  • the invention relates to a method for accessing a subword in a binary word, as well as an associated device and program.
  • Masking techniques consist in combining the data (that is to say in practice the number) that one wishes to use (in practice, to which one wishes to undergo an operation) with an unpredictable number for an external attacker (in general a random or pseudo-random number); thus, the values involved are different each time even using a constant data input, which makes it impossible for the attacker to deduce the internal data of the method (and in particular the cryptographic keys that it uses) from measurements made of outside.
  • Part of the cryptographic security is obtained through the use of non-linear functions. For example, it is common to model a block ciphe ⁇ by the combination of affine functions and nonlinear functions.The realizations of such nonlinear functions are particularly difficult to protect by masking, because of the non-linear function. linearity with respect to the masking operation.
  • Such boxes-S or "S-Boxes” are made in practice by means of a correspondence table (frequently referred to as table-S or look-up table [LUT] in this same domain) stored in the cryptographic device.
  • a correspondence table frequently referred to as table-S or look-up table [LUT] in this same domain
  • machine words on 8, 16 or 32 bits.
  • a practical embodiment of the S-tables then consists in storing several output values of the table in the same machine word, for example four output values each representing 4 bits can be stored in a machine word. This reduces the number of machine words used for storage of the table-S.
  • the aim will be to provide the same degree of security as the other operations performed in the same environment, for example a protection with one or two degrees of masking to resist the leakage of order 2 detected by current analysis.
  • the input value is usually masked so that the subword word identification bits within the machine word are also masked. There is thus a difficulty in accessing the corresponding subword effectively and safely.
  • the problematic is independent of this environment and can be applied in a general way to access to a subword of a binary word from an index (identification of the sub word inside the word) hidden.
  • the invention provides a method for accessing a subword of index j in a binary word. formed of 2 W subwords from a binary index masked by a corresponding binary mask, comprising i) a step of separating said word into two halves respectively the most significant bits and the least significant bits, ii) a step selecting one of said halves of said word according to the values of the bits of the same index in the masked index and the corresponding mask, respectively.
  • the subword that we want to access is either in the left part (that is to say of high weight), or in the right part (i.e., low-weight) of the binary word.
  • the portion of the masked index is effectively selected. word of interest, without manipulating the index j not masked. It is also noted that the invention is secured in that the index j is not manipulated directly.
  • the invention can also be applied to binary words formed by a number of subwords other than a power of two, in which case said binary word is completed with the aid of subwords (possibly of same length as the subwords when they are of the same size) stuffing so as to form a binary word of 2 W subwords.
  • the indexation of the subwords in the binary word must be adapted accordingly.
  • the separation step i) comprises storing said word in two registers. Registers are thus used which, by their nature, are easier to access than memories.
  • the invention makes it possible to successively isolate the different parts and sub-parts of the initial word to arrive at the desired subword. To do this, it is provided that the method comprises a plurality of iterations of steps i) and ii), and wherein each iteration comprises, after step ii), a step iii) of substituting said binary word by said selected binary half in step ii).
  • the method comprises w iterations for successively all the w bit indexes of said masked index and corresponding mask.
  • dichotomy one accesses the desired subword (of index j) without additional operation. It is then expected to return said substituted binary word, corresponding to the desired subword, at the end of all the iterations.
  • said binary word is masked by a corresponding mask
  • said method comprising j) a step of separating said mask corresponding to the word (U ') into two halves respectively the most significant bits and the least significant bits, jj) at least one step of selecting one of said halves of said mask corresponding to the word as a function of the values of the bits of the same index in respectively the masked index and the corresponding mask, said indexes of the steps ii) and jj) being identical.
  • the binary masks associated with a Boolean addition function have the advantage of constituting a simple involutional masking function, making it possible to recover the input data value when it is masked twice by the same mask.
  • the leakage of information on the masked data may be targeted in conjunction with the leakage of information on the mask to find information on the data in clear.
  • This type of attacks commonly called second-order attacks can be avoided by using a second mask
  • the invention thus applies to any masking order, that is to say whatever the number of random masks applied to the data.
  • the steps j) and jj) are performed at each iteration, and each iteration comprises after step jj), a step jjj) of substituting said mask corresponding to the word (U ') by said half selected at the step not a word).
  • the separation step j) comprises storing said mask corresponding to the word in two registers.
  • said masks are composed of at least two sub-masks.
  • step ii) is also a function of the bits of the same index in respectively the two sub-masks corresponding to the masked index.
  • step jj) is also a function of the bits of the same index in respectively the two sub-masks corresponding to the masked index.
  • steps j) and jj are performed for each of the two sub-masks corresponding to the word.
  • said step of selecting steps ii) and, when it exists, jj) comprises a step of permutation of said two corresponding halves according to said bit of the masked index and a step of permutation of said two halves corresponding to said bit of the mask corresponding to the masked index.
  • said binary word is assigned to two registers in which a first register stores the high-order half of said binary word
  • said registers are conditionally switched to the value of the k-th bit of said masked index
  • This simple realization is based on the use of a pair of registers that are switched.
  • said binary word is masked by a corresponding mask and for each iteration k,
  • said mask corresponding to the word with two registers is assigned where a first register stores the most significant half of said corresponding mask (r u ) to the binary word,
  • said registers are conditionally switched to the value of the k-th bit of said masked index
  • conditional permutation steps implement a function of permutation between the first and second registers, the said permutation function comprising the instructions of copying the second register in a buffer register, to copying said first register into one of two registers according to said condition and copying said buffer register to the other register not verified by the condition.
  • the conditional permutation steps implement a rotation function: Rotate ((R 0 , Ri), l + b 1) where (R 0 , Ri) are the two registers formed in the same double size register, I is the length of the first and second registers and b is a Boolean function of said condition, the Rotate function (R, x) rotating R on x bits to the right or left.
  • the selection step ii) comprises the determination of one of the said halves as a function of the bit of the masked index and its storage in a bit-dependent register of the corresponding mask, the another half being stored in a complementary register.
  • said bit of the corresponding mask is combined with a random bit to determine the storage register of said halves, and a function register of said random bit is returned.
  • said halves are masked during storage in said registers.
  • the selection step jj) may comprise the determination of one of the said halves of the mask corresponding to the word as a function of the bit of the masked index and its storage in a bit-dependent register of the corresponding mask, the other half being stored in a complementary register.
  • steps j) and jj) are performed for said second mask
  • the selection step jj) for the second mask corresponding to the word comprises determining one of said halves of the second mask corresponding to the word according to the bit of the masked index and its storage in a bit-dependent register of said corresponding mask, the other half being stored in a complementary register.
  • said registers are internal registers and therefore better protected, in particular of a secure microcontroller, for example that implementing said method. This limits the transfer of data through a less secure data bus.
  • said masks may be additive masks, for example Boolean masks.
  • Boolean addition can be easily implemented using EXCLUSIVE OR (XOR) functions.
  • the method is for example implemented by a sequence of instructions stored in the electronic entity and executed by a microprocessor of the electronic entity.
  • the electronic entity may be in practice a microcircuit card, particularly suitable for this type of secure operations.
  • the invention also relates to a method for calculating an output data of a conversion table from an input data masked by at least one mask, said conversion table storing a plurality of words each composed of 2 W output data, the method comprises: - determining a word according to a part of said input data, - access to an output data component said determined word, the access being a function of other part of said input data and a mask part corresponding and the access being according to any one of the embodiments mentioned above.
  • the method is, for example, in a method of encryption or decryption of digital data, generally representing a message, but also potentially a cryptographic key, an intermediate data, or only part of such elements.
  • the invention also relates to an electronic device for accessing a subword of index j in a binary word formed of 2 W subwords from a binary index masked by a corresponding binary mask, the device comprising i) means for separating said word in two halves respectively the most significant bits and the least significant bits, ii) means for selecting one of said halves of said word as a function of the values of the bits of the same index in respectively the masked index and the corresponding mask.
  • This device may also include characteristics corresponding to the embodiments envisaged above for the method.
  • the invention finally proposes a computer program product comprising a sequence of instructions able, when executed by a microprocessor, to implement the method mentioned above.
  • FIG. 1 shows schematically the main elements of a possible embodiment for a microcircuit card
  • FIG. 2 represents the general physical appearance of the microcircuit card of FIG. 1
  • FIG. 3 represents, in the form of a logic diagram, the essential steps of an encryption according to the AES algorithm with masking;
  • FIG. 4 represents, in the form of a logic diagram, a first embodiment of the invention implemented in the method of FIG. 3;
  • FIG. 5 represents, in the form of a logic diagram, a second embodiment of the invention implemented in the method of FIG. 3;
  • FIG. 6 represents, in the form of a logic diagram, a third embodiment of the invention implemented in the method of FIG. 3;
  • FIG. 7 illustrates, in the form of a logic diagram, one embodiment of the comparator function used in the various embodiments of FIGS. 4 to 6;
  • FIGS. 8a and 8b illustrate an example of implementation of the S-tables used in the embodiments of FIGS. 4 to 7;
  • FIG. 9 represents, in the form of a logic diagram, a first embodiment for accessing a subword of a binary word, for example stored in the S-table of FIG. 8b;
  • FIG. 10 represents, in the form of a logic diagram, a second embodiment for accessing a subword of a binary word, for example stored in the S-table of FIG. 8b; and
  • FIG. 11 represents, in the form of a logic diagram, a third embodiment for accessing a subword of a binary word, for example stored in the S-table of FIG. 8b.
  • FIGS. 1 to 7 and the embodiments of FIGS. 8 to 11 constitute independent advances that may each be subject to specific protection.
  • An example of an electronic entity is a microcircuit card 10, the main electronic elements of which are represented in FIG. 1 and which comprises a microprocessor 2 connected on the one hand to a Random Access Memory (RAM) 4 and on the other hand to a non-volatile rewritable semiconductor memory 6, for example an erasable and electrically programmable read-only memory (or EEPROM of the English Electrically Erasable Programable Read OnIy Memory).
  • the non-volatile rewritable semiconductor memory 6 could be a flash memory.
  • the memories 4, 6 are connected to the microprocessor 2 by a bus each in Figure 1; alternatively, it could be a common bus.
  • the microcircuit card 10 also comprises an interface 8 for communication with a user terminal made here in the form of contacts, one of which, for example, provides a bidirectional link with the microprocessor 2.
  • the interface 8 thus enables the establishment of bidirectional communication between the microprocessor 2 and the user terminal in which the microcircuit card 10 will be inserted.
  • the microprocessor 2 will implement a method of operation of the microcircuit card 10, according to a set of instructions, stored for example in a read-only memory. (or Read-OnIy Memory ROM) - not shown - or in the rewritable memory 6, which defines a computer program.
  • This method generally includes the exchange of data with the user terminal via the interface 8 and the data processing within the microcircuit card 10, and precisely within the microprocessor 2 with possible use of data stored in the rewritable memory 6 and data temporarily stored in the RAM 4. Examples of methods that implement the invention are given below.
  • FIG. 2 represents the general physical appearance of the microcircuit card 10 made with the general shape of a rectangular parallelepiped of very small thickness.
  • the communication interface 8 provided with the contacts already mentioned appears clearly on the face of the microcircuit card 10 visible in FIG. 2, in the form of a rectangle inscribed in the upper face of the microcircuit card 10.
  • the mask or masks applied to the input data of the non-linear function are not necessarily the X masks or masks applied at the beginning of the algorithm, but are generally deduced easily according to the mechanisms of the algorithm, for example as mentioned in WO 2007/116140 referred to above.
  • FIG. 3 represents the essential steps of the AES encryption method of a word M within the electronic entity.
  • the word M is generally a part of a message to be encrypted having for example a length of 128 bits. Other lengths are naturally conceivable, such as the lengths of 192 bits and 256 bits frequently used.
  • the example described here uses as electronic entity the microcircuit card described above with reference to Figures 1 and 2, but other types of electronic entity can naturally be used, such as for example a personal computer.
  • the electronic entity stores, for example within the non-volatile memory 6, a cryptographic key K from which subkeys Ko,... K n are derived by means of a procedure of key expansion.
  • Obtaining the subkeys K 0 , ... K n can be performed according to known techniques and therefore will not be described in detail here.
  • the encryption process starts at step E100 by receiving, for example through the interface 8 of the microcircuit card, the word (generally a message part) M to be encrypted.
  • a random number X used as a mask of the word M during a step E102.
  • random number is used, it is for example in practice a pseudo-random number determined inside the microprocessor 2.
  • the number X and any data referenced hereinbelow after as random must be a non-predictable number from outside the electronic entity.
  • the masked word MVi obtained in the preceding step is subjected to a r iteration (ROUND) of the steps E110 and E112, in order to obtain a new masked word MV.
  • ROUND r iteration
  • the masking is modified at each iteration, for example by unmasking M'j and re-masking with a new mask Y.
  • this operation can be performed in step E210 mentioned in the aforementioned application WO 2007/116140.
  • step E118 the final transformation is carried out during a step E118, during which we obtain a word IW n from the word M ' n- i previously obtained, and this with use of the subkey K n ( step E118).
  • the result of the final transformation M ' n thus corresponds to the encrypted word obtained by means of the AES algorithm from the initial word M, masked with the previously defined mask X (or the last intermediate mask Y generated if it is desired to modify the masking during iterations).
  • the encrypted word M n can then be sent outside the electronic entity by means of the interface 8 during a step E122 which ends the encryption process by the electronic entity of the word M.
  • the present invention relates more specifically to the use of SBox during the iteration of steps E110 and E112.
  • the transformation M'M -> M'j can be modeled by the composition of three operations: an additive function of the derived key Kj, a nonlinear function and a linear function.
  • Step E110 illustrates the application of the non-linear function by the use of an S-box and described in more detail with reference to the embodiments below.
  • the step E112 then corresponds to the application of the two other functions, an example of which is proposed in the aforementioned application WO 2007/116140 in connection with FIG. 4, in particular sub-block bit shift steps (also known as step Shift Row), multiplication by a matrix (step called Mix Column) and addition of the key Kj (Add Round Key step).
  • the table-S is stored in the nonvolatile memory 6, table also called conversion table (look-up table or LUT).
  • the table receives input data of dimension m and provides output data of dimension n, in particular m can be equal to n.
  • the invention also applies in the case where these two dimensions are different.
  • registers Ro and Ri which use is described below. These registers are in particular binary registers capable of storing digital data output from the S-table (that is to say they have a suitable dimension at least equal to n allowing this storage). In particular, these registers are provided in the microcontroller of the card 10 or even in the microprocessor 2.
  • step E110 A first embodiment of step E110 is shown in FIG. 4.
  • step E200 the masked data MVi and the mask are available.
  • a binary masking variable A is initialized to 0, which serves to define successive iterations of access to the table S.
  • This value A takes values between 0 and 2 m -1 and is therefore the same dimension that M'M and X.
  • step E204 the masking bit variable A of the current iteration, in this case the value 0 for the first iteration, is compared with the input mask X.
  • a Boolean comparison function defined by:
  • This binary value B 1 is stored in the index register cmp calculated previously in step E204.
  • step E208 The value A of a bit unit is incremented in step E208.
  • step E210 the masking value A is compared with 2 m , representing the number of entries of the table S.
  • step E210 In the case of a positive comparison in step E210, all the entries of the table S have been traversed and the process of calculating the SBox is ended by returning (step E212) the value stored in the register R 0 , possibly accompanied by the exit mask Z.
  • step E302 the registers R 0 and R 1 are initialized, besides A to 0, each with the value Z of the output mask. In the presence of several masks, it will be necessary to store the combination of the output masks, for example Zi ⁇ Z 2 .
  • step E304 A and X are compared in a manner similar to step E204 above.
  • step E306 the register R cm p of the output SBox value calculated for the mask A is increased: R cmp ⁇ - R cmp ⁇ S (M 1 M ⁇ A).
  • step E312 the two registers are compared: cmp ⁇ - compare (R 0 , Ri). This step returns 0 if the two registers are equal and 1 if they are different.
  • step E314 the masked output data of the SBox is returned as R o ⁇ (cmp x Ri).
  • the register Ri comprises the value
  • the result E314 is then dependent on all the steps executed, bringing a gain of security.
  • FIG. 6 there is shown another embodiment of the invention based on the assignment (pseudo) random registers and a protection against second-order leaks. It is understood that the assignment of the registers can also be applied to the embodiment corresponding to FIG. 4. In a symmetrical way, the implementation described with reference to Figure 5 can also be achieved by the use of double masking (or more) and the allocation of registers.
  • step E402 a boolean b is generated (pseudo) randomly, which therefore takes either the value 0 or the value 1. This same boolean is used for all the execution of the calculation on the SBox.
  • step E404 the bit masking variable A to 0 is initialized, in a manner similar to that indicated above, which serves to define successive iterations of access to the table S.
  • step E406 the combined value Xi® A of the masks Xi and A is compared with the input mask X 2 .
  • step E408 the table S is used, similarly to step E206 above, to calculate the masked output datum B 'of SBox associated with MV 1 ⁇ A, in particular masked by two output bit masks.
  • Z 1 and Z 2 of dimension n: B ' S (MVi ⁇ A) ⁇ Zi ⁇ Z 2 .
  • This binary value B ' is stored in the cmp index register calculated previously in step E406.
  • step E410 The value A of a bit unit is incremented in step E410.
  • step E412 the masking value A is compared with 2 m , representing the number of entries in the table S.
  • step E412 In the case of a positive comparison in step E412, all the entries of the table S have been traversed and the process of calculating the SBox is ended by returning the value stored in the register R b , possibly accompanied by the masks of Zi and Z 2 output.
  • comparisons involving the masking value A and carried out above can be implemented not a bit-by-bit comparison of the two parameters of the compare functions.
  • FIG. 7 proposes an alternative embodiment of the compare function b , also applicable to the compare function, using a table T of Boolean values of 2 m entries (same input number as the S-table and that the possible values of AT).
  • the comparison function is thus implemented by a simple read access to the table T.
  • step 500 the table T is initialized with the value b (where b is the complement of b) to each of the entries from the boolean generated in step E402: T ⁇ - $; b; b; . b ⁇ .
  • the value of the boolean b is assigned to the input corresponding to the generated index r3: ⁇ [r3] ⁇ - b.
  • step E506 two values ⁇ and ⁇ are compared (step E506) generally corresponding to the masking data (possibly combined with a mask) and to an input mask.
  • the embodiments as described above make it possible to secure the calculation of a masked SBox output from a masked input for the traditionally used masking orders, namely for first-order masking as well. second-order masking.
  • the hardware architecture of the electronic equipment such as the microcircuit
  • the output words are stored so that the word is accessed
  • Another convention which breaks down the word M can also be envisaged, for example selecting the word machine from the central bits of M and selecting the subword from extreme bits of M (for example the two most significant bits and the least significant bit).
  • the machine word Sm ach in e (M H ) can be calculated in a secure manner by applying the algorithms mentioned above in connection with FIGS. 4 to 7 to the most significant parts of M '. and his mask X.
  • the subword that we want to access is either in the left part (that is to say of high weight), or in the right part (that is, low weight) of U.
  • the respective bits of the masked index and its mask i.e. bits contributing to obtain the corresponding bit of the index j not masked
  • Such a swap function b can be implemented by the following steps: tmp ⁇ - Ri Rb ⁇ - Ro R ⁇ ⁇ - tmp
  • Rx Rotate function
  • Ro, Ri Rotate ((R 0 , Ri), l + bl)
  • I is the length of the registers.
  • step E600 a counter k is initialized to 0.
  • step E602 the two registers R 0 and R 1 , U H (10100111) and U L (01101101) are assigned.
  • step E608 the value of U is replaced by the contents of the register
  • the swap operation as envisaged above when used conditionally, gives a high degree of security when it comes to identifying (for example, selection or isolation) one of two.
  • identifying for example, selection or isolation
  • j 1 indexation of j 1 (and its masks) not from left to right but from right to left, it is necessary to proceed to an additional swap within each of iterations k.
  • the embodiment described above can be extended to the masked data U 1 by means of a random mask r u .
  • steps E602 ', E604', E606 1 and E608 'applied to the mask r u similar to those of the corresponding number E602, E604, E606 and E608, are carried out just after step E608.
  • This embodiment differs from that of FIG. 9 in substance by the application of the swap function three times as a function of corresponding bits in the index j 'and in each of the two masks ⁇ 1 and ⁇ -2 (it can be seen that so that the invention can be extended without difficulty to higher masking orders by performing a number of permutations equal to 1 + number of masks of j) and by the determination of the subwords in the word U 1 and in each of the masks r u 1 and r u 2 of U. For a homogeneity of safety, it is advisable to choose the same degree of masking of the index j and the binary word
  • Steps E700 to E704 do not differ from steps E600 to E604.
  • Step E710 is the same as Step E608 above.
  • step E712 k is incremented to form w iterations (comparison at step E714).
  • step E800 an iteration value k is initialized to 0.
  • the steps E802 to E820 illustrate an embodiment of the Select function.
  • step E802 two random masks of length / 0A7 £ F2 w - 1 - k n are generated.
  • step E804 a random boolean b is generated.
  • a masked bit is calculated from the boolean b and the index bits k (starting from the most significant bit to the least significant bit as iterations occur) in respectively the two masks of the index j ': b' ⁇ - (r j 1 [wk] ⁇ b) ⁇ r j 2 [wk]
  • a b ⁇ B b ⁇ C b H j [wk] (U). Due to the independence of these values from those of x ⁇ and ⁇ 2, independence is obtained with respect to the index j, and thus increased security.
  • step E820 substitute (A b , B b , C b ) for the preceding values (U ', r u 1, r u 2). Then, k is incremented at step E822.
  • step E824 Compare k and w to determine if the iterations are terminated in step E824 (similar to steps E612 and E714 above, with return to step E802 for a new iteration).
  • the values j '[k], rj [k], ⁇ 1 [k] and ⁇ 2 [k] play symmetrical roles so that it is possible to envisage to invert their positions in these mechanisms, for example the value b 'at the step E806 can use j' instead of the mask ⁇ 1 and the functions H of the steps E808 and E814 are then indexed by the mask ⁇ 1.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to a method and an associated system for accessing a sub-word having an index j in a binary word (U, U') including 2w sub-words (U(O),..., U(2w-1)), from a binary index (j') masked by a corresponding binary mask (rj), wherein the method comprises: i) the step of splitting said word (U, U') into two halves (Ho(U), H1(U), UH, UL), respectively, of the most significant bits and of the less significant bits; ii) the step of selecting one of said halves of said word (U, U') based on the values of bits having the same index in, respectively, the masked index (j') and the corresponding mask (rj, rj1, rj2).

Description

PROCEDE D'ACCES A UN SOUS-MOT DANS UN MOT BINAIRE- DISPOSITIF ET PROGRAMME ASSOCIES METHOD FOR ACCESSING A SUBWORD IN A BINARY WORD- APPARATUS AND PROGRAM THEREOF
L'invention concerne un procédé d'accès à un sous-mot dans un mot binaire, ainsi qu'un dispositif et un programme associés.The invention relates to a method for accessing a subword in a binary word, as well as an associated device and program.
A titre illustratif, dans des procédés de traitement cryptographique, on a fréquemment recours au masquage des données afin de lutter contre les attaques, par exemple du type analyse de courant (notamment les attaques de type DPA ainsi dénommées d'après l'anglais "Differential Power Analysis") ou du type analyse de rayonnement électromagnétique.By way of illustration, in cryptographic processing methods, data masking is frequently used in order to fight against attacks, for example of the current analysis type (in particular the DPA type attacks thus named after the English "Differential Power Analysis ") or electromagnetic radiation analysis type.
Les techniques de masquage consistent à combiner la donnée (c'est-à-dire en pratique le nombre) que l'on souhaite utiliser (en pratique, auquel on souhaite faire subir une opération) avec un nombre imprévisible pour un attaquant extérieur (en général un nombre aléatoire ou pseudo-aléatoire) ; ainsi, les valeurs impliquées sont chaque fois différentes même en utilisant une donnée constante en entrée, ce qui rend impossible pour l'attaquant de déduire les données internes du procédé (et notamment les clés cryptographiques qu'il utilise) à partir de mesures faites de l'extérieur. Une part de la sécurité cryptographique est obtenue par l'utilisation de fonctions non-linéaires. Par exemple, il est courant de modéliser un chiffrement par bloc (block cipheή par la combinaison de fonctions affines et de fonctions non-linéaires. Les réalisations de telles fonctions non-linéaires sont particulièrement difficiles à protéger par masquage, du fait de la non-linéarité par rapport à l'opération de masquage.Masking techniques consist in combining the data (that is to say in practice the number) that one wishes to use (in practice, to which one wishes to undergo an operation) with an unpredictable number for an external attacker (in general a random or pseudo-random number); thus, the values involved are different each time even using a constant data input, which makes it impossible for the attacker to deduce the internal data of the method (and in particular the cryptographic keys that it uses) from measurements made of outside. Part of the cryptographic security is obtained through the use of non-linear functions. For example, it is common to model a block cipheή by the combination of affine functions and nonlinear functions.The realizations of such nonlinear functions are particularly difficult to protect by masking, because of the non-linear function. linearity with respect to the masking operation.
Un exemple de procédé de traitement cryptographique est décrit par la demande de brevet internationale WO 2007/116140 qui met en œuvre une fonction non-linéaire de type boîte-S (S-Box selon la terminologie anglo- saxonne spécialisée du domaine considéré) appliquée à ces données masquées.An example of a cryptographic processing method is described by the international patent application WO 2007/116140 which implements a non-linear function of the S-box type (S-Box according to the Anglo-Saxon specialized terminology of the domain considered) applied to these hidden data.
De telles boïtes-S ou "S-Boxes" sont réalisées en pratique au moyen d'une table de correspondance (fréquemment dénommée table-S ou look-up table [LUT] dans ce même domaine) mémorisée dans le dispositif cryptographique.Such boxes-S or "S-Boxes" are made in practice by means of a correspondence table (frequently referred to as table-S or look-up table [LUT] in this same domain) stored in the cryptographic device.
En pratique, on cherche à optimiser le stockage de cette table malgré des spécificités techniques des dispositifs électroniques mettant en œuvre ces procédés cryptographiques. On distingue notamment des contraintes d'architecture matérielle qui impose l'utilisation de mots de donnéesIn practice, we seek to optimize the storage of this table despite the technical specificities of electronic devices implementing these cryptographic methods. One distinguishes particular constraints of material architecture which imposes the use of words of data
(dits mots machine) sur 8, 16 ou 32 bits.(called machine words) on 8, 16 or 32 bits.
Une réalisation pratique des tables-S consiste alors à stocker plusieurs valeurs de sortie de la table dans un même mot machine, par exemple quatre valeurs de sorties représentant chacune 4 bits peuvent être mémorisées dans un mot machine. On diminue ainsi le nombre de mots machine utilisés pour le stockage de la table-S.A practical embodiment of the S-tables then consists in storing several output values of the table in the same machine word, for example four output values each representing 4 bits can be stored in a machine word. This reduces the number of machine words used for storage of the table-S.
Différentes conventions peuvent être utilisées pour faire correspondre les différents bits d'un paramètre d'entrée de la table-S à l'identification du mot machine correspondant et à l'identification de la valeur de sortie à l'intérieur dudit mot machine (dite également sous-mot du mot machine).Different conventions can be used to match the different bits of an input parameter of the S-table to the identification of the corresponding machine word and to the identification of the output value within said machine word (so-called also subword of the word machine).
L'accès au mot machine est réalisé avec des mécanismes sécurisés de façon classique, ou avec ceux décrits dans la suite de la demande en référence aux figures 4 à 7.The access to the word machine is realized with mechanisms secured in a conventional manner, or with those described in the rest of the application with reference to FIGS. 4 to 7.
Dans un environnement sécurisé, il convient néanmoins de fournir un accès sécurisé à un sous-mot d'un mot machine. On cherchera notamment à fournir un même degré de sécurité que les autres opérations réalisées dans le même environnement, par exemple une protection par un ou deux degrés de masquage pour résister aux fuites d'ordre 2 détectées par analyse de courant.In a secure environment, however, it is necessary to provide secure access to a subword of a word machine. In particular, the aim will be to provide the same degree of security as the other operations performed in the same environment, for example a protection with one or two degrees of masking to resist the leakage of order 2 detected by current analysis.
En particulier, dans le cas des tables-S, la valeur d'entrée est généralement masquée de telle sorte que les bits d'identification du sous-mot à l'intérieur du mot machine sont également masqués. Il existe ainsi une difficulté à accéder de façon efficace et sûre au sous-mot correspondant. Bien que la présentation ci-dessus s'inscrive dans un environnement cryptographique, il apparaît clairement que la problématique qui se pose est indépendante de cet environnement et peut s'appliquer de façon générale à l'accès à un sous-mot d'un mot binaire à partir d'un indice (d'identification du sous-mot à l'intérieur du mot) masqué.In particular, in the case of S-tables, the input value is usually masked so that the subword word identification bits within the machine word are also masked. There is thus a difficulty in accessing the corresponding subword effectively and safely. Although the above presentation fits in a cryptographic environment, it is clear that the problematic is independent of this environment and can be applied in a general way to access to a subword of a binary word from an index (identification of the sub word inside the word) hidden.
Afin de répondre à ces difficultés, et notamment d'effectuer un accès à un sous-mot d'un mot binaire en toute sécurité, l'invention prévoit un procédé d'accès à un sous-mot d'indice j dans un mot binaire formé de 2W sous-mots à partir d'un indice binaire masqué par un masque binaire correspondant, comprenant i) une étape de séparation dudit mot en deux moitiés respectivement des bits les plus significatifs et des bits les moins significatifs, ii) une étape de sélection d'une desdites moitiés dudit mot en fonction des valeurs des bits d'un même index dans respectivement l'indice masqué et le masque correspondant.In order to respond to these difficulties, and in particular to provide access to a sub-word of a binary word in complete safety, the invention provides a method for accessing a subword of index j in a binary word. formed of 2 W subwords from a binary index masked by a corresponding binary mask, comprising i) a step of separating said word into two halves respectively the most significant bits and the least significant bits, ii) a step selecting one of said halves of said word according to the values of the bits of the same index in the masked index and the corresponding mask, respectively.
En effet, on remarque que selon la valeur du bit de poids fort de j, le sous-mot auquel on veut accéder est soit dans la partie gauche (c'est-à-dire de poids fort), soit dans la partie droite (c'est-à-dire de poids faible) du mot binaire.Indeed, we notice that according to the value of the most significant bit of j, the subword that we want to access is either in the left part (that is to say of high weight), or in the right part ( i.e., low-weight) of the binary word.
Ainsi, en combinant l'utilisation des bits respectifs de l'indice masqué et de son masque (c'est-à-dire des bits contribuant à obtenir le bit correspondant de l'indice j non masqué), on sélectionne efficacement la partie du mot d'intérêt, sans manipuler l'indice j non masqué. On remarque également que l'invention est sécurisée en ce que l'on ne manipule pas directement l'indice j.Thus, by combining the use of the respective bits of the masked index and its mask (i.e., bits contributing to obtain the corresponding bit of the unmasked index j), the portion of the masked index is effectively selected. word of interest, without manipulating the index j not masked. It is also noted that the invention is secured in that the index j is not manipulated directly.
On note que l'invention peut également s'appliquer à des mots binaires formés d'un nombre de sous-mots différent d'une puissance de deux, auquel cas on complète ledit mot binaire à l'aide de sous-mots (éventuellement de même longueur que les sous-mots lorsque ces derniers sont de même dimension) de bourrage de sorte à former un mot binaire de 2W sous-mots. Il convient d'adapter en conséquence l'indexation des sous-mots dans le mot binaire.Note that the invention can also be applied to binary words formed by a number of subwords other than a power of two, in which case said binary word is completed with the aid of subwords (possibly of same length as the subwords when they are of the same size) stuffing so as to form a binary word of 2 W subwords. The indexation of the subwords in the binary word must be adapted accordingly.
Dans un mode pratique de réalisation, l'étape de séparation i) comprend le stockage dudit mot dans deux registres. On utilise ainsi des registres qui sont, par nature, d'accès plus simple que les mémoires. L'invention permet d'isoler successivement les différentes parties et sous-parties du mot initial pour aboutir au sous-mot souhaité. Pour ce faire, on prévoit que le procédé comprend une pluralité d'itérations des étapes i) et ii), et dans lequel chaque itération comprend après l'étape ii), une étape iii) de substitution dudit mot binaire par ladite moitié binaire sélectionnée à l'étape ii).In a practical embodiment, the separation step i) comprises storing said word in two registers. Registers are thus used which, by their nature, are easier to access than memories. The invention makes it possible to successively isolate the different parts and sub-parts of the initial word to arrive at the desired subword. To do this, it is provided that the method comprises a plurality of iterations of steps i) and ii), and wherein each iteration comprises, after step ii), a step iii) of substituting said binary word by said selected binary half in step ii).
En particulier, le procédé comprend w itérations pour successivement l'ensemble des w index de bits desdits indice masqué et masque correspondant. Ainsi, par dichotomie, on accède au sous-mot souhaité (d'indice j) sans opération supplémentaire. On prévoit alors de retourner ledit mot binaire substitué, correspondant au sous-mot souhaité, à la fin de l'ensemble des itérations.In particular, the method comprises w iterations for successively all the w bit indexes of said masked index and corresponding mask. Thus, by dichotomy, one accesses the desired subword (of index j) without additional operation. It is then expected to return said substituted binary word, corresponding to the desired subword, at the end of all the iterations.
Dans un mode de réalisation, ledit mot binaire est masqué par un masque correspondant, ledit procédé comprenant j) une étape de séparation dudit masque correspondant au mot (U') en deux moitiés respectivement des bits les plus significatifs et des bits les moins significatifs, jj) au moins une étape de sélection d'une desdites moitiés dudit masque correspondant au mot en fonction des valeurs des bits d'un même index dans respectivement l'indice masqué et le masque correspondant, lesdits index des étapes ii) et jj) étant identiques.In one embodiment, said binary word is masked by a corresponding mask, said method comprising j) a step of separating said mask corresponding to the word (U ') into two halves respectively the most significant bits and the least significant bits, jj) at least one step of selecting one of said halves of said mask corresponding to the word as a function of the values of the bits of the same index in respectively the masked index and the corresponding mask, said indexes of the steps ii) and jj) being identical.
On s'assure ainsi de conserver à tout instant la moitié souhaitée du mot binaire masqué et la moitié correspondante du masque qui en permettra le démasquage efficace pour retrouver le sous-mot non masqué.This ensures that the desired half of the masked binary word and the corresponding half of the mask are kept at all times, which will allow effective unmasking to find the unmasked subword.
Les masques binaires associés à une fonction d'addition booléenne ont l'avantage de constituer une fonction de masquage involutive simple, permettant de retrouver la valeur de donnée d'entrée lorsque celle-ci est masquée deux fois par le même masque.The binary masks associated with a Boolean addition function have the advantage of constituting a simple involutional masking function, making it possible to recover the input data value when it is masked twice by the same mask.
Lorsqu'un simple masque est utilisé pour masquer une donnéeWhen a simple mask is used to hide a data
(masquage d'ordre 1), la fuite d'information sur la donnée masquée peut-être ciblée conjointement avec la fuite d'information sur le masque afin de retrouver de l'information sur la donnée en claire. Ce type d'attaques couramment appelées attaques d'ordre 2 peut être évité par l'utilisation d'un second masque(masking order 1), the leakage of information on the masked data may be targeted in conjunction with the leakage of information on the mask to find information on the data in clear. This type of attacks commonly called second-order attacks can be avoided by using a second mask
(masquage d'ordre 2).(masking order 2).
L'invention s'applique ainsi à tout ordre de masquage, c'est-à-dire quelque soit Ie nombre de masques aléatoires appliquée à la donnée. En particulier, les étapes j) et jj) sont effectuées à chaque itération, et chaque itération comprend après l'étape jj), une étape jjj) de substitution dudit masque correspondant au mot (U') par ladite moitié sélectionnée à l'étape jj).The invention thus applies to any masking order, that is to say whatever the number of random masks applied to the data. In particular, the steps j) and jj) are performed at each iteration, and each iteration comprises after step jj), a step jjj) of substituting said mask corresponding to the word (U ') by said half selected at the step not a word).
On parallélise ainsi la dichotomie sur le mot binaire masqué et sur le ou les masques correspondants. On retourne alors le masque substitué correspondant au mot à la fin de l'ensemble des itérations. On dispose ainsi de tous les éléments pour déterminer le sous-mot non masqué.We thus parallelize the dichotomy on the masked binary word and on the corresponding mask or masks. We then return the substituted mask corresponding to the word at the end of all the iterations. This provides all the elements to determine the unmasked subword.
Selon une caractéristique particulière, l'étape de séparation j) comprend le stockage dudit masque correspondant au mot dans deux registres. Selon une autre caractéristique autorisant différents degrés de masquage, lesdits masques sont composés d'au moins deux sous-masques.According to a particular characteristic, the separation step j) comprises storing said mask corresponding to the word in two registers. According to another characteristic allowing different degrees of masking, said masks are composed of at least two sub-masks.
Dans ce dessein, on prévoit que ladite sélection de l'étape ii) est également fonction des bits d'un même index dans respectivement les deux sous-masques correspondant à l'indice masqué. On tient ainsi compte de l'influence de tous les masques masquant l'indice j. On aboutit par conséquent sans erreur à identifier le sous-mot d'indice j à partir de l'indice masqué j'.For this purpose, it is expected that said selection of step ii) is also a function of the bits of the same index in respectively the two sub-masks corresponding to the masked index. We take into account the influence of all the masks masking the index j. It is consequently without error to identify the subword of index j from the masked index j '.
De façon symétrique sur la détermination des sous-mots associés aux masques, ladite sélection de l'étape jj) est également fonction des bits d'un même index dans respectivement les deux sous-masques correspondant à l'indice masqué. Notamment, on réalise les étapes j) et jj) pour chacun des deux sous-masques correspondant au mot.Symmetrically on the determination of the subwords associated with the masks, said selection of the step jj) is also a function of the bits of the same index in respectively the two sub-masks corresponding to the masked index. In particular, steps j) and jj are performed for each of the two sub-masks corresponding to the word.
Dans un autre mode de réalisation, ladite étape de sélection des étapes ii) et, lorsqu'elle existe, jj) comprend une étape de permutation desdites deux moitiés correspondantes en fonction dudit bit de l'indice masqué et une étape de permutation desdites deux moitiés correspondantes en fonction dudit bit du masque correspondant à l'indice masqué. Comme on le verra par la suite, cette combinaison "permutation" et "bit des indices et masques" permet de mettre en œuvre des réalisations simples et efficaces d'isolation des sous-mots.In another embodiment, said step of selecting steps ii) and, when it exists, jj) comprises a step of permutation of said two corresponding halves according to said bit of the masked index and a step of permutation of said two halves corresponding to said bit of the mask corresponding to the masked index. As we will see later, this combination "permutation" and "bit indices and masks" makes it possible to implement simple and effective embodiments of subword isolation.
En particulier, pour k itérations allant de 0 à w-1 , successivement: -on affecte ledit mot binaire à deux registres où un premier registre stocke la moitié de poids fort dudit mot binaire,In particular, for k iterations ranging from 0 to w-1, successively: said binary word is assigned to two registers in which a first register stores the high-order half of said binary word,
-on permute lesdits registres conditionnellement à la valeur du k-ième bit dudit indice masqué,said registers are conditionally switched to the value of the k-th bit of said masked index,
-on permute de nouveau lesdits registres conditionnellement à la valeur du k-ième bit dudit masque correspondant à l'indice masqué, -on substitue ledit mot binaire par ledit premier registre, et à la fin des itérations, on retourne ledit mot binaire substitué.-reverting said registers conditionally to the value of the k-th bit of said mask corresponding to the masked index, -on substitutes said binary word by said first register, and at the end of the iterations, returning said substituted binary word.
Cette réalisation simple s'appuie sur l'utilisation d'une paire de registres que l'on permute.This simple realization is based on the use of a pair of registers that are switched.
Selon une caractéristique particulière, ledit mot binaire est masqué par un masque correspondant et pour chaque itération k,According to a particular characteristic, said binary word is masked by a corresponding mask and for each iteration k,
-on affecte ledit masque correspondant au mot à deux registres où un premier registre stocke la moitié de poids fort dudit masque correspondant (ru) au mot binaire,said mask corresponding to the word with two registers is assigned where a first register stores the most significant half of said corresponding mask (r u ) to the binary word,
-on permute lesdits registres conditionnellement à la valeur du k-ième bit dudit indice masqué,said registers are conditionally switched to the value of the k-th bit of said masked index,
-on permute de nouveau lesdits registres conditionnellement à la valeur du k-ième bit dudit masque correspondant à l'indice masqué,-reverting said registers conditionally to the value of the k-th bit of said mask corresponding to the masked index,
- on substitue ledit masque correspondant au mot par ledit premier registre et à la fin des itérations, on retourne ledit masque correspondant substitué.substituting said mask corresponding to the word by said first register and at the end of the iterations, returning said corresponding substituted mask.
Du fait du masquage du mot binaire initial, il est nécessaire de mener en parallèle l'isolation du sous-mot du masque correspondant.Due to the masking of the initial binary word, it is necessary to carry out in parallel the isolation of the subword of the corresponding mask.
Egalement, en cas de masquage double de l'indice j', on prévoit que les permutations conditionnellement à la valeur du k-ième bit dudit masque correspondant à l'indice masqué comprennent:Also, in the case of double masking of the index j ', it is expected that the permutations conditionally at the value of the k-th bit of said mask corresponding to the masked index comprise:
- une permutation des registres conditionnellement à la valeur du k-ième bit d'un premier sous-masque correspondant à l'indice masqué - une permutation des registres conditionnellement à la valeur du k-ième bit du deuxième sous-masque correspondant à l'indice masqué.a permutation of the registers conditionally to the value of the k-th bit of a first sub-mask corresponding to the masked index a permutation of the registers conditionally to the value of the k-th bit of the second sub-mask corresponding to the masked index.
Ainsi, on tient compte de tous les bits liant l'indice masqué dont on dispose et l'indice non masqué que l'on ne souhaite pas manipuler pour des raisons de sécurité.Thus, we take into account all the bits linking the masked index available and the unmasked index that we do not want to manipulate for security reasons.
Selon une réalisation des permutations simple à mettre en oeuvre, les étapes de permutation conditionnelles mettent en œuvre une fonction de permutation entre le premier et un deuxième registres, ladite fonction de permutation comprenant les instructions consistant à copier le deuxième registre dans un registre tampon, à copier ledit premier registre dans l'un des deux registres fonction de ladite condition et à copier ledit registre tampon dans l'autre registre non vérifié par la condition.According to a realization of the permutations that are simple to implement, the conditional permutation steps implement a function of permutation between the first and second registers, the said permutation function comprising the instructions of copying the second register in a buffer register, to copying said first register into one of two registers according to said condition and copying said buffer register to the other register not verified by the condition.
Selon une variante, les étapes de permutation conditionnelles mettent en œuvre une fonction de rotation: Rotate((R0, Ri), l+b.l) où (R0, Ri) sont les deux registres formés dans un même registre de taille double, I est la longueur des premier et deuxième registres et b est un booléen fonction de ladite condition, la fonction Rotate(R, x) effectuant une rotation de R sur x bits à droite ou à gauche. Dans un mode de réalisation particulier de l'invention, l'étape de sélection ii) comprend la détermination d'une desdites moitiés en fonction du bit de l'indice masqué et son stockage dans un registre dépendant du bit dudit masque correspondant, l'autre moitié étant stockée dans un registre complémentaire. Par cette réalisation et comme illustré plus loin, aucune donnée intermédiaire manipulée n'est directement reliée à l'indice j. On assure ainsi une grande protection du procédé à d'éventuelles attaques extérieures.According to one variant, the conditional permutation steps implement a rotation function: Rotate ((R 0 , Ri), l + b 1) where (R 0 , Ri) are the two registers formed in the same double size register, I is the length of the first and second registers and b is a Boolean function of said condition, the Rotate function (R, x) rotating R on x bits to the right or left. In a particular embodiment of the invention, the selection step ii) comprises the determination of one of the said halves as a function of the bit of the masked index and its storage in a bit-dependent register of the corresponding mask, the another half being stored in a complementary register. By this embodiment and as illustrated below, no manipulated intermediate data is directly related to the index j. This ensures a great protection of the process to possible external attacks.
En particulier, on combine ledit bit du masque correspondant avec un bit aléatoire pour déterminer le registre de stockage desdites moitiés, et on retourne un registre fonction dudit bit aléatoire. Egalement, on peut prévoir que lesdites moitiés sont masquées lors de leur stockage dans lesdits registres. Eventuellement, l'étape de sélection jj) peut comprendre la détermination d'une desdites moitiés du masque correspondant au mot en fonction du bit de l'indice masqué et son stockage dans un registre dépendant du bit dudit masque correspondant, l'autre moitié étant stockée dans un registre complémentaire.In particular, said bit of the corresponding mask is combined with a random bit to determine the storage register of said halves, and a function register of said random bit is returned. Also, it can be provided that said halves are masked during storage in said registers. Optionally, the selection step jj) may comprise the determination of one of the said halves of the mask corresponding to the word as a function of the bit of the masked index and its storage in a bit-dependent register of the corresponding mask, the other half being stored in a complementary register.
En particulier, lorsque ledit mot binaire est masqué par un second masque, on réalise les étapes j) et jj) pour ledit second masque, et l'étape de sélection jj) pour le second masque correspondant au mot comprend la détermination d'une desdites moitiés du second masque correspondant au mot en fonction du bit de l'indice masqué et son stockage dans un registre dépendant du bit dudit masque correspondant, l'autre moitié étant stockée dans un registre complémentaire.In particular, when said binary word is masked by a second mask, steps j) and jj) are performed for said second mask, and the selection step jj) for the second mask corresponding to the word comprises determining one of said halves of the second mask corresponding to the word according to the bit of the masked index and its storage in a bit-dependent register of said corresponding mask, the other half being stored in a complementary register.
Selon une caractéristique pratique, lesdits registres sont des registres internes et donc mieux protégés, notamment d'un microcontrôleur sécurisé, par exemple celui mettant en œuvre ledit procédé. On limite ainsi le transfert de données au travers d'un bus de données moins sécurisé.According to a practical characteristic, said registers are internal registers and therefore better protected, in particular of a secure microcontroller, for example that implementing said method. This limits the transfer of data through a less secure data bus.
Selon un mode de réalisation particulièrement intéressant, lesdits masques peuvent être des masques additifs, par exemple des masques booléens. Ainsi, on peut mettre en œuvre aisément l'addition booléenne à l'aide de fonctions OU EXCLUSIF (XOR).According to a particularly advantageous embodiment, said masks may be additive masks, for example Boolean masks. Thus, Boolean addition can be easily implemented using EXCLUSIVE OR (XOR) functions.
Le procédé est par exemple mis en œuvre par une séquence d'instructions mémorisées dans l'entité électronique et exécutées par un microprocesseur de l'entité électronique.The method is for example implemented by a sequence of instructions stored in the electronic entity and executed by a microprocessor of the electronic entity.
L'entité électronique peut être en pratique une carte à microcircuit, particulièrement adaptée à ce type d'opérations sécurisées.The electronic entity may be in practice a microcircuit card, particularly suitable for this type of secure operations.
L'invention concerne également un procédé de calcul d'une donnée de sortie d'une table de conversion à partir d'une donnée d'entrée masquée par au moins un masque, ladite table de conversion stockant une pluralité de mots composés chacun de 2W données de sortie, le procédé comprend: - la détermination d'un mot en fonction d'une partie de ladite donnée d'entrée, - l'accès à une donnée de sortie composant ledit mot déterminé, l'accès étant fonction de l'autre partie de ladite donnée d'entrée et d'une partie de masque correspondant et l'accès étant selon l'un quelconque des modes de réalisation évoqués précédemment.The invention also relates to a method for calculating an output data of a conversion table from an input data masked by at least one mask, said conversion table storing a plurality of words each composed of 2 W output data, the method comprises: - determining a word according to a part of said input data, - access to an output data component said determined word, the access being a function of other part of said input data and a mask part corresponding and the access being according to any one of the embodiments mentioned above.
Le procédé s'inscrit, par exemple, dans un procédé de chiffrage ou de déchiffrage de données numériques, représentant en général un message, mais également potentiellement une clé cryptographique, une donnée intermédiaire, ou une partie seulement de tels éléments.The method is, for example, in a method of encryption or decryption of digital data, generally representing a message, but also potentially a cryptographic key, an intermediate data, or only part of such elements.
L'invention a également trait à un dispositif électronique d'accès à un sous-mot d'indice j dans un mot binaire formé de 2W sous-mots à partir d'un indice binaire masqué par un masque binaire correspondant, le dispositif comprenant: i) des moyens de séparation dudit mot en deux moitiés respectivement des bits les plus significatifs et des bits les moins significatifs, ii) des moyens de sélection d'une desdites moitiés dudit mot en fonction des valeurs des bits d'un même index dans respectivement l'indice masqué et le masque correspondant.The invention also relates to an electronic device for accessing a subword of index j in a binary word formed of 2 W subwords from a binary index masked by a corresponding binary mask, the device comprising i) means for separating said word in two halves respectively the most significant bits and the least significant bits, ii) means for selecting one of said halves of said word as a function of the values of the bits of the same index in respectively the masked index and the corresponding mask.
Ce dispositif peut également inclure des caractéristiques correspondant aux modes de réalisation envisagés ci-dessus pour le procédé.This device may also include characteristics corresponding to the embodiments envisaged above for the method.
L'invention propose enfin un produit programme d'ordinateur comprenant une suite d'instructions aptes, lorsqu'elles sont exécutées par un microprocesseur, à mettre en œuvre le procédé évoqué ci-dessus.The invention finally proposes a computer program product comprising a sequence of instructions able, when executed by a microprocessor, to implement the method mentioned above.
Les avantages, buts et caractéristiques particulières du procédé de calcul, de ce dispositif électronique et de ce produit programme d'ordinateur étant similaires à ceux du procédé objet de la présente invention, telle que succinctement exposée ci-dessus, ils ne sont pas rappelés ici. D'autres avantages, buts et caractéristiques particulières de la présente invention ressortiront de la description qui va suivre, faite, dans un but explicatif et nullement limitatif en regard des dessins annexés, dans lesquels :Since the advantages, aims and special features of the calculation method, of this electronic device and of this computer program product are similar to those of the method that is the subject of the present invention, as briefly described above, they are not repeated here. . Other advantages, aims and particular features of the present invention will emerge from the description which follows, made for an explanatory and non-limiting purpose with reference to the accompanying drawings, in which:
- 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, les étapes essentielles d'un chiffrement selon l'algorithme AES avec masquage ;- Figure 1 shows schematically the main elements of a possible embodiment for a microcircuit card; FIG. 2 represents the general physical appearance of the microcircuit card of FIG. 1; FIG. 3 represents, in the form of a logic diagram, the essential steps of an encryption according to the AES algorithm with masking;
- la figure 4 représente, sous forme de logigramme, un premier mode de réalisation de l'invention mis en œuvre dans le procédé de la figure 3; - la figure 5 représente, sous forme de logigramme, un deuxième mode de réalisation de l'invention mis en œuvre dans le procédé de la figure 3;FIG. 4 represents, in the form of a logic diagram, a first embodiment of the invention implemented in the method of FIG. 3; FIG. 5 represents, in the form of a logic diagram, a second embodiment of the invention implemented in the method of FIG. 3;
- la figure 6 représente, sous forme de logigramme, un troisième mode de réalisation de l'invention mis en œuvre dans le procédé de la figure 3;FIG. 6 represents, in the form of a logic diagram, a third embodiment of the invention implemented in the method of FIG. 3;
- la figure 7 illustre, sous forme de logigramme, un mode de réalisation de la fonction compare utilisée dans les différents modes de réalisation des figures 4 à 6;FIG. 7 illustrates, in the form of a logic diagram, one embodiment of the comparator function used in the various embodiments of FIGS. 4 to 6;
- les figures 8a et 8b illustrent un exemple de mise en œuvre des tables-S utilisées dans les modes de réalisations des figures 4 à 7;FIGS. 8a and 8b illustrate an example of implementation of the S-tables used in the embodiments of FIGS. 4 to 7;
- la figure 9 représente, sous forme de logigramme, un premier mode de réalisation pour l'accès à un sous-mot d'un mot binaire, par exemple stocké dans la table-S de la figure 8b;FIG. 9 represents, in the form of a logic diagram, a first embodiment for accessing a subword of a binary word, for example stored in the S-table of FIG. 8b;
- la figure 10 représente, sous forme de logigramme, un deuxième mode de réalisation pour l'accès à un sous-mot d'un mot binaire, par exemple stocké dans la table-S de la figure 8b; et - la figure 11 représente, sous forme de logigramme, un troisième mode de réalisation pour l'accès à un sous-mot d'un mot binaire, par exemple stocké dans la table-S de la figure 8b.FIG. 10 represents, in the form of a logic diagram, a second embodiment for accessing a subword of a binary word, for example stored in the S-table of FIG. 8b; and FIG. 11 represents, in the form of a logic diagram, a third embodiment for accessing a subword of a binary word, for example stored in the S-table of FIG. 8b.
On notera que les modes de réalisation relatifs aux figures 1 à 7 et les réalisations des figures 8 à 11 constituent des avancées indépendantes qui peuvent faire l'objet, chacune, d'une protection spécifique.It will be noted that the embodiments relating to FIGS. 1 to 7 and the embodiments of FIGS. 8 to 11 constitute independent advances that may each be subject to specific protection.
Un exemple d'entité électronique est une carte à microcircuit 10 dont les principaux éléments électroniques sont représentés à la figure 1 et qui comporte un microprocesseur 2 relié d'une part à une mémoire vive (ou RAM de l'anglais Random Access Memory) 4 et d'autre part à une mémoire à semi- conducteur non-volatile réinscriptible 6, par exemple une mémoire morte effaçable et programmable électriquement (ou EEPROM de l'anglais Electrically Erasable Programable Read OnIy Memory). En variante, la mémoire non- volatile réinscriptible à semi-conducteur 6 pourrait être une mémoire flash.An example of an electronic entity is a microcircuit card 10, the main electronic elements of which are represented in FIG. 1 and which comprises a microprocessor 2 connected on the one hand to a Random Access Memory (RAM) 4 and on the other hand to a non-volatile rewritable semiconductor memory 6, for example an erasable and electrically programmable read-only memory (or EEPROM of the English Electrically Erasable Programable Read OnIy Memory). Alternatively, the non-volatile rewritable semiconductor memory 6 could be a flash memory.
Les mémoires 4, 6 sont reliées au microprocesseur 2 par un bus chacune sur la figure 1 ; en variante, il pourrait s'agir d'un bus commun. La carte à microcircuit 10 comporte également une interface 8 de communication avec un terminal utilisateur réalisée ici sous forme de contacts dont un assure par exemple une liaison bidirectionnelle avec le microprocesseur 2. L'interface 8 permet ainsi l'établissement d'une communication bidirectionnelle entre le microprocesseur 2 et le terminal utilisateur dans lequel la carte à microcircuit 10 sera insérée.The memories 4, 6 are connected to the microprocessor 2 by a bus each in Figure 1; alternatively, it could be a common bus. The microcircuit card 10 also comprises an interface 8 for communication with a user terminal made here in the form of contacts, one of which, for example, provides a bidirectional link with the microprocessor 2. The interface 8 thus enables the establishment of bidirectional communication between the microprocessor 2 and the user terminal in which the microcircuit card 10 will be inserted.
Ainsi, lors de l'insertion de la carte à microcircuit 10 dans un terminal utilisateur, le microprocesseur 2 va mettre en œuvre un procédé de fonctionnement de la carte à microcircuit 10, selon un jeu d'instructions, stockées par exemple dans une mémoire morte (ou ROM de l'anglais Read- OnIy Memory) - non représentée - ou dans la mémoire réinscriptible 6, qui définit un programme d'ordinateur. Ce procédé inclut en général l'échange de données avec le terminal utilisateur via l'interface 8 et le traitement de données au sein de la carte à microcircuit 10, et précisément au sein du microprocesseur 2 avec utilisation éventuelle de données stockées dans la mémoire réinscriptible 6 et de données stockées temporairement dans la mémoire vive 4. Des exemples de procédés qui mettent en œuvre l'invention sont donnés dans la suite.Thus, during the insertion of the microcircuit card 10 into a user terminal, the microprocessor 2 will implement a method of operation of the microcircuit card 10, according to a set of instructions, stored for example in a read-only memory. (or Read-OnIy Memory ROM) - not shown - or in the rewritable memory 6, which defines a computer program. This method generally includes the exchange of data with the user terminal via the interface 8 and the data processing within the microcircuit card 10, and precisely within the microprocessor 2 with possible use of data stored in the rewritable memory 6 and data temporarily stored in the RAM 4. Examples of methods that implement the invention are given below.
La figure 2 représente l'allure physique générale de la carte à microcircuit 10 réalisée avec la forme générale d'un parallélépipède rectangle de très faible épaisseur.FIG. 2 represents the general physical appearance of the microcircuit card 10 made with the general shape of a rectangular parallelepiped of very small thickness.
L'interface de communication 8 pourvue des contacts déjà mentionnés apparaît clairement sur la face de la carte à microcircuit 10 visible sur la figure 2, sous forme d'un rectangle inscrit dans la face supérieure de la carte à microcircuit 10. On décrit maintenant des exemples de réalisation de l'invention en référence à un algorithme cryptographique de type AES ("Advanced Encryption Standard" selon la terminologie anglo-saxonne) représenté synthétiquement sur la figure 3.The communication interface 8 provided with the contacts already mentioned appears clearly on the face of the microcircuit card 10 visible in FIG. 2, in the form of a rectangle inscribed in the upper face of the microcircuit card 10. embodiments of the invention with reference to an AES type cryptographic algorithm ("Advanced Encryption Standard "according to the English terminology) represented synthetically in FIG.
Il est néanmoins entendu que l'invention peut par exemple être appliquée dans le cas d'autres algorithmes impliquant une fonction non-linéaire, tel l'algorithme DES, avec par exemple l'utilisation de blocs de chiffrementIt is nevertheless understood that the invention may for example be applied in the case of other algorithms involving a non-linear function, such as the DES algorithm, with for example the use of encryption blocks
(également connus sous la terminologie "block ciphei"). Le masque ou les masques appliqués à la donnée en entrée de la fonction non-linéaire ne sont d'ailleurs pas nécessairement le ou les masques X appliqués au début de l'algorithme, mais s'en déduisent en général facilement selon les mécanismes de l'algorithme, par exemple tel que mentionné dans la demande WO 2007/116140 susvisée.(also known as "block ciphei"). The mask or masks applied to the input data of the non-linear function are not necessarily the X masks or masks applied at the beginning of the algorithm, but are generally deduced easily according to the mechanisms of the algorithm, for example as mentioned in WO 2007/116140 referred to above.
La figure 3 représente les étapes essentielles du procédé de chiffrement AES d'un mot M au sein de l'entité électronique.FIG. 3 represents the essential steps of the AES encryption method of a word M within the electronic entity.
Le mot M est en général une partie d'un message à chiffrer ayant par exemple une longueur de 128 bits. D'autres longueurs sont naturellement envisageable, telles que les longueurs de 192 bits et 256 bits fréquemment utilisées.The word M is generally a part of a message to be encrypted having for example a length of 128 bits. Other lengths are naturally conceivable, such as the lengths of 192 bits and 256 bits frequently used.
L'exemple décrit ici utilise comme entité électronique la carte à microcircuit décrite précédemment en référence aux figures 1 et 2, mais d'autres types d'entité électronique peuvent naturellement être utilisés, tels que par exemple un ordinateur personnel.The example described here uses as electronic entity the microcircuit card described above with reference to Figures 1 and 2, but other types of electronic entity can naturally be used, such as for example a personal computer.
Pour ce faire, l'entité électronique mémorise, par exemple au sein de la mémoire non volatile 6, une clé cryptographique K à partir de laquelle sont dérivées des sous-clés Ko, ... Kn au moyen d'une procédure d'expansion de clé. L'obtention des sous-clés K0, ... Kn peut être réalisée selon des techniques connues et qui ne seront donc pas décrites en détail ici. On pourra se référer par exemple à la demande de brevet FR 2 838 262.To do this, the electronic entity stores, for example within the non-volatile memory 6, a cryptographic key K from which subkeys Ko,... K n are derived by means of a procedure of key expansion. Obtaining the subkeys K 0 , ... K n can be performed according to known techniques and therefore will not be described in detail here. For example, reference may be made to patent application FR 2 838 262.
On notera toutefois que l'invention, décrite dans la suite pour le calcul au niveau des boîtes-S (ou "S-box") impliquées à chaque itération (ou ROUND) de l'algorithme AES, pourrait être mise en œuvre lors de l'application de la fonction non-linéaire utilisée dans l'algorithme de dérivation des sous-clés K0, ...It will be noted however that the invention described hereinafter for the calculation at the level of the S-boxes (or "S-box") involved with each iteration (or ROUND) of the AES algorithm, could be implemented during the application of the non-linear function used in the derivation algorithm of subkeys K 0 , ...
Kn. Le procédé de chiffrement commence à l'étape E100 par la réception, par exemple à travers l'interface 8 de la carte à microcircuit, du mot (en général une partie de message) M à chiffrer.K n . The encryption process starts at step E100 by receiving, for example through the interface 8 of the microcircuit card, the word (generally a message part) M to be encrypted.
On procède alors au sein de l'entité électronique au tirage d'un nombre aléatoire X utilisé comme masque du mot M au cours d'une étape E102. Bien que l'on utilise les termes "nombre aléatoire", il s'agit par exemple en pratique d'un nombre pseudo-aléatoire déterminé à l'intérieur du microprocesseur 2. De manière générale, le nombre X et toute donnée référencée ci-après comme aléatoire doit être un nombre non-prévisible de l'extérieur de l'entité électronique. On procède alors au cours d'une étape E104 au masquage du mot M afin d'obtenir un mot masqué M' par combinaison du mot M et du nombre aléatoire X au moyen d'une opération de OU EXCLUSIF (fréquemment dénommée "XOR") : M' = M Θ X.One then proceeds within the electronic entity to draw a random number X used as a mask of the word M during a step E102. Although the term "random number" is used, it is for example in practice a pseudo-random number determined inside the microprocessor 2. In general, the number X and any data referenced hereinbelow after as random must be a non-predictable number from outside the electronic entity. Then, during a step E104, the masking of the word M is performed in order to obtain a masked word M 'by combining the word M and the random number X by means of an EXCLUSIVE OR operation (frequently referred to as "XOR"). : M '= M Θ X.
Lorsqu'un simple masque est utilisé pour masquer une donnée (masquage d'ordre 1), la fuite d'information sur la donnée masquée peut-être ciblée conjointement avec la fuite d'information sur le masque afin de retrouver de l'information sur la donnée en claire. Ce type d'attaques couramment appelées attaques d'ordre 2 peut être évité par l'utilisation d'un second masque (masquage d'ordre 2). Ainsi en variante, ce peut être deux masques Xi et X2 qui sont générés pour doublement masquer le message M: M' = M Θ Xi® X2. Cette configuration fournit une protection du message M au deuxième ordre de fuite. On décrira notamment par la suite un exemple de réalisation de l'invention impliquant ce double masquage. On affectera dans la suite le symbole prime aux valeurs masquées (ici par exemple M') tandis que les grandeurs qui ne portent pas le symbole prime représentent les grandeurs correspondantes sans masquage, c'est-à-dire telles qu'elles auraient été obtenues au cours de l'algorithme AES réalisé sans masquage ; ces grandeurs sans masquage sont introduites ici à des fins explicatives, mais ne seront pas manipulées par le procédé décrit ici qui utilise leur version masquée, sauf naturellement pour les grandeurs M et Mn utilisées respectivement en entrée et en sortie. II va à présent être procédé aux différentes étapes de l'algorithme AES en utilisant la donnée masquée M' selon les étapes décrites ci-dessous qui correspondent aux étapes classiques de l'algorithme AES adaptées pour tenir compte du masquage. On procède ainsi tout d'abord à la transformation initiale au moyen de la sous-clé Ko au cours d'une étape E106 en appliquant la clé Ko à la donnée au moyen d'un opérateur OU EXCLUSIF: M'o= M1 Θ K0.When a simple mask is used to mask data (masking of order 1), the leakage of information on the masked data can be targeted together with the leakage of information on the mask in order to retrieve information on the data in clear. This type of attacks commonly called second-order attacks can be avoided by using a second mask (2nd-order masking). Thus, alternatively, it can be two masks X 1 and X 2 that are generated to doubly hide the message M: M '= M Θ Xi® X 2 . This configuration provides protection for the message M at the second leakage order. In particular, an embodiment of the invention involving this double masking will be described below. In the sequel, the premium symbol will be assigned to masked values (here for example M ') while the quantities which do not bear the prime symbol represent the corresponding quantities without masking, that is to say as they would have been obtained. during the AES algorithm performed without masking; these quantities without masking are introduced here for explanatory purposes, but will not be manipulated by the method described here which uses their masked version, except of course for the quantities M and M n used respectively in input and output. The different steps of the AES algorithm will now be carried out using the masked data M 'according to the steps described below which correspond to the conventional steps of the AES algorithm adapted to take account of the masking. This is done first of all the initial transformation by means of the subkey KB during a step E106 by applying the key Ko to the data by means of an operator EXCLUSIVE OR: M ' o = M 1 Θ K 0 .
Si on dénomme M0 le résultat de la transformation initiale sans masquage (Mo = M θ K0), on peut remarquer que le résultat MO de l'étape E106 peut s'écrire M'o = Mo θ X. On remarque ainsi que le résultat de l'étape E106 correspond au résultat de la transformation initiale sans masquage, masqué par la valeur du masque X.If we denominate M 0 the result of the initial transformation without masking (Mo = M θ K 0 ), we can notice that the result MO of the step E106 can be written M ' o = Mo θ X. We thus notice that the result of step E106 corresponds to the result of the initial transformation without masking, masked by the value of the mask X.
On procède après la transformation initiale à une étape E108 d'initialisation à 1 d'un indice i repérant dans la suite l'itération (ou ROUND) concernée.Proceeding after the initial transformation to a step E108 of initialization to 1 of an index i subsequently identifying the iteration (or ROUND) concerned.
A l'étape E110, on fait subir au mot masqué MVi obtenu à l'étape précédente (étape E106 après la transformation initiale ou itération précédente) une itération (ROUND) des étapes E110 et E112, afin d'obtenir un nouveau mot masqué MV Chaque itération est conçue pour que le résultat obtenu après l'itération M'j soit égal au résultat Mj après l'itération i dans un algorithme sans masquage, masqué avec un masque X identique à celui introduit à l'étape E104 : après chaque itération, M'j = Mj θ X.In the step E110, the masked word MVi obtained in the preceding step (step E106 after the initial transformation or preceding iteration) is subjected to a r iteration (ROUND) of the steps E110 and E112, in order to obtain a new masked word MV. Each iteration is designed so that the result obtained after the iteration M'j is equal to the result Mj after the iteration i in an algorithm without masking, masked with a mask X identical to that introduced in step E104: after each iteration , M'j = Mj θ X.
En alternative, on peut prévoir que le masquage est modifié à chaque itération, par exemple en démasquant M'j et en le re-masquant avec un nouveau masque Y. A titre d'exemple, cette opération peut être effectuée à l'étape E210 mentionnée dans la demande WO 2007/116140 susvisée.Alternatively, it can be provided that the masking is modified at each iteration, for example by unmasking M'j and re-masking with a new mask Y. As an example, this operation can be performed in step E210 mentioned in the aforementioned application WO 2007/116140.
Une fois l'itération ou ROUND i réalisée, on incrémente la valeur de l'indice i au cours d'une étape E114, puis on teste au cours d'une étape E116 l'égalité i = n, où n est le nombre d'itérations plus un utilisées dans l'algorithme concerné (en général 10 itérations pour un mot de 128 bits). Si la dernière itération n'a pas été atteinte (c'est-à-dire que l'égalité i = n n'est pas vérifiée), on retourne à l'étape E110 pour la mise en œuvre de l'itération suivante. A cette occasion, et comme indiqué ci-dessus, on peut générer un nouveau masque et l'utiliser pour masquer le résultat MV Si en revanche la dernière itération est atteinte (c'est-à-dire lorsque l'on vérifie i = n), on procède à la transformation finale lors d'une étape E118, au cours de laquelle on obtient donc un mot IWn à partir du mot M'n-i précédemment obtenu, et ce avec utilisation de la sous-clé Kn (étape E118).Once the iteration or ROUND i is carried out, the value of the index i is incremented during a step E114, and then, during a step E116, the equality i = n is tested, where n is the number of i iterations plus one used in the algorithm concerned (usually 10 iterations for a 128-bit word). If the last iteration has not been reached (that is, the equality i = n is not satisfied), we return to step E110 for the implementation of the next iteration. On this occasion, and as indicated above, we can generate a new mask and use it to hide the result MV If on the other hand the last iteration is reached (that is to say when we check i = n ), the final transformation is carried out during a step E118, during which we obtain a word IW n from the word M ' n- i previously obtained, and this with use of the subkey K n ( step E118).
Le résultat de la transformation finale M'n correspond ainsi au mot chiffré obtenu grâce à l'algorithme AES à partir du mot initial M, masqué avec le masque précédemment défini X (ou le dernier masque intermédiaire Y généré si l'on souhaite modifier le masquage au cours des itérations).The result of the final transformation M ' n thus corresponds to the encrypted word obtained by means of the AES algorithm from the initial word M, masked with the previously defined mask X (or the last intermediate mask Y generated if it is desired to modify the masking during iterations).
On procède alors à l'étape E120 au démasquage du mot obtenu à l'étape E118 afin d'obtenir le mot chiffré Mn : Mn = M'n θ X (ou avec le masque Y). Le mot chiffré Mn peut alors être émis à l'extérieur de l'entité électronique au moyen de l'interface 8 au cours d'une étape E122 qui termine le procédé de chiffrage par l'entité électronique du mot M.Step E120 is then carried out to unmask the word obtained in step E118 in order to obtain the ciphered word M n : M n = M ' n θ X (or with the mask Y). The encrypted word M n can then be sent outside the electronic entity by means of the interface 8 during a step E122 which ends the encryption process by the electronic entity of the word M.
La présente invention porte plus précisément sur l'utilisation des SBox lors de l'itération des étapes E110 et E112. Dans le domaine de la cryptographie, la transformation M'M -> M'j peut être modélisée par la composition de trois opérations: une fonction additive de la clé dérivée Kj, une fonction non linéaire et une fonction linéaire.The present invention relates more specifically to the use of SBox during the iteration of steps E110 and E112. In the field of cryptography, the transformation M'M -> M'j can be modeled by the composition of three operations: an additive function of the derived key Kj, a nonlinear function and a linear function.
L'étape E110 illustre l'application de la fonction non linéaire par l'utilisation d'une boîte-S et décrite plus en détail en référence aux modes de réalisation ci-après.Step E110 illustrates the application of the non-linear function by the use of an S-box and described in more detail with reference to the embodiments below.
L'étape E112 correspond alors à l'application des deux autres fonctions dont un exemple est proposé dans la demande WO 2007/116140 susvisée en lien avec sa figure 4, notamment des étapes de décalage de bits de sous-blocs (également appelée étape de Shift Row), de multiplication par une matrice (étape appelée Mix Column) et d'addition de la clé Kj (étape Add Round Key). Pour la réalisation de l'étape E110, la table-S est stockée dans la mémoire non volatile 6, table également dénommée table de conversion (look- up table ou LUT). La table reçoit des données d'entrée de dimension m et fournit des données de sortie de dimension n, notamment m peut être égale à n. L'invention s'applique également dans le cas où ces deux dimensions sont différentes.The step E112 then corresponds to the application of the two other functions, an example of which is proposed in the aforementioned application WO 2007/116140 in connection with FIG. 4, in particular sub-block bit shift steps (also known as step Shift Row), multiplication by a matrix (step called Mix Column) and addition of the key Kj (Add Round Key step). For the realization of the step E110, the table-S is stored in the nonvolatile memory 6, table also called conversion table (look-up table or LUT). The table receives input data of dimension m and provides output data of dimension n, in particular m can be equal to n. The invention also applies in the case where these two dimensions are different.
On dispose également de deux registres Ro et Ri dont l'utilisation est décrite ci-après. Ces registres sont notamment des registres binaires aptes à stocker des données numériques de sortie de la table-S (c'est-à-dire qu'ils ont une dimension appropriée au moins égale à n permettant ce stockage). En particulier, ces registres sont prévus dans le microcontrôleur de la carte 10 voire dans le microprocesseur 2.There are also two registers Ro and Ri whose use is described below. These registers are in particular binary registers capable of storing digital data output from the S-table (that is to say they have a suitable dimension at least equal to n allowing this storage). In particular, these registers are provided in the microcontroller of the card 10 or even in the microprocessor 2.
On a représenté un premier mode de réalisation de l'étape E110 à la figure 4. A l'étape E200, on dispose de la donnée masquée MVi et du masqueA first embodiment of step E110 is shown in FIG. 4. In step E200, the masked data MVi and the mask are available.
X, tous deux représentés sous forme binaire de dimension m.X, both represented in binary form of dimension m.
A l'étape E202, on initialise une variable binaire de masquage A à 0, qui sert à définir des itérations successives d'accès à la table S. Cette valeur A prend des valeurs entre 0 et 2m-1 et est donc de même dimension que M'M et X.In step E202, a binary masking variable A is initialized to 0, which serves to define successive iterations of access to the table S. This value A takes values between 0 and 2 m -1 and is therefore the same dimension that M'M and X.
A l'étape E204, on procède à la comparaison de la variable binaire de masquage A de l'itération en cours, en l'espèce la valeur 0 pour la première itération, avec le masque X d'entrée. Pour ce faire, on utilise une fonction booléenne de comparaison définie par:In step E204, the masking bit variable A of the current iteration, in this case the value 0 for the first iteration, is compared with the input mask X. To do this, we use a Boolean comparison function defined by:
compαre(x,y)
Figure imgf000018_0001
compαre (x, y)
Figure imgf000018_0001
Ainsi, quelque soit l'itération considérée, si A=X alors la comparaison fournit la valeur cmp=0, sinon la valeur 1 est retournée.Thus, whatever the iteration considered, if A = X then the comparison gives the value cmp = 0, otherwise the value 1 is returned.
En l'espèce si X est différent du masque 0, alors la fonction de comparaison retourne 1. A l'étape E206, on utilise la table S pour calculer la donnée de sortie masquée B' de SBox associée à M'μi® A, notamment masquée par un masque binaire de sortie Z de dimension n: B' = S(MViθ A) θ Z.In this case if X is different from the mask 0, then the comparison function returns 1. In step E206, the table S is used to calculate the masked output datum B 'of SBox associated with M'μi® A, in particular masked by an output binary mask Z of dimension n: B' = S (MViθ A ) θ Z.
On stocke cette valeur binaire B1 dans le registre d'indice cmp calculé précédemment à l'étape E204.This binary value B 1 is stored in the index register cmp calculated previously in step E204.
On remarquera que la valeur B1 est stockée dans le registre R0 uniquement si A=X, et dans le registre R1 si A≠X.It will be noted that the value B 1 is stored in the register R 0 only if A = X, and in the register R 1 if A ≠ X.
On incrémente la valeur A de une unité binaire à l'étape E208.The value A of a bit unit is incremented in step E208.
A l'étape E210, on compare la valeur de masquage A à 2m, représentant le nombre d'entrées de la table S.In step E210, the masking value A is compared with 2 m , representing the number of entries of the table S.
En cas de comparaison négative, on procède à une nouvelle itération des étapes E204 à E210 qui permettent d'accéder à une nouvelle entrée de la table S.In the case of a negative comparison, it is proceeded to a new iteration of the steps E204 to E210 which make it possible to access a new entry of the table S.
En cas de comparaison positive à l'étape E210, on a parcouru l'ensemble des entrées de la table S et on met fin au processus de calcul de la SBox en retournant (étape E212) la valeur stockée dans le registre R0, éventuellement accompagnée du masque de sortie Z.In the case of a positive comparison in step E210, all the entries of the table S have been traversed and the process of calculating the SBox is ended by returning (step E212) the value stored in the register R 0 , possibly accompanied by the exit mask Z.
On remarque que le registre R0 contient la valeur S(M1M θ A) θ Z lorsque A=X, à savoir S(M'μΦ X) θ Z= S(MMΘ Xθ X) ® Z= S(MM) θ Z. On a ainsi, sans manipulé directement la valeur MM non masquée, obtenu sa transformée (masquée au premier ordre) par la fonction non linéaire de laNote that the register R 0 contains the value S (M 1 M θ A) θ Z when A = X, namely S (M'μΦ X) θ Z = S (M M Θ Xθ X) Z Z = S ( MM) θ Z. Thus, without directly manipulating the unmasked value MM, obtained its transform (masked in the first order) by the nonlinear function of the
SBox.SBox.
On note, par ailleurs, que cette réalisation met en œuvre des opérations factices ou inutiles (dummy selon la terminologie anglo-saxonne) au sens où elles ne sont pas prises en compte dans le calcul de la valeur finale contenue dans R0, c'est le cas de tous les calculs stockés dans Ri.Note also that this implementation implements dummy or dummy operations in the sense that they are not taken into account in the calculation of the final value contained in R 0 , c ' is the case of all the calculations stored in Ri.
Afin d'éviter la présence de telles opérations factices éventuellement détectables par un attaquant mal intentionné pour déterminer la seule opération non factice, on peut proposer de modifier la méthode ci-dessus par les éléments suivants, illustrés par la figure 5.In order to avoid the presence of such fictitious operations possibly detectable by a malicious attacker to determine the only non-factitious operation, it may be proposed to modify the above method by the following elements, illustrated by FIG.
On part des mêmes éléments (étape E300). La table S représente une fonction F non linéaire dite équilibrée ("balancée!") au sens où elle vérifie: cardinal[F"1(y)] = 2m"π pour tout élément y binaire de longueur n.We start from the same elements (step E300). Table S represents a so-called balanced nonlinear F function ("balanced!") In the sense that it verifies: cardinal [F "1 (y)] = 2 m" π for any binary element of length n.
De telles fonctions équilibrées sont toujours utilisées dans les applications cryptographiques requerrant un niveau de sécurité important.Such balanced functions are still used in cryptographic applications requiring a high level of security.
Lors de l'initialisation de l'étape E302, on initialise, outre A à 0, les registres R0 et Ri à, chacun, la valeur Z du masque de sortie. En présence de plusieurs masques, il y aura lieu de stocker la combinaison des masques de sorties, par exemple ZiθZ2.During the initialization of step E302, the registers R 0 and R 1 are initialized, besides A to 0, each with the value Z of the output mask. In the presence of several masks, it will be necessary to store the combination of the output masks, for example ZiθZ 2 .
A l'étape E304, on compare A et X de façon similaire à l'étape E204 ci-dessus. A l'étape E306, on augmente le registre Rcmp de la valeur SBox de sortie calculée pour le masque A: Rcmp <— Rcmp θ S(M1 M θ A).In step E304, A and X are compared in a manner similar to step E204 above. In step E306, the register R cm p of the output SBox value calculated for the mask A is increased: R cmp <- R cmp θ S (M 1 M θ A).
On procède ainsi pour chacune des valeurs de masquage A de 0 à 2m-1 (étapes E308, E310 similaires aux étapes E208 et E210).This is done for each of the masking values A of 0 to 2 m -1 (steps E308, E310 similar to steps E208 and E210).
Au sortir des itérations, on compare, à l'étape E312, les deux registres: cmp <— compare(R0,Ri). Cette étape retourne 0 si les deux registres sont égaux et 1 s'ils sont différents.At the end of the iterations, in step E312, the two registers are compared: cmp <- compare (R 0 , Ri). This step returns 0 if the two registers are equal and 1 if they are different.
A l'étape E314, on retourne comme donnée de sortie masquée de la SBox, la valeur Roθ(cmp x Ri).In step E314, the masked output data of the SBox is returned as R o θ (cmp x Ri).
Au sortir de l'algorithme, le registre Ri comprend la valeurAt the end of the algorithm, the register Ri comprises the value
Zω ^ AeF^" S(MV1S A). Du fait des propriétés de la fonction F de la SBoxe ^ A ^ F "S (MV SA 1). Because of the properties of the function F of SBox
A≠XA ≠ X
(fonction balanced), cette valeur est égale, dans une exécution normale, à(balanced function), this value is equal, in a normal execution, to
S(M'MΘ X) Θ Z, c'est-à-dire identique à Ro-S (M'MΘ X) Θ Z, that is to say identical to Ro-
Par conséquent, la comparaison de l'étape E312 doit retourner 0 dans une exécution normale et l'algorithme retourne alors R0 = S(MViθ X) θ Z. Le résultat E314 est alors dépendant de toutes les étapes exécutées, apportant un gain de sécurité.Therefore, the comparison of the step E312 must return 0 in a normal execution and the algorithm then returns R 0 = S (MViθ X) θ Z. The result E314 is then dependent on all the steps executed, bringing a gain of security.
En référence à la figure 6, on a représenté un autre mode de réalisation de l'invention reposant sur l'affectation (pseudo)aléatoire des registres et sur une protection contre les fuites de deuxième ordre. Il est entendu que l'affectation des registres peut également s'appliquer au mode de réalisation correspondant à la figure 4. De façon symétrique, la mise en œuvre décrite en référence à la figure 5 peut également être réalisée par l'utilisation d'un double masquage (voire plus) et l'affectation des registres.Referring to Figure 6, there is shown another embodiment of the invention based on the assignment (pseudo) random registers and a protection against second-order leaks. It is understood that the assignment of the registers can also be applied to the embodiment corresponding to FIG. 4. In a symmetrical way, the implementation described with reference to Figure 5 can also be achieved by the use of double masking (or more) and the allocation of registers.
A l'étape E400, on dispose de la donnée doublement masquée M'u et des masque Xi et X2 (MVi = (MM Θ XI) θ X2), tous représentés sous forme binaire de dimension m.At step E400, we have the double masked data M'u and the mask Xi and X 2 (MVi = (MM Θ XI) θ X 2 ), all represented in binary form of dimension m.
A l'étape E402, on génère (pseudo)-aléatoirement un booléen b, qui prend donc soit la valeur 0 soit la valeur 1. On utilise ce même booléen pour toute l'exécution du calcul sur la SBox.In step E402, a boolean b is generated (pseudo) randomly, which therefore takes either the value 0 or the value 1. This same boolean is used for all the execution of the calculation on the SBox.
A l'étape E404, on initialise, de façon similaire à celle indiquée ci- dessus, la variable binaire de masquage A à 0, qui sert à définir des itérations successives d'accès à la table S.In step E404, the bit masking variable A to 0 is initialized, in a manner similar to that indicated above, which serves to define successive iterations of access to the table S.
A l'étape E406, on compare la valeur combinée Xi® A des masques Xi et A, avec le masque d'entrée X2. Pour ce faire, on utilise la fonction comparβb qui dérive de la fonction compare, identifiée précédemment, comme suit: f b if x = y compαreb(x, y) = \ -In step E406, the combined value Xi® A of the masks Xi and A is compared with the input mask X 2 . To do this, we use the function comparβ b which derives from the function compare, identified previously, as follows: fb if x = y compαre b (x, y) = \ -
\ b ij x ≠ y\ b ij x ≠ y
Une réalisation de cette fonction (également applicable à la fonction compare simple) est décrite ci-après en référence à la figure 7.One embodiment of this function (also applicable to the simple compare function) is described below with reference to FIG.
On note ici que l'on combine Xi avec A afin de ne pas manipuler directement X-ιθ X2, ce qui correspondrait à une protection d'ordre un (Xiθ X2 pouvant être vu comme un unique masque d'entrée).We note here that we combine Xi with A in order not to directly manipulate X-ιθ X2, which would correspond to a protection of order one (Xiθ X2 can be seen as a single input mask).
A l'étape E408, on utilise, de façon similaire à l'étape E206 ci- dessus, la table S pour calculer la donnée de sortie masquée B' de SBox associée à MV1Θ A, notamment masquée par deux masques binaires de sortie Z1 et Z2 de dimension n: B' = S(MViθ A) θ Ziθ Z2.In step E408, the table S is used, similarly to step E206 above, to calculate the masked output datum B 'of SBox associated with MV 1 Θ A, in particular masked by two output bit masks. Z 1 and Z 2 of dimension n: B '= S (MViθ A) θ Ziθ Z 2 .
On stocke cette valeur binaire B' dans le registre d'indice cmp calculé précédemment à l'étape E406.This binary value B 'is stored in the cmp index register calculated previously in step E406.
On remarquera que la valeur B' est stockée dans le registre Rb uniquement si A=XiΘX2, et dans l'autre registre si A≠XiΘX2. On remarquera également que, du fait de la détermination aléatoire de la valeur b au début d'un calcul par SBox, ce n'est pas toujours dans le même registre que l'on stocke la donnée de sortie correspondant à la combinaison des masques d'entréeIt will be noted that the value B 'is stored in the register R b only if A = XiΘX 2 , and in the other register if A ≠ XiΘX 2 . It will also be noted that, because of the random determination of the value b at the beginning of a calculation by SBox, it is not always in the same register that one stores the output data corresponding to the combination of the input masks
(A=OCeX2).(A = OCeX 2 ).
On incrémente la valeur A de une unité binaire à l'étape E410.The value A of a bit unit is incremented in step E410.
A l'étape E412, on compare la valeur de masquage A à 2m, représentant le nombre d'entrées de la table S.In step E412, the masking value A is compared with 2 m , representing the number of entries in the table S.
En cas de comparaison négative, on procède à une nouvelle itération des étapes E406 à E412 qui permettent d'accéder à une nouvelle entrée de la table S.In the case of a negative comparison, it is proceeded to a new iteration of the steps E406 to E412 which make it possible to access a new entry of the table S.
En cas de comparaison positive à l'étape E412, on a parcouru l'ensemble des entrées de la table S et on met fin au processus de calcul de la SBox en retournant la valeur stockée dans le registre Rb, éventuellement accompagnée des masques de sortie Zi et Z2.In the case of a positive comparison in step E412, all the entries of the table S have been traversed and the process of calculating the SBox is ended by returning the value stored in the register R b , possibly accompanied by the masks of Zi and Z 2 output.
On remarque que le registre Rb contient la valeur S(MViθ A)ΘZ-ι®Z2 lorsque
Figure imgf000022_0001
à savoir S(M1 MeXIeX2)SZiSZ2 = S(Mj-1 eXi ex2eXiex2)ez1ez2 = S(MM)ΘZIΘZ2.
Note that the register R b contains the value S (MViθ A) ΘZ-ι®Z 2 when
Figure imgf000022_0001
namely S (M 1 M eXIeX 2 ) SZiSZ 2 = S (M 1 -1 eX 1 ex 2 eXiex 2 ) ez 1 e 2 = S (MM) ΘZI 2 .
On a ainsi, sans manipulé directement la valeur MM non masquée obtenue sa transformée (masquée au premier ordre) par la fonction non linéaire de la SBox.Thus, without directly manipulating the unmasked MM value obtained its transform (masked to the first order) by the nonlinear function of the SBox.
On note que les comparaisons impliquant la valeur de masquage A et réalisées ci-dessus, peuvent être mises en œuvre pas une comparaison bit à bit des deux paramètres des fonctions compare.It is noted that the comparisons involving the masking value A and carried out above, can be implemented not a bit-by-bit comparison of the two parameters of the compare functions.
Néanmoins, la figure 7 propose une réalisation alternative de la fonction compareb, également applicable à la fonction compare, utilisant une table T de valeurs booléennes de 2m entrées (même nombre d'entrée que la table-S et que les valeurs possibles de A). La fonction de comparaison est ainsi mise en œuvre par un simple accès en lecture à la table T.Nevertheless, FIG. 7 proposes an alternative embodiment of the compare function b , also applicable to the compare function, using a table T of Boolean values of 2 m entries (same input number as the S-table and that the possible values of AT). The comparison function is thus implemented by a simple read access to the table T.
Pour ce faire, lors d'une étape d'initialisation, par exemple lors de l'étape E402, on procède à la génération aléatoire d'un index r3: r?> <- rαndini)To do this, during an initialization step, for example during step E402, the random generation of an index r3 is performed: r?> <- rαndini)
(étape 500). A l'étape 502, on initialise la table T avec la valeur b (où b est le complémentaire de b)à chacune des entrées à partir du booléen généré à l'étape E402: T <- $;b;b;...;b}. A l'étape 504, on affecte la valeur du booléen b à l'entrée correspondant à l'index généré r3: τ[r3] <- b .(step 500). In step 502, the table T is initialized with the value b (where b is the complement of b) to each of the entries from the boolean generated in step E402: T <- $; b; b; . b}. In step 504, the value of the boolean b is assigned to the input corresponding to the generated index r3: τ [r3] <- b.
Ainsi, à la fin du processus d'initialisation, on a une table T configurée comme suit: if x = r3So, at the end of the initialization process, we have a table T configured as follows: if x = r3
L J U ssiiinon LJ U ssiiinon
Lors de l'utilisation de la fonction de comparaison (étapes E204,When using the comparison function (steps E204,
E304, E406), on reçoit deux valeurs α et β à comparer (étape E506) correspondant généralement à la donnée de masquage (éventuellement combinée à un masque) et à un masque d'entrée. La comparaison consiste alors à l'étape E508 à retourner l'entrée du tableau d'indice (α Θ r3) θ β. En effet, si α = β, alors le processus retourneE304, E406), two values α and β are compared (step E506) generally corresponding to the masking data (possibly combined with a mask) and to an input mask. The comparison then consists of the step E508 to return the entry of the index table (α Θ r3) θ β. Indeed, if α = β, then the process returns
T[r3]=b.T [r3] = b.
Ainsi, les modes de réalisations tels que décrits ci-dessus permettent de sécuriser le calcul d'une sortie de SBox masquée à partir d'une entrée masquée pour les ordres de masquages traditionnellement utilisés, à savoir aussi bien pour un masquage de premier ordre qu'un masquage de deuxième ordre.Thus, the embodiments as described above make it possible to secure the calculation of a masked SBox output from a masked input for the traditionally used masking orders, namely for first-order masking as well. second-order masking.
Quel que soit le mode de réalisation envisagé ci-dessus, l'architecture matérielle des équipements électroniques, tels que le microcircuitWhatever the embodiment envisaged above, the hardware architecture of the electronic equipment, such as the microcircuit
10, impose parfois l'utilisation de mots machine sur un nombre de bits déterminés, par exemple 8 bits; 16 bits ou 32 bits. Ainsi, lorsque les données de sortie sont des mots d'un nombre inférieur de bits, par exemple 4 bits, on mémorise plusieurs mots de sortie S(M) dans un seul mot machine. Les figures 8a et 8b illustrent cette réalisation pratique. Sur la figure10, sometimes imposes the use of machine words on a certain number of bits, for example 8 bits ; 16 bits or 32 bits. Thus, when the output data are words of a smaller number of bits, for example 4 bits, several output words S (M) are stored in a single word machine. Figures 8a and 8b illustrate this practical embodiment. On the face
8a, on observe la table S utilisée ci-dessus présentant 2m mots de sortie de longueur n. Sur la figure 8b, la réalisation pratique mémorise les mots de sortie de longueur n, ici 2 bits, sur des mots machines de longueur 2wn, ici 16 bits (w est alors égal à 3). Le stockage de l'ensemble des mots de sortie S(M) ne requiert alors que l'utilisation de 2m"w mots machines, stockant chacun respectivement 2W mots de sortie S(M) (également appelés par la suite "sous- mots"). On obtient ainsi un stockage en mémoire efficace. La table ainsi formée comprend 2m"w mots de longueur 2wn.8a, we observe the table S used above having 2 m output words of length n. In FIG. 8b, the practical embodiment stores the output words of length n, here 2 bits, on machine words of length 2 w n, here 16 bits (w is then equal to 3). The storage of the set of output words S (M) then only requires the use of 2 m "w machine words, each respectively storing 2 W output words S (M) (also hereinafter referred to as" sub-words "). In this way, an efficient storage is obtained The table thus formed comprises 2 m "w words of length 2 w n.
Les mots de sortie sont mémorisés de sorte qu'on accède au motThe output words are stored so that the word is accessed
S(M) en sélectionnant un mot machine Smachine(MH) à partir des m-w bits les plus significatifs de M (notés pour la suite MH) et en récupérant le sous-mot du mot sélectionné à partir des w bits les moins significatifs de M (ci-après notésS (M) by selecting a Smachine machine word (M H ) from the most significant mw bits of M (noted for the sequence M H ) and by recovering the subword of the selected word from the least significant w bits of M (hereinafter noted
ML). Notamment SmaChine(MH) = {S(MH,0), S(MH, 1) S(MH,2w-1)}.M L ). In particular S maC hine (M H ) = {S (M H , O), S (MH, 1) S (M H , 2 w -1)}.
Une autre convention qui décompose le mot M peut également être envisagée, par exemple sélectionner le mot machine à partir des bits centraux de M et sélectionner le sous-mot à partir de bits extrêmes de M (par exemple les deux bits de poids fort et le bit de poids faible).Another convention which breaks down the word M can also be envisaged, for example selecting the word machine from the central bits of M and selecting the subword from extreme bits of M (for example the two most significant bits and the least significant bit).
Au vu de ce qui précède, on peut calculer le mot machine Smachine(MH) de manière sécurisée en appliquant les algorithmes, évoqués ci- dessus en lien avec les figures 4 à 7, aux parties de poids fort de M' et de son masque X.In view of the foregoing, the machine word Sm ach in e (M H ) can be calculated in a secure manner by applying the algorithms mentioned above in connection with FIGS. 4 to 7 to the most significant parts of M '. and his mask X.
On récupère ainsi Smachine(MH) éventuellement masqué, en fonction de MVI,H, AH OU XH (éventuellement XI,H et X2,H lors du double masquage) (l'indice H représentant les m-w bits les plus significatifs). Sans masquage de sortie, on récupère SmaChine(MH).Thus recovered my S c h ine (MH) optionally masked, depending on MVI H, AH OR NMR (optionally XI, H and X 2, H at the double masking) (index M representing the most bits mw significant). Without output masking, S maC hine (MH) is recovered.
Avec un masquage de sortie simple à l'aide du masque Z, on récupère Smachine(MH)ΘZ (Z de longueur m-w).With a simple exit masking using the mask Z, we recover S mach in e (M H ) ΘZ (Z of length mw).
Avec un masquage de sortie double à l'aide des masques Zi et Z2, on récupère Smachine(MH)©ZiθZ2 (Zi et Z2 de longueur m-w). Des ordres de masquage supérieurs peuvent également être envisagés sans complexifier les mécanismes décrits par la suite.With a double output masking using the Zi and Z 2 masks, recovering S mach ine (MH) © ZiθZ2 (Zi and Z 2 length mw). Higher masking orders can also be envisaged without complicating the mechanisms described below.
De l'autre côté, on dispose de M'M.L, XL (éventuellement XI,L et X2,L lors du double masquage) qui correspondent aux bits d'identification du mot de sortie à l'intérieur du mot machine SmaChjne(MH), éventuellement masqué. On décrit maintenant, en référence aux figures 9 à 11, différents mécanismes permettant d'extraire efficacement, et éventuellement en toute sécurité eu égard aux degrés de masquage, le sous-mot (donc le mot de sortie) d'indice MM, L du mot machine Smachine(MH) éventuellement masqué en sortie, à partir de l'indice masqué M'M.L et des masques AL ou XL et éventuellement X1 ,L et X2lL.On the other side, we have M'ML, XL (possibly XI, L and X 2 , L during the double masking) which correspond to the bits of identification of the output word inside the machine word S maCh j n e (M H ), possibly masked. Referring now to FIGS. 9 to 11, various mechanisms are described for extracting the subword (and thus the output word) efficiently and possibly safely with respect to the degrees of masking. of index MM, L of the machine word Sma ch ine (M H ) possibly masked at the output, from the masked index M'ML and masks A L or XL and possibly X 1 , L and X 2lL .
Pour simplifier la notation, on note désormais U (ou U1 si masqué) le mot machine, j' l'indice masqué, η (η1 et η2) les masques de l'indice, ru (ru1 et ru2) les masques de sorties masquant éventuellement le mot machine U'. On cherche désormais à extraire le sous-mot U(j) à partir de j' et des masques de j1 (ou extraire U'(j) et les masques de sorties correspondant notés su (su1 et su2)), c'est-à-dire sans manipuler j pour des questions de sécurité. Ces différents mécanismes concernent généralement l'accès à un sous-mot d'indice j dans un mot binaire (U, U') formé de 2W sous-mots (U(O), ..., U(2W-1)} à partir de l'indice binaire j' masqué par un masque binaire correspondant rj, comprenant i) une étape de séparation dudit mot (U, U') en deux moitiés (H0(U), Hh(U), UH, UL) respectivement des bits les plus significatifs et des bits les moins significatifs, ii) au moins une étape de sélection d'une moitié dudit mot (U, U') en fonction des valeurs des bits d'un même index dans respectivement l'indice j' et le masque Tj. En effet, on remarque que selon la valeur du bit de poids fort de j, le sous-mot auquel on veut accéder est soit dans la partie gauche (c'est-à-dire de poids fort), soit dans la partie droite (c'est-à-dire de poids faible) de U. Ainsi, en combinant l'utilisation des bits respectifs de l'indice masqué et de son masque (c'est-à-dire des bits contribuant à obtenir le bit correspondant de l'indice j non masqué), on sélectionne efficacement la partie du mot d'intérêt, sans manipuler l'indice j non masqué.To simplify the notation, we now write U (or U 1 if masked) the machine word, the masked index, η (η1 and η2) the masks of the index, r u (r u 1 and r u 2 ) the output masks possibly masking the machine word U '. We now try to extract the subword U (j) from j 'and the masks of j 1 (or extract U' (j) and the corresponding output masks noted s u (s u 1 and s u 2) ), that is, without manipulating j for security reasons. These different mechanisms generally concern the access to a subword of index j in a binary word (U, U ') formed of 2 W subwords (U (O), ..., U (2 W -1 )} from the binary index j 'masked by a corresponding binary mask r j , comprising i) a step of separating said word (U, U') into two halves (H 0 (U), Hh (U), U H , UL) respectively of the most significant bits and the least significant bits, ii) at least one step of selecting one half of said word (U, U ') as a function of the values of the bits of the same index in respectively the index j 'and the mask T j . Indeed, we notice that according to the value of the most significant bit of j, the subword that we want to access is either in the left part (that is to say of high weight), or in the right part ( that is, low weight) of U. Thus, by combining the use of the respective bits of the masked index and its mask (i.e. bits contributing to obtain the corresponding bit of the index j not masked), we effectively select the part of the word of interest, without manipulating the index j unmasked.
En particulier, on choisira des sous-mots de même longueur. On illustre une première réalisation de ces mécanismes à l'aide du mot U=1010011101101101 composé de 8 sous-mots d'indice allant de 000 (sous-mot de poids fort - à gauche) à 111 (sous-mot de poids faible - à droite), en s'appuyant sur la figure 9. Plus précisément, on souhaite accéder au sous- mot dont l'indice masqué j' vaut 101 et son masque η 111 (on rappelle j'≈jθη). On remarque que j=101θ111=010, donc on souhaite accéder au sous-mot 01 composé des 5è et 6è bits de U en partant de la gauche.In particular, we will choose subwords of the same length. A first embodiment of these mechanisms is illustrated using the word U = 1010011101101101 composed of 8 subwords of index ranging from 000 (heavy-weight sub-word - left) to 111 (sub-word of low weight - right), based on Figure 9. More specifically, we want to access the subword whose masked index j 'is 101 and its mask η 111 (we remind I≈jθη). Note that j = 101θ111 = 010, so we want to access the subword 01 composed of the 5th and 6th bits of U from the left.
Cette réalisation met en oeuvre les étapes algorithmiques suivantes: for k=0 to w- 1 (Ro, Ri) <- U swapj.[k](Ro, Ri) swaprjtk](Ro, Ri) U ^ R0 return R0 où R0 et Ri sont deux registres de longueur au moins égale à la demi-longueur de U, ici au moins 8 bits, et swapb(Ro, Ri) est une fonction qui intervertit le contenu des deux registres lorsque b=0:This realization implements the following algorithmic steps: for k = 0 to w- 1 (Ro, Ri) <- U swapj. [k] (Ro, Ri) swaprj t k] (Ro, Ri) U ^ R 0 return R 0 where R 0 and Ri are two registers of length at least equal to the half-length of U, in this case at least 8 bits , and swapb (Ro, Ri) is a function that reverses the contents of both registers when b = 0:
, v f NOP si b = 0 ^^'^ {swapiRM si b = l -, v f NOP if b = 0 ^^ '^ {swapiRM if b = l -
Une telle fonction swapb peut être mise en œuvre par les étapes suivantes: tmp <— Ri Rb <— Ro RΈ <- tmpSuch a swap function b can be implemented by the following steps: tmp <- Ri Rb <- Ro R Έ <- tmp
En alternative, swapb peut être mise en œuvre à l'aide de la fonction Rotate(R.x) qui effectue une rotation de R sur x bits à droite ou à gauche, par swapb(Ro, Ri)=Rotate((R0, Ri), l+b.l) où I est la longueur des registres. Ici, on utilisera un seul registre R composé des deux parties égales Ro et Ri, afin que le décalage de bits décale potentiellement les bits d'une partie du registre R à l'autre.Alternatively, swap b can be implemented using the Rotate function (Rx) which rotates R on x bits to the right or to the left, by swapb (Ro, Ri) = Rotate ((R 0 , Ri), l + bl) where I is the length of the registers. Here, we will use a single register R composed of two equal parts Ro and Ri, so that the bit shift potentially shifts the bits from one part of the register R to the other.
En alternative à l'utilisation de deux registres, il est possible d'utiliser un registre double (longueur 2I1 ici au moins 16 bits) constitué de deux parties. A l'étape E600, on initialise un compteur k à 0. A l'étape E602, on affecte aux deux registres R0 et Ri, respectivement UH (10100111) et UL (01101101).As an alternative to using two registers, it is possible to use a double register (length 2I 1 here at least 16 bits) consisting of two parts. In step E600, a counter k is initialized to 0. In step E602, the two registers R 0 and R 1 , U H (10100111) and U L (01101101) are assigned.
A l'étape E604, on applique la fonction swapb en fonction du bit le plus significatif de l'indice j'={j'[O], j'[1], ... , j'[w-1]}: JTk=O]=I Ici, on intervertit alors les deux registres: Ro = 01101101 et Ri = 10100111.In step E604, the swap function b is applied as a function of the most significant bit of the index j '= {j' [O], j '[1], ..., j' [w-1] }: JTk = O] = I Here, we then interchange the two registers: Ro = 01101101 and Ri = 10100111.
A l'étape E606, on applique de nouveau la fonction swapb en fonction du bit de même index k, donc le plus significatif, du masque η: rj[k=0]=1. Ici, on intervertit alors les deux registres: Ro = 10100111 et Ri =In step E606, the swap function b is again applied as a function of the bit of the same index k, and therefore the most significant of the mask η: rj [k = 0] = 1. Here, we then interchange the two registers: Ro = 10100111 and Ri =
01101101.01101101.
A l'étape E608, on remplace la valeur de U par le contenu du registreIn step E608, the value of U is replaced by the contents of the register
R0.R 0 .
A l'étape E610, on incrémente la valeur d'itération k: k=1. A l'étape E612, on compare k avec w (ici w=3). Comme k<3, on retourne à l'étape E602 en répartissant la nouvelle valeur de U dans les deux registres: R0 = 1010 et Ri = 0111.In step E610, the iteration value k: k = 1 is incremented. In step E612, compare k with w (here w = 3). As k <3, return to step E602 by distributing the new value of U in the two registers: R 0 = 1010 and Ri = 0111.
Comme j'[k=1]=0 et η[k=1]=1 , on effectue une seule permutation des deux registres lors de l'étape E606: R0 = 0111 et R1 = 1010. On conserve ainsi à l'étape E608, U=0111.Since j '[k = 1] = 0 and η [k = 1] = 1, a single permutation of the two registers is performed during step E606: R 0 = 0111 and R 1 = 1010. step E608, U = 0111.
A l'étape E612, k=2, donc on retourne à l'étape E602. L'itération k=2 mène à Ro = 01 et Ri = 11 car deux permutations ont été effectuées aux étapes E604 et E606.At step E612, k = 2, so return to step E602. The iteration k = 2 leads to Ro = 01 and Ri = 11 because two permutations were carried out at steps E604 and E606.
A l'étape E612, k=3=w, donc on passe à l'étape E614 par laquelle on retourne U=01. On obtient bien le sous-mot attendu.At step E612, k = 3 = w, so we go to step E614 by which we return U = 01. We obtain the subword expected.
On remarque qu'à chaque itération, la taille de U diminue de moitié et on converge ainsi par dichotomie vers le sous-mot souhaité.Note that at each iteration, the size of U decreases by half and thus converges by dichotomy to the desired subword.
La sécurité de ce mécanisme est assurée par l'application des fonctions de permutation (inversion des deux registres) à toutes les itérations (avec des paramètres différents) même si aucune permutation n'en découle.The security of this mechanism is ensured by the application of the permutation functions (inversion of the two registers) to all the iterations (with different parameters) even if no permutation results from it.
D'une façon générale, l'opération de permutation (swap) telle qu'envisagée ci-dessus confère, lorsqu'elle est utilisée de façon conditionnelle, un degré de sécurité élevé lorsqu'il s'agit d'identifier (par exemple pour sélection ou isolation) un élément parmi deux. A ce titre, il pourra être envisagé une protection de cette approche indépendante des autres enseignements décrits dans la présente demande. On peut noter qu'en utilisant une indexation de j1 (et de ses masques) non plus de gauche à droite mais de droite à gauche, il y a lieu de procéder à une permutation (swap) supplémentaire à l'intérieur de chacune des itérations k. Afin de fournir une protection d'ordre 1 de masquage des données, le mode de réalisation décrit ci-dessus peut être étendu à la donnée U1 masquée à l'aide d'un masque aléatoire ru. Dans ce cas, on cherche à déterminer non seulement le sous-mot de U1 (comme décrit ci-dessus) qui convient mais également le sous-mot de ru correspondant. L'accès au sous-mot ru(j) à partir du mot machine ru est similaire au mécanisme ci-dessus.In general terms, the swap operation as envisaged above, when used conditionally, gives a high degree of security when it comes to identifying (for example, selection or isolation) one of two. As such, it may be envisaged protection of this approach independent of the other teachings described in this application. It can be noted that by using an indexation of j 1 (and its masks) not from left to right but from right to left, it is necessary to proceed to an additional swap within each of iterations k. In order to provide first order data masking protection, the embodiment described above can be extended to the masked data U 1 by means of a random mask r u . In this case, it is desired to determine not only the subword of U 1 (as described above) which is suitable but also the sub-word corresponding r u . The access to the sub word r u (j) from the machine word r u is similar to the mechanism above.
Dans chacune des itérations k, on réalise juste après l'étape E608, des étapes E602', E604', E6061 et E608' appliquées au masque ru, similaires à celles de numéro correspondant E602, E604, E606 et E608. L'algorithme proposé ci-dessus, devient alors: for k=0 to w-1 (R0, Ri) «- U' swapj.[k](Ro, Ri) swaprj[k](Ro, Ri) U' *- R0 In each of the iterations k, steps E602 ', E604', E606 1 and E608 'applied to the mask r u , similar to those of the corresponding number E602, E604, E606 and E608, are carried out just after step E608. The algorithm proposed above then becomes: for k = 0 to w-1 (R 0 , Ri) "- U 'swapj. [k] (Ro, Ri) swap rj [k] (Ro, Ri) U '* - R 0
(Ro, R-i ) <— ru swapj.[k](R0, Ri) swaprj[k](Ro, Ri) I-U <— Ro return (U', ru)(Ro, Ri) <- r u swapj. [k] (R 0 , Ri) swap rj [k] (Ro, Ri) IU <- Ro return (U ', r u )
On obtient en fin d'algorithme (étape E614) les valeurs U' et ru correspondant aux sous-mots recherchés, telles que U' = U θ ru, où U est la valeur de sortie (de la boîte S) non masquée.At the end of the algorithm (step E614), the values U 'and r u corresponding to the desired subwords are obtained, such that U' = U θ r u , where U is the output value (of the box S) which is not masked. .
On décrit maintenant en référence à la figure 10, une réalisation plus sécurisée mettant en œuvre un double masquage des valeurs, aussi bien pour l'indice j' (masques η1 et η2) que pour le mot U' (masques ru1 et ru2), par exemple résultant de l'étape E414 ci-dessus appliquée à la détermination de Smachine(MH). Ces doubles masquages peuvent bien sûr être appliqués indépendamment.With reference to FIG. 10, a more secure embodiment implementing a double masking of the values, both for the index j '(masks η1 and η2) and for the word U' (masks r u 1 and r, is described with reference to FIG. u 2), by example resulting from step E414 above applied to the determination of Smac h in e (M H ). These double masks can of course be applied independently.
Cette réalisation diffère, de celle de la figure 9, en substance par l'application de la fonction swap trois fois en fonction de bits correspondant dans l'indice j' et dans chacun des deux masques η1 et η-2 (on s'aperçoit donc que l'invention peut être étendue sans difficulté à des ordres supérieurs de masquage en effectuant un nombre de permutations égal à 1 + nombre de masques de j) et par la détermination des sous-mots dans le mot U1 et dans chacun des masques ru1 et ru2 de U. Pour une homogénéité de sécurité, il convient de choisir un même degré de masquage de l'indice j et du mot binaireThis embodiment differs from that of FIG. 9 in substance by the application of the swap function three times as a function of corresponding bits in the index j 'and in each of the two masks η1 and η-2 (it can be seen that so that the invention can be extended without difficulty to higher masking orders by performing a number of permutations equal to 1 + number of masks of j) and by the determination of the subwords in the word U 1 and in each of the masks r u 1 and r u 2 of U. For a homogeneity of safety, it is advisable to choose the same degree of masking of the index j and the binary word
U.U.
Les étapes E700 à E704 ne diffèrent pas des étapes E600 à E604.Steps E700 to E704 do not differ from steps E600 to E604.
Puisque l'on a deux masques d'indice η1 et η2, on effectue deux permutations conditionnelles aux étapes E706 et E708, indexées respectivement sur les deux bits correspondants des deux masques Tj1[k] et η2[k].Since two masks of index η1 and η2 are used, two conditional permutations are carried out in steps E706 and E708 respectively indexed on the two corresponding bits of the two masks T j 1 [k] and η2 [k].
L'étape E710 est la même que l'étape E608 ci-dessus.Step E710 is the same as Step E608 above.
Dans la même itération, on calcule de façon similaire les deux parties de masques ru1 et ru2 correspondant, aux étapes E702' à E710' et E702" à E710".In the same iteration, the two mask portions r u 1 and r u 2 corresponding to steps E702 'to E710' and E702 "to E710" are similarly calculated.
A l'étape E712, on incrémente k de sorte à former w itérations (comparaison à l'étape E714).In step E712, k is incremented to form w iterations (comparison at step E714).
A l'étape E716, on retourne U', ru1 et ru2 représentant les sous-mots souhaités (donc valeurs de sortie de la table S) des mots initiaux. Ces trois valeurs vérifient: U' = U ® ru1 Θ ru2.In step E716, U 'is returned, r u 1 and r u 2 representing the desired subwords (hence output values of the table S) of the initial words. These three values satisfy: U '= U ® r u 1 Θ r u 2.
Afin d'accroître encore plus la sécurité, notamment en évitant d'utiliser les variables intermédiaires U' et U'(j) qui constituent une faiblesse potentielle du fait de la dépendance à l'indice j, on propose le mécanisme suivant en référence à la figure 11. Bien que décrit à l'aide d'un double masquage, le mécanisme s'applique à un simple masquage voire en l'absence de masquage du mot U.In order to further increase security, in particular by avoiding the use of intermediate variables U 'and U' (j), which are a potential weakness due to index dependence j, the following mechanism is proposed with reference to Figure 11. Although described using double masking, the mechanism applies to simple masking or even the absence of masking of the word U.
On définit tout d'abord les deux fonctions Ho(y) et H-ι(y) qui retournent respectivement la moitié des bits les plus significatifs de y et la moitié des bits les moins significatifs de y. Ces deux fonctions sont aisément réalisables à l'aide de la fonction swapb évoquée ci-dessus, par exemple comme suit:We first define the two functions Ho (y) and H-ι (y) which respectively return half of the most significant bits of y and half of the least significant bits of y. These two functions are easily achievable using the swap function b evoked above, for example as follows:
Hb(y) : (Ro, Ri) <- y swapb(Ro, Ri) return RoH b (y): (Ro, Ri) <- y swap b (Ro, Ri) return Ro
Le mécanisme d'accès au sous-mot d'indice j peut être mis en œuvre à l'aide des instructions suivantes: for k=0 to w-1The mechanism for accessing the subword of index j can be implemented using the following instructions: for k = 0 to w-1
(U', ru1 , ru2) <- Select (2w"1-kn, (U', ru1 , ru2), (j'[w-k], ηifw-k], η2[w-k])) return (U', ru1 , ru2) où la fonction Select reçoit en paramètre une dimension long (2w"1"kn représentant la taille d'une moitié de mot U', ru1 et ru2 que l'on souhaite récupérer en fin d'itération considérée), un premier 3-uplet d'un mot masqué et des deux masques associés, et un deuxième 3-uplet d'un bit masqué (ici le bit d'index w-k de l'indice j) et des deux masques associés, et retourne un 3-uplet (U1, ru1 , ru2) vérifiant U1 Θ ru1 θ ru2 = Hj[w.k](U).(U ', r u 1, r u 2) <- Select (2 w "1 - k n, (U', r u 1, r u 2), (j '[wk], ηifw-k], η2 [wk])) return (U ', r u 1, r u 2) where the function Select receives in parameter a long dimension (2 w "1" k n representing the size of a word half U', r u 1 and r u 2 which one wishes to recover at the end of the iteration considered), a first 3-tuple of a masked word and the two associated masks, and a second 3-tuple of a masked bit (here the bit index wk of the index j) and the two associated masks, and returns a 3-tuplet (U 1 , r u 1, r u 2) satisfying U 1 Θ r u 1 θ r u 2 = H j [w k] (U).
On voit ainsi qu'en itérant cette fonction pour chacun des bits composant l'indice j, on isole successivement les moitiés du mot correspondant aux différents bits de l'indice j pour aboutir au sous-mot de U' d'indice j accompagné des sous-mot des masques correspondants.It is thus seen that, by iterating this function for each of the bits composing the index j, the halves of the word corresponding to the different bits of the index j are successively isolated to arrive at the subword of U 'of index j accompanied by subword of the corresponding masks.
On note également que l'application de ce mécanisme à un masquage simple fait intervenir des 2-uplet et non plus des 3-uplet (extensible également à q masques et des q-uplets).We also note that the application of this mechanism to simple masking involves 2-tuple and not 3-tuple (also expandable q masks and q-tuples).
A l'étape E800, on initialise une valeur d'itération k à 0. Les étapes E802 à E820 illustrent un exemple de réalisation de la fonction Select. A l'étape E802, on génère deux masques aléatoires de longueur /0A7£F2w-1-kn.In step E800, an iteration value k is initialized to 0. The steps E802 to E820 illustrate an embodiment of the Select function. In step E802, two random masks of length / 0A7 £ F2 w - 1 - k n are generated.
A l'étape E804, on génère un booléen b aléatoire.In step E804, a random boolean b is generated.
A l'étape E806, on calcule un bit masqué à partir du booléen b et des bits d'index k (en partant du bit de poids le plus fort au bit de poids le plus faible au fur et à mesure des itérations) dans respectivement les deux masques de l'indice j': b' <- (rj1[w-k] θ b) θ rj2[w-k]In step E806, a masked bit is calculated from the boolean b and the index bits k (starting from the most significant bit to the least significant bit as iterations occur) in respectively the two masks of the index j ': b'<- (r j 1 [wk] θ b) θ r j 2 [wk]
Dans cette étape, on veille à réaliser les opérations XOR dans l'ordre des parenthèses, à savoir d'abord η1[w-k] θ b, puis l'addition du résultat avec le booléen η2[w-k]. En effet, en respectant cet ordre, on garantit une protection contre les attaques d'ordre 2 puisque l'on ne manipule pas directement la valeur η1[w-k] ® rj2[w-k] qui pourrait être vue comme un simple masque ne protégeant le bit j[w-k] que par un masquage d'ordre 1.In this step, care is taken to perform the XOR operations in the order of the parentheses, namely first η1 [wk] θ b, then the addition of the result with the boolean η2 [wk]. Indeed, by respecting this order, one guarantees a protection against the attacks of order 2 since one does not handle directly the value η1 [wk] ® r j 2 [wk] which could be seen like a simple mask not protecting the bit j [wk] only by a masking of order 1.
Pour les étapes suivantes E808 à E818 (qui peuvent être interverties entre elles car indépendantes), on utilise trois paires de registres adressables, ci-après notés A0, Ai (affectés au mot U), Bo, Bi (affectés au premier masque de U), C0 et Ci (affectés au deuxième masque de U).For the following steps E808 to E818 (which can be interchanged with each other as independent), three pairs of addressable registers, hereinafter referred to as A 0 , Ai (assigned to the word U), Bo, Bi (assigned to the first mask of U), C 0 and Ci (assigned to the second mask of U).
On affecte successivement:We successively assign:
- au registre A indexé par b1 calculé à l'étape E806, la partie Hj'[w-k](U') masqué par un (ti) des masques aléatoires générés à l'étape E802:at the register A indexed by b 1 calculated in step E806, the portion Hj ' [wk ] (U') masked by one (ti) of the random masks generated in step E802:
Ab' <- Hj.tw.k](U') θ tiA b ' <- Hj. tw . k] (U ') θ ti
- à l'autre registre A, l'autre partie de U1 masquée par le même masque.at the other register A, the other part of U 1 masked by the same mask.
On procède de même pour les deux masques ru1 et ru2, qui utilisent respectivement l'autre masque t2 et la combinaison des deux masques t| et t.2, et sont stockés par paire respectivement dans B0, B1, C0 et C-|.The same is true for the two masks r u 1 and r u 2, which use respectively the other mask t 2 and the combination of the two masks t | and t.2, and are stored in pairs in B 0 , B 1 , C 0 and C 1 respectively .
A ce stade, on pourrait démontrer que pour l'index 'w-Zc1 ci-dessus, quelles que soient les valeurs des deux masques η1 [w-k] et η2[w-k], on a:At this stage, we could prove that for the index 'w-Zc 1 above, whatever the values of the two masks η1 [wk] and η2 [wk], we have:
(Ab, Bb, Cb) = (Hj[W-K](U') θ ti, Hj[w.k](ru1) φ t2, Hj[w-k](ru2) Φ tiΦ t2)(A b , B b , Cb) = (Hj [ WK ] (U ') θ ti, H j [w.k ] (r u 1) φ t 2 , H j [wk] (r u 2) Φ tiΦ t 2 )
( vAr b3' ïï b,' Cïï b) ' = (
Figure imgf000031_0001
vH— j[w-k] ( vU') ' et les valeurs stockées dans les registres vérifient:
( v Ar b3 ' ïï b,' C ïï b) '= (
Figure imgf000031_0001
v H-j [wk] ( v U ')' and the values stored in the registers verify:
Ab Φ Bb θ Cb = Hj[w-k](U). Du fait de l'indépendance de ces valeurs à celles de x{\ et η2, on obtient une indépendance par rapport à l'indice j, et donc une sécurité accrue.A b Φ B b θ C b = H j [wk] (U). Due to the independence of these values from those of x {\ and η2, independence is obtained with respect to the index j, and thus increased security.
Ainsi à l'étape E820, on substitue (Ab, Bb, Cb) aux valeurs précédentes (U', ru1 , ru2). On incrémente ensuite k, à l'étape E822.Thus, in step E820, substitute (A b , B b , C b ) for the preceding values (U ', r u 1, r u 2). Then, k is incremented at step E822.
On compare k et w pour déterminer si on met fin aux itérations, à l'étape E824 (similaire aux étapes E612 et E714 ci-dessus, avec retour à l'étape E802 pour une nouvelle itération).Compare k and w to determine if the iterations are terminated in step E824 (similar to steps E612 and E714 above, with return to step E802 for a new iteration).
A la fin des itérations (étape E826), on retourne (U', ru1 , ru2) qui correspondent respectivement au sous-mot masqué recherché et aux deux sous-mots de masques qui permettent de démasquer le sous-mot U' obtenu: U' θ ru1 θ ru2 = U.At the end of the iterations (step E826), we return (U ', r u 1, r u 2) which respectively correspond to the hidden subword searched and to the two subwords of masks which make it possible to unmask the subword U obtained: U 'θ r u 1 θ r u 2 = U.
L'utilisation des paramètres aléatoires ti, t2 et b n'est pas indispensable. Elle fournit néanmoins un gage de sécurité de l'algorithme car permet, d'une part, de protéger les valeurs manipulées par un double masquage (t| et t2, que l'on peut réduire à un simple masquage si nécessaire) et d'autre part, d'attribuer le résultat souhaité arbitrairement dans l'un ou l'autre des deux registres indexés sur b. En l'absence de b, on retourne à l'étape E826The use of the random parameters ti, t 2 and b is not essential. It nevertheless provides a guarantee of security of the algorithm because, on the one hand, it protects the values manipulated by a double mask (t | and t 2 , which can be reduced to a simple mask if necessary) and on the other hand, to assign the desired result arbitrarily in one or other of the two registers indexed on b. In the absence of b, return to step E826
A0, B0 et C0. En l'absence de ti et t.2, le paramètre long n'est pas nécessaire dans la fonction Select indiqué ci-dessus.A 0 , B 0 and C 0 . In the absence of ti and t. 2 , the long parameter is not necessary in the Select function shown above.
Dans les mécanismes ci-dessus en lien avec les figures 9 à 11 , les valeurs j'[k], rj[k], η1[k] et η2[k] jouent des rôles symétriques de telle sorte qu'il est envisageable d'intervertir leurs positions dans ces mécanismes, par exemple le valeur b' à l'étape E806 peut utiliser j' au lieu du masque η1 et les fonctions H des étapes E808 et E814 sont alors indexées par le masque η1.In the above mechanisms in connection with FIGS. 9 to 11, the values j '[k], rj [k], η1 [k] and η2 [k] play symmetrical roles so that it is possible to envisage to invert their positions in these mechanisms, for example the value b 'at the step E806 can use j' instead of the mask η1 and the functions H of the steps E808 and E814 are then indexed by the mask η1.
Grâce à ces mécanismes, on accède de façon sécurisé à sous-mot d'un mot notamment masqué, composé d'une pluralité de sous-mots, à l'aide d'un indice également masqué.Thanks to these mechanisms, we securely access a subword of a particular word masked, consisting of a plurality of subwords, using an index also masked.
Les exemples qui précèdent ne sont que des modes de réalisation de l'invention qui ne s'y limite pas. The foregoing examples are only embodiments of the invention which is not limited thereto.

Claims

REVENDICATIONS
1. Procédé d'accès à un sous-mot d'indice j dans un mot binaire (U,1. Method for accessing a subword of index j in a binary word (U,
U') formé de 2W sous-mots (U(O), ... , U(2W-1)} à partir d'un indice binaire masqué (j1) par un masque binaire correspondant (η), comprenant i) une étape de séparation dudit mot (U, U1) en deux moitiés (H0(U), H1(U), UH, UL) respectivement des bits les plus significatifs et des bits les moins significatifs, ii) une étape de sélection d'une desdites moitiés dudit mot (U, U') en fonction des valeurs des bits d'un même index dans respectivement l'indice masqué (j1) et le masque correspondant (η, η1 , x{λ).U ') formed of 2 W subwords (U (O), ..., U (2 W -1)} from a masked binary index (j 1 ) by a corresponding binary mask (η), comprising i) a step of separating said word (U, U 1 ) into two halves (H 0 (U), H 1 (U), UH, U L ) respectively of the most significant bits and least significant bits, ii) a step of selecting one of said halves of said word (U, U ') as a function of the values of the bits of the same index in respectively the masked index (j 1 ) and the corresponding mask (η, η1, x {λ ).
2. Procédé selon la revendication 1 , dans lequel l'étape de séparation i) comprend le stockage dudit mot (U, U') dans deux registres (R0,The method according to claim 1, wherein the step of separating i) comprises storing said word (U, U ') in two registers (R 0 ,
Ri1 Ao1 A1).Ri 1 Ao 1 A 1 ).
3. Procédé selon l'une des revendications précédentes, comprenant une pluralité d'itérations des étapes i) et ii), et dans lequel chaque itération comprend après l'étape ii), une étape iii) de substitution dudit mot binaire (U, U') par ladite moitié binaire sélectionnée à l'étape ii).3. Method according to one of the preceding claims, comprising a plurality of iterations of steps i) and ii), and wherein each iteration comprises after step ii), a step iii) of substituting said binary word (U, U ') by said binary half selected in step ii).
4. Procédé selon la revendication précédente, comprenant w itérations pour successivement l'ensemble des w index de bits desdits indice masqué (j1) et masque correspondant (rj, ηl, η2).4. Method according to the preceding claim, comprising w iterations for successively the set of w bit indexes of said masked index (j 1 ) and corresponding mask (rj, ηl, η2).
5. Procédé selon l'une des revendications 3 et 4, dans lequel on retourne ledit mot binaire substitué (U, U') à la fin de l'ensemble des itérations.5. Method according to one of claims 3 and 4, wherein said substituted binary word (U, U ') is returned at the end of all the iterations.
6. Procédé selon l'une des revendications précédentes, dans lequel ledit mot binaire (U') est masqué par un masque correspondant (ru, ru1 , ru2), ledit procédé comprenant j) une étape de séparation dudit masque (ru, ru1 , ru2) correspondant au mot (U') en deux moitiés (H0(ru), H1(^)) respectivement des bits les plus significatifs et des bits les moins significatifs, jj) au moins une étape de sélection d'une desdites moitiés dudit masque (rUl ru1 , ru2) correspondant au mot (U1) en fonction des valeurs des bits d'un même index dans respectivement l'indice masqué (j1) et le masque correspondant (η, η1 , η2), lesdits index des étapes ii) et jj) étant identiques.6. Method according to one of the preceding claims, wherein said binary word (U ') is masked by a corresponding mask (r u , r u 1, r u 2), said method comprising j) a step of separating said mask (r u , r u 1, r u 2) corresponding to the word (U ') in two halves (H 0 (r u ), H 1 (^)) respectively the most significant bits and the least significant bits, dd) at least one step of selecting one of said halves of said mask (Ul r r u 1, u 2 r) corresponding to the word (U 1) according to the bit values of the same index in respectively the hidden index (j 1 ) and the corresponding mask (η, η1, η2), said indexes of steps ii) and jj) being identical.
7. Procédé selon la revendication précédente en dépendance d'une des revendications 3 à 5, dans lequel les étapes j) et jj) sont effectuées à chaque itération, et chaque itération comprend après l'étape jj), une étape jjj) de substitution dudit masque (ru, ru1 , ru2) correspondant au mot (U') par ladite moitié sélectionnée à l'étape jj).7. Method according to the preceding claim in dependence on one of claims 3 to 5, wherein the steps j) and jj) are performed at each iteration, and each iteration comprises after step jj), a step jjj) substitution said mask (r u , r u 1, r u 2) corresponding to the word (U ') by said half selected in step jj).
8. Procédé selon la revendication précédente, dans lequel on retourne le masque substitué (ru, ru1 , ru2) correspondant au mot (U') à la fin de l'ensemble des itérations.8. Method according to the preceding claim, wherein we return the substituted mask (r u , r u 1, r u 2) corresponding to the word (U ') at the end of all the iterations.
9. Procédé selon l'une des revendications 6 à 8, dans lequel l'étape de séparation j) comprend le stockage dudit masque (ru, ru1 , ru2) correspondant au mot (U') dans deux registres (R0, Ri, B0, Bi1 C0, Ci).9. Method according to one of claims 6 to 8, wherein the separation step j) comprises storing said mask (r u , r u 1, r u 2) corresponding to the word (U ') in two registers ( R 0 , R 1 , B 0 , Bi 1 C 0 , Ci).
10. Procédé selon l'une des revendications précédentes, dans lequel lesdits masques (η, ru) sont composés d'au moins deux sous-masques (ηi, rui,10. Method according to one of the preceding claims, wherein said masks (η, r u ) are composed of at least two sub-masks (ηi, r u i,
11. Procédé selon la revendication précédente dans lequel ladite sélection de l'étape ii) est également fonction des bits d'un même index dans respectivement les deux sous-masques (η1 , η2) correspondant à l'indice masqué (j1).11. Method according to the preceding claim wherein said selection of step ii) is also a function of the bits of the same index in respectively the two sub-masks (η1, η2) corresponding to the masked index (j 1 ).
12. Procédé selon la revendication 10 ou 11 en dépendance de la revendication 6, dans lequel ladite sélection de l'étape jj) est également fonction des bits d'un même index dans respectivement les deux sous-masques (η1 , η2) correspondant à l'indice masqué (]')•12. The method of claim 10 or 11 in dependence on claim 6, wherein said selection of step jj) is also a function of the bits of the same index in respectively the two sub-masks (η1, η2) corresponding to the masked index (] ') •
13. Procédé selon l'une des revendications 10 à 12, en dépendance de la revendication 6, dans lequel on réalise les étapes j) et jj) pour chacun des deux sous-masques (ru1 , ru2) correspondant au mot (U').13. Method according to one of claims 10 to 12, in accordance with claim 6, wherein the steps j) and jj) for each of the two sub-masks (r u 1, r u 2) corresponding to the word are carried out. (U ').
14. Procédé selon l'une des revendications 1 à 13, dans lequel ladite étape de sélection des étapes ii) et, lorsqu'elle existe, jj) comprend une étape de permutation (E604, E6041) desdites deux moitiés correspondantes en fonction dudit bit de l'indice masqué G') et une étape de permutation (E606, E606') desdites deux moitiés correspondantes en fonction dudit bit du masque (η, η1 , η2) correspondant à l'indice masqué (j1)-14. Method according to one of claims 1 to 13, wherein said step of selecting steps ii) and, when it exists, jj) comprises a step permutation (E604, E604 1 ) of said two corresponding halves according to said masked index bit G ') and a permutation step (E606, E606') of said two corresponding halves as a function of said mask bit (η, η1, η2) corresponding to the masked index (j 1 ) -
15. Procédé selon la revendication précédente, dans lequel pour k itérations allant de 0 à w-1 , successivement:15. Method according to the preceding claim, wherein for k iterations ranging from 0 to w-1, successively:
-on affecte ledit mot binaire (U, U') à deux registres (R0, Ri) où un premier registre stocke la moitié de poids fort dudit mot binaire,said binary word (U, U ') is assigned to two registers (R 0 , Ri) in which a first register stores the high-order half of said binary word,
-on permute lesdits registres conditionnellement à la valeur du k-ième bit dudit indice masqué (j'[k]),these perms are switched conditionally to the value of the k-th bit of said masked index (j '[k]),
-on permute de nouveau lesdits registres conditionnellement à la valeur du k-ième bit dudit masque correspondant à l'indice masqué (η[k]),-reverting said registers conditionally to the value of the k-th bit of said mask corresponding to the masked index (η [k]),
-on substitue ledit mot binaire (U, U') par ledit premier registre, et à la fin des itérations, on retourne ledit mot binaire substitué. substituting said binary word (U, U ') for said first register, and at the end of the iterations, returning said substituted binary word.
16. Procédé selon la revendication précédente, dans lequel ledit mot binaire (U') est masqué par un masque correspondant (ru, ru1 , ru2), et pour chaque itération k,16. Method according to the preceding claim, wherein said binary word (U ') is masked by a corresponding mask (r u , r u 1, r u 2), and for each iteration k,
-on affecte ledit masque correspondant (ru, ru1 , ru2) au mot à deux registres (Ro, R-i) où un premier registre stocke la moitié de poids fort dudit masque correspondant (ru) au mot binaire,said corresponding mask (r u , r u 1, r u 2) is assigned to the two-register word (Ro, Ri) in which a first register stores the high-order half of said corresponding mask (r u ) with the binary word,
-on permute lesdits registres conditionnellement à la valeur du k-ième bit dudit indice masqué (j'[k])> these perms are permuted conditionally to the value of the k-th bit of said masked index (j '[k]) >
-on permute de nouveau lesdits registres conditionnellement à la valeur du k-ième bit dudit masque correspondant à l'indice masqué (η[k]) -on substitue ledit masque correspondant (ru, ru1 , ru2) au mot par ledit premier registre et à la fin des itérations, on retourne ledit masque correspondant (ru, ru1 , ru2) substitué.-reverting said registers conditionally to the value of the k-th bit of said mask corresponding to the masked index (η [k]) -on substitutes said corresponding mask (r u , r u 1, r u 2) to the word by said first register and at the end of the iterations, returning said corresponding mask (r u , r u 1, r u 2) substituted.
17. Procédé selon la revendication précédente en dépendance de la revendication 10, dans lequel les permutations conditionnellement à la valeur du k-ième bit dudit masque correspondant à l'indice masqué comprennent: - une permutation des registres conditionnellement à la valeur du k-ième bit d'un premier sous-masque (η1 , η2) correspondant à l'indice masqué17. Method according to the preceding claim in dependence on claim 10, wherein the permutations conditionally to the value of the k-th bit of said mask corresponding to the masked index comprise: a permutation of the registers conditionally to the value of the k-th bit of a first sub-mask (η1, η2) corresponding to the masked index
- une permutation des registres conditionnellement à la valeur du k-ième bit du deuxième sous-masque (rj1 , η2) correspondant à l'indice masqué. a permutation of the registers conditionally to the value of the k-th bit of the second sub-mask (rj1, η2) corresponding to the masked index.
18. Procédé selon l'une des revendications 15 à 17, dans lequel les étapes de permutation conditionnelles mettent en œuvre une fonction de permutation entre le premier et un deuxième registres, ladite fonction de permutation comprenant les instructions consistant à copier le deuxième registre dans un registre tampon, à copier ledit premier registre dans l'un des deux registres fonction de ladite condition et à copier ledit registre tampon dans l'autre registre non vérifié par la condition.The method according to one of claims 15 to 17, wherein the conditional permutation steps implement a permutation function between the first and second registers, said permutation function comprising the instructions of copying the second register into a buffer register, copying said first register into one of two registers according to said condition and copying said buffer register to the other register not verified by the condition.
19. Procédé selon l'une des revendications 15 à 17, dans lequel les étapes de permutation conditionnelles mettent en œuvre une fonction de rotation: Rotate((R0, Ri), l+b.l) où (Ro, Ri) sont les deux registres formés dans un même registre de taille double, I est la longueur des premier et deuxième registres et b est un booléen fonction de ladite condition, la fonction Rotate(R, x) effectuant une rotation de R sur x bits à droite ou à gauche. 19. Method according to one of claims 15 to 17, wherein the conditional permutation steps implement a rotation function: Rotate ((R 0 , Ri), l + bl) where (Ro, Ri) are both registers formed in the same double size register, I is the length of the first and second registers and b is a boolean function of said condition, the Rotate function (R, x) rotating R on x bits to the right or to the left .
20. Procédé selon l'une des revendications 1 à 13, dans lequel l'étape de sélection ii) comprend la détermination d'une desdites moitiés en fonction du bit de l'indice masqué (j1) et son stockage dans un registre (A0, AO dépendant du bit dudit masque correspondant (rj, rj1 , η2), l'autre moitié étant stockée dans un registre complémentaire. The method according to one of claims 1 to 13, wherein the step of selecting ii) comprises determining one of said halves as a function of the bit of the masked index (j 1 ) and its storage in a register ( A 0 , AO depending on the bit of said corresponding mask (r j , rj1, η2), the other half being stored in a complementary register.
21. Procédé selon la revendication précédente, dans lequel on combine ledit bit du masque correspondant (η, rji , η2) avec un bit aléatoire (b) pour déterminer le registre de stockage desdites moitiés, et on retourne (E820) un registre fonction dudit bit aléatoire (b).21. Method according to the preceding claim, wherein said bit of the corresponding mask (η, rji, η2) is combined with a random bit (b) to determine the storage register of said halves, and returns (E820) a function register of said random bit (b).
22. Procédé selon l'une des revendications 20 et 21 , dans lequel lesdites moitiés sont masquées lors de leur stockage dans lesdits registres.22. Method according to one of claims 20 and 21, wherein said halves are masked during storage in said registers.
23. Procédé selon l'une des revendications 20 à 22 en dépendance de la revendication 6, dans lequel l'étape de sélection jj) comprend la détermination d'une desdites moitiés du masque (ru, ru1 , ru2) correspondant au mot en fonction du bit de l'indice masqué (j1) et son stockage dans un registre (B0, B1) dépendant du bit dudit masque correspondant (η, η1 , η2), l'autre moitié étant stockée dans un registre complémentaire. 23. The method according to one of claims 20 to 22 in dependence on claim 6, wherein the selection step jj) comprises the determining one of said halves of the mask (r u , r u 1, r u 2) corresponding to the word as a function of the bit of the masked index (j 1 ) and storing it in a dependent register (B 0 , B 1 ) bit of said corresponding mask (η, η1, η2), the other half being stored in a complementary register.
24. Procédé selon la revendication précédente, dans lequel ledit mot binaire (U1) est masqué par un second masque et on réalise les étapes j) et jj) pour ledit second masque (rU2), et l'étape de sélection jj) pour le second masque correspondant au mot comprend la détermination d'une desdites moitiés du second masque (rU2) correspondant au mot en fonction du bit de l'indice masqué (j1) et son stockage dans un registre (C0, Ci) dépendant du bit dudit masque correspondant (η), l'autre moitié étant stockée dans un registre complémentaire.24. Method according to the preceding claim, wherein said binary word (U 1 ) is masked by a second mask and steps j) and jj) are performed for said second mask (r U2 ), and the selection step jj). for the second mask corresponding to the word comprises the determination of one of said halves of the second mask (r U2 ) corresponding to the word as a function of the bit of the masked index (j 1 ) and its storage in a register (C 0 , Ci) depending on the bit of said corresponding mask (η), the other half being stored in a complementary register.
25. Procédé selon l'une des revendications 15 à 24, dans lequel lesdits registres (R0, Ri, A0, A-i, B0, B-i, C0, C-i) sont des registres d'un microcontrôleur sécurisé (2).25. Method according to one of claims 15 to 24, wherein said registers (R 0 , Ri, A 0 , Ai, B 0 , Bi, C 0 , Ci) are registers of a secure microcontroller (2).
26. Procédé selon l'une quelconque des revendications précédentes, dans lequel les masques sont des masques additifs.26. A method according to any one of the preceding claims, wherein the masks are additive masks.
27. Procédé selon la revendication précédente, dans lequel les masques sont des masques booléens. 27. Method according to the preceding claim, wherein the masks are Boolean masks.
28. Procédé selon l'une des revendications précédentes, mis en œuvre par une séquence d'instructions mémorisées dans une entité électronique (10) et exécutées par un microprocesseur (2) de l'entité électronique.28. Method according to one of the preceding claims, implemented by a sequence of instructions stored in an electronic entity (10) and executed by a microprocessor (2) of the electronic entity.
29. Procédé selon la revendication précédente, dans lequel l'entité électronique (10) est une carte à microcircuit.29. The method according to the preceding claim, wherein the electronic entity (10) is a microcircuit card.
30. Procédé de calcul d'une donnée de sortie (S(M)) d'une table de conversion (table-S) à partir d'une donnée d'entrée (M') masquée par au moins un masque (X, Xi, X2), ladite table de conversion stockant une pluralité de mots composés (Smachine(MH)) chacun de 2W données de sortie, le procédé comprend: - la détermination d'un mot en fonction d'une partie (MΗ, MH) de ladite donnée d'entrée, - l'accès à une donnée de sortie composant ledit mot déterminé, l'accès étant fonction de l'autre partie (M'L) de ladite donnée d'entrée et d'une partie de masque correspondant (X L, X I,L, X 2,L) et étant selon l'une quelconque des revendications précédentes. 30. A method of calculating an output data (S (M)) of a conversion table (S-table) from an input data (M ') masked by at least one mask (X, Xi, X 2 ), said conversion table storing a plurality of compound words (S m a ch in e (M H )) each of 2 W output data, the method comprises: - determining a word as a function of a part (MΗ, MH) of said input data, access to an output datum constituting said determined word, the access being a function of the other part (M ' L ) of said input datum and of a corresponding mask part (XL, XI, L, X 2, L) and being according to any one of the preceding claims.
31. Dispositif électronique d'accès à un sous-mot d'indice j dans un mot binaire (U, U') formé de 2W sous-mots {U(0), ... , U(2W-1)} à partir d'un indice binaire masqué (j1) par un masque binaire correspondant (rj), le dispositif comprenant: i) des moyens de séparation dudit mot (U, U') en deux moitiés (H0(U), Hi(U), UH, UL) respectivement des bits les plus significatifs et des bits les moins significatifs, ii) des moyens de sélection d'une desdites moitiés dudit mot (U, U1) en fonction des valeurs des bits d'un même index dans respectivement l'indice masqué (j1) et le masque correspondant (r,, η1 , rj2). 31. Electronic device for accessing a subword of index j in a binary word (U, U ') formed of 2 W subwords {U (0), ..., U (2 W -1) } from a masked bit index (j 1 ) by a corresponding bit mask (r j ), the device comprising: i) means for separating said word (U, U ') into two halves (H 0 (U)) , Hi (U), UH, U L ) respectively the most significant bits and the least significant bits, ii) means for selecting one of said halves of said word (U, U 1 ) as a function of the values of the bits of d a same index in the masked index (j 1 ) and the corresponding mask (r ,, η1, r j 2) respectively.
32. Dispositif selon la revendication 31 , dans lequel les moyens de séparation comprennent deux registres (R0, Ri, A0, A-i).32. Device according to claim 31, wherein the separating means comprise two registers (R 0 , Ri, A 0 , Ai).
33. Dispositif selon l'une des revendications 31 et 32, dans lequel ledit masque (η, η1 , η2) est composé d'au moins deux sous-masques (rji, rp- ) et les moyens de sélection sont apte à sélectionner ladite moitié en fonction des bits d'un même index dans respectivement les deux sous-masques (η1 , η2) correspondant à l'indice masqué (j1).33. Device according to one of claims 31 and 32, wherein said mask (η, η1, η2) is composed of at least two sub-masks (rji, rp-) and the selection means are able to select said half according to the bits of the same index in respectively the two sub-masks (η1, η2) corresponding to the masked index (j 1 ).
34. Dispositif selon l'une des revendications 31 à 33, dans lequel lesdits moyens de sélection comprennent des premiers moyens de permutation desdites deux moitiés correspondantes en fonction dudit bit de l'indice masqué (j1) et des deuxièmes moyens de permutation desdites deux moitiés correspondantes en fonction dudit bit du masque (rj, η1. rj2) correspondant à l'indice masqué (j1).34. Apparatus according to one of claims 31 to 33, wherein said selection means comprises first means for permutation of said two corresponding halves as a function of said bit of the masked index (j 1 ) and second means of permutation of said two corresponding halves according to said mask bit (r j , η1, r j 2) corresponding to the masked index (j 1 ).
35. Dispositif selon la revendication précédente, dans lequel - lesdits premiers moyens de permutation sont aptes à permuter deux registres (R0, Ri) conditionnellement à la valeur du k-ième bit dudit indice masqué (j'.Kl), - lesdits deuxièmes moyens de permutation sont aptes à permuter lesdits registres conditionnellement à la valeur du k-ième bit dudit masque correspondant à l'indice masqué (η[k]), le dispositif comprenant en outre: -des moyens pour affecter ledit mot binaire (U, U1) à deux registres (Ro,35. Apparatus according to the preceding claim, wherein - said first permutation means are capable of permuting two registers (R 0 , Ri) conditionally with the value of the k-th bit of said masked index (j ' . said second permutation means are capable of permuting said registers conditionally with the value of the k-th bit of said mask corresponding to the masked index (η [k]), the device further comprising: means for assigning said binary word (U, U 1 ) with two registers (Ro,
Ri) où un premier registre stocke la moitié de poids fort dudit mot binaire,Ri) where a first register stores the high-order half of said binary word,
-des moyens de substitution dudit mot binaire (U, U1) par ledit premier registre,means for substituting said binary word (U, U 1 ) with said first register,
- des moyens pour retourner la valeur dudit mot binaire substitué. means for returning the value of said substituted bit word.
36. Dispositif selon l'une des revendications 34 et 35, dans lequel les moyens de permutation conditionnelle comprennent une fonction de permutation entre un premier et un deuxième registres, ladite fonction de permutation comprenant les instructions consistant à copier Ie deuxième registre dans un registre tampon, à copier ledit premier registre dans l'un des deux registres fonction de ladite condition et à copier ledit registre tampon dans l'autre registre non vérifié par la condition.36. Device according to one of claims 34 and 35, wherein the conditional permutation means comprise a permutation function between a first and a second register, said permutation function comprising instructions to copy the second register in a buffer register copying said first register into one of two registers according to said condition and copying said buffer register to the other register not verified by the condition.
37. Dispositif selon l'une des revendications 34 et 35, dans lequel les moyens de permutation conditionnelles comprennent une fonction de rotation: Rotate((R0, Ri), l+b.l) où (Ro, R-i) sont deux registres formés dans un même registre de taille double, I est la longueur des premier et deuxième registres et b est un booléen fonction de ladite condition, la fonction Rotate(R, x) effectuant une rotation de R sur x bits à droite ou à gauche.37. Device according to one of claims 34 and 35, wherein the conditional permutation means comprise a rotation function: Rotate ((R 0 , Ri), l + bl) where (Ro, Ri) are two registers formed in the same double size register, I is the length of the first and second registers and b is a boolean function of said condition, the Rotate function (R, x) rotating R on x bits to the right or left.
38. Dispositif selon l'une des revendications 31 à 33, dans lequel les moyens de sélection comprennent des moyens de détermination d'une desdites moitiés en fonction du bit de l'indice masqué (j1) et des moyens de stockage de ladite moitié déterminée dans un registre (Ao, A-i) dépendant du bit dudit masque correspondant (η, η1 , η2), et de l'autre moitié dans un registre complémentaire. 38. Device according to one of claims 31 to 33, wherein the selection means comprises means for determining one of said halves according to the bit of the masked index (j 1 ) and storage means of said half determined in a register (Ao, Ai) depending on the bit of said corresponding mask (η, η1, η2), and the other half in a complementary register.
39. Dispositif selon la revendication précédente, comprenant des moyens combinatoire du bit du masque correspondant (rj, η1 , rj2) avec un bit aléatoire (b) de sorte à déterminer le registre de stockage desdites moitiés, et des moyens aptes à retourner un registre fonction dudit bit aléatoire (b).39. Device according to the preceding claim, comprising combinatorial means of the bit of the corresponding mask (rj, η1, r j 2) with a bit random (b) so as to determine the storage register of said halves, and means adapted to return a function register said random bit (b).
40. Dispositif selon l'une des revendications 38 et 39, comprenant des moyens de masquage desdites moitiés déterminées lors de leur stockage dans lesdits registres.40. Device according to one of claims 38 and 39, comprising means for masking said halves determined during their storage in said registers.
41. Dispositif selon l'une des revendications 32 et 35 à 40, dans lequel lesdits registres (R0, Ri, Ao, A1, B0, B-i, Co, Ci) sont des registres d'un microcontrôleur sécurisé (2).41. Device according to one of claims 32 and 35 to 40, wherein said registers (R 0 , Ri, Ao, A 1 , B 0 , Bi, Co, Ci) are registers of a secure microcontroller (2) .
42. Produit programme d'ordinateur comprenant une suite d'instructions aptes, lorsqu'elles sont exécutées par un microprocesseur, à mettre en œuvre un procédé selon l'une des revendications 1 à 30. 42. A computer program product comprising a sequence of instructions adapted, when executed by a microprocessor, to implement a method according to one of claims 1 to 30.
PCT/FR2007/002062 2007-12-13 2007-12-13 Method for accessing a sub-word in a binary word, and related device and software WO2009074727A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/FR2007/002062 WO2009074727A1 (en) 2007-12-13 2007-12-13 Method for accessing a sub-word in a binary word, and related device and software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/FR2007/002062 WO2009074727A1 (en) 2007-12-13 2007-12-13 Method for accessing a sub-word in a binary word, and related device and software

Publications (1)

Publication Number Publication Date
WO2009074727A1 true WO2009074727A1 (en) 2009-06-18

Family

ID=39864412

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/FR2007/002062 WO2009074727A1 (en) 2007-12-13 2007-12-13 Method for accessing a sub-word in a binary word, and related device and software

Country Status (1)

Country Link
WO (1) WO2009074727A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003101039A1 (en) * 2002-05-23 2003-12-04 Koninklijke Philips Electronics N.V. S-box encryption in block cipher implementations
US20070140478A1 (en) * 2005-12-15 2007-06-21 Yuichi Komano Encryption apparatus and encryption method
EP1832974A1 (en) * 2006-03-06 2007-09-12 St Microelectronics S.A. Electromagnetic Analysis Protection of a calculation in an electronic circuit
EP1833190A1 (en) * 2006-03-07 2007-09-12 Research In Motion Limited Table splitting for cryptographic processes

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003101039A1 (en) * 2002-05-23 2003-12-04 Koninklijke Philips Electronics N.V. S-box encryption in block cipher implementations
US20070140478A1 (en) * 2005-12-15 2007-06-21 Yuichi Komano Encryption apparatus and encryption method
EP1832974A1 (en) * 2006-03-06 2007-09-12 St Microelectronics S.A. Electromagnetic Analysis Protection of a calculation in an electronic circuit
EP1833190A1 (en) * 2006-03-07 2007-09-12 Research In Motion Limited Table splitting for cryptographic processes

Similar Documents

Publication Publication Date Title
EP2218208B1 (en) Method for cryptographic data processing, particularly using an s box, and related device and software
EP1358732B2 (en) Secure encryption method and component using same
EP1358733B1 (en) Secure method for secret key cryptographic calculation and component using said method
EP2893431B1 (en) Protection against side channel attacks
EP2499773B1 (en) Low-complexity electronic circuit protected by customized masking
EP2380306A1 (en) Cryptography circuit protected against observation attacks, in particular of a high order
FR2829331A1 (en) Chip card key security system for Data Encryption Standard (DES) keys uses partial comparison
WO2006021641A1 (en) Method and device for executing cryptographic calculation
FR3033965A1 (en)
EP2120388A1 (en) Integrity test of an encryption key
FR3029719A1 (en) ENCRYPTION METHOD WITH DYNAMIC CONFUSION AND DIFFUSION LAYERS
EP3300293A1 (en) Method for symmetric encryption or decryption by blocks
EP2159952B1 (en) Protection of an encryption algorithm
WO2009074728A1 (en) Method for cryptographic data processing, particularly using an s box, and related device and software
FR3056322A1 (en) METHOD OF ENCRYPTION OR DE-RECTIFICATION PROTECTED AGAINST HALF-CHANNEL ATTACKS
FR2960728A1 (en) METHOD FOR DETERMINING A REPRESENTATION OF A PRODUCT AND METHOD FOR EVALUATING A FUNCTION
FR2789776A1 (en) Electronic component encryption code differential attack countermeasure technique having random number/input data EXCLUSIVE OR gate applied and random number/logic operation manipulated/ EXCLUSIVE OR gate applied.
EP2320596B1 (en) Protection of a cryptographic key against uniderectional attacks
EP3502899B1 (en) Method for determining a checksum, and related computer program and electronic entity
WO2009074727A1 (en) Method for accessing a sub-word in a binary word, and related device and software
WO2007116140A1 (en) Method for cryptographic processing of data, related device and programme
WO2009068658A1 (en) Methods and devices for encrypting and decrypting a data message with random secret key
EP4242884A1 (en) Method for protection against side-channel attacks
EP3493182B1 (en) Method and device for cryptographic processing of data
EP3346632B1 (en) Method for encrypting or decrypting an n-tuple of data with an n-tuple of predetermined secret keys

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 07871854

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 07871854

Country of ref document: EP

Kind code of ref document: A1