Method for generating authentication code and related encryption processing device

By using the exclusive or combination of mask and correction code to generate output code in the GCM algorithm, the problem of high attack risk and high calculation cost of GCM algorithm when generating authentication code is solved, and the balance between processing time and security is achieved .

CN110943823BActive Publication Date: 2024-11-08IDEMIA FRANCE SAS
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN201910895073.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-09-24
Filing Date
2019-09-20
Publication Date
2024-11-08
Estimated Expiration
2039-09-20

AI Technical Summary

Technical Problem

The existing GCM algorithms have a risk of attack when generating authentication codes, and multiplication operations lead to high computational costs, making it difficult to balance processing time and security.

Method used

By using the exclusive OR combination of mask and correction codes in the Galois field, the output code associated with the data block is generated to ensure that the mask remains unchanged throughout the process and avoid multiplication updates, thereby reducing computational costs and improving security.

Benefits of technology

This method effectively reduces the calculation cost, while improving the security of authentication code generation, avoiding the expensive calculation costs brought by multiplication operations, and achieving a balance between processing time and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110943823B_ABST
    Figure CN110943823B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for generating an authentication code and a related encryption processing device. i ), each data block (C i )’s output code (X m+i ), enter the code (X m+i‑1 ) and the associated data block (C i ) to obtain the combination code. The method comprises a step (E4) of determining a mask (M) and a step (E6) of determining a correction code (P), wherein the correction code (P) is equal to an XOR combination of the mask (M) and a second product (MH) obtained by multiplying the mask (M) by a multiplier (H). Each data block (C i )’s output code (X m+i ), multiple data including data blocks (C i ) and a correction code (P). A related encryption processing device is also described.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention generally relates to the field of cryptographic algorithms for authenticated encryption.

[0002] The present invention specifically relates to a method for generating an authentication code and a related encryption processing device. Background Art

[0003] Authenticated encryption algorithms such as the so-called GCM (ie “Galois Counter Mode”) algorithm are known.

[0004] In this encryption algorithm, a block encryption algorithm for generating encrypted data comprising a plurality of ordered data blocks is combined with an algorithm for generating an authentication code associated with the encrypted data.

[0005] For example, it is desirable within the framework of the GCM algorithm to determine for each data block an output code (in the associated Galois field) based on the first product obtained by multiplying a combination code by a multiplier, the combination code itself being obtainable by an XOR combination of the input code and the associated data block. Summary of the invention

[0006] In this context, the invention provides a method for generating an authentication code associated with data (e.g., encrypted data) comprising a plurality of ordered data blocks, wherein for each data block, an output code (within a relevant Galois field) is determined based on a first product obtained by multiplying a combination code by a multiplier, the combination code being obtained by an XOR combination of an input code and the relevant data block, characterized in that the method comprises the following steps: a step of determining a mask, a step of determining a correction code, the correction code being equal to an XOR combination of a mask and a second product obtained by multiplying the mask by the multiplier, and for each data block, determining the output code by an XOR combination of a plurality of data, the plurality of data comprising the first product and a correction code associated with the data block.

[0007] In fact, the inventors have realized that the authenticated encryption algorithm proposed in the introduction may be the subject of an additional channel attack to obtain a multiplier that can be used to subsequently generate a false authentication code.

[0008] The method proposed above enables the manipulation of data in a masked form (at least through a mask). The use of correction codes (especially applied during the determination of the output code) also allows the mask to remain unchanged throughout the process, regardless of whether multiplication is used (theoretically, multiplication means the update of the mask after the multiplication, which means expensive calculation costs).

[0009] It should be noted that the multiplication proposed above is multiplication within the Galois field, to be precise, the Cardinal Galois field 2 l , where l is the bit length of each of the above data blocks (and / or input code and / or output code and / or multiplier and / or correction code and / or authentication code).

[0010] Other optional features include:

[0011] - For each data block, the input code is masked by the mask;

[0012] - for at least one data block, the input code is equal to the output code determined by the previous data block;

[0013] - For the first data block, the input code is obtained based on the authentication data and the multiplier;

[0014] - the method comprises the step of XOR-combining at least part of the authentication data with the mask;

[0015] - Determine the authentication code based on the mask and the output code obtained for the last data block;

[0016] - The length of the input code and / or the combination code and / or the output code and / or the mask is 128 bits.

[0017] According to a possible implementation (an example of which is provided by the following reference Figure 4 Referring to the description), the method may include the following steps:

[0018] -determine the initial additional mask;

[0019] - storing the initial additional mask as the current mask in a memory;

[0020] - For each data block, read the current mask in the memory, obtain a third product obtained by multiplying the current mask by the multiplier, and store the third product in the memory as a new current mask.

[0021] If multiple masks are used, the masks are stored throughout the process as described above, and the additional masks are updated after the multiplication.

[0022] In other words, the method includes the following steps:

[0023] - determining a first mask number set and a second mask number set, wherein the first mask number set includes masks,

[0024] - determining a correction code for each mask of the first mask set, the correction code being equal to an exclusive OR combination of the associated mask and the product of the associated mask multiplied by a multiplier.

[0025] For each data block, an output code is determined by performing an XOR combination of the first product associated with the data block and the correction code associated with the mask of the first mask set. Therefore, the mask of the first mask set needs to be saved throughout the whole process.

[0026] To determine each output code, the method further comprises the step of updating the masks of the second mask set after multiplying each mask of the second mask set by a multiplier.

[0027] To optimize the balance between processing time and security, for example, the difference between the number of masks in the second mask set and the number of masks in the first mask set can be set to 0 or 1.

[0028] The invention also provides an encryption processing device including an encryption module, which is designed to generate data including multiple ordered data blocks (such as encrypted data); and an authentication module for generating an authentication code related to the above data, wherein the authentication module is designed to obtain the combination code of each data block by the XOR combination of the input code and the relevant data block and determine the output code based on the first product obtained after the combination code is multiplied by the multiplier, and is characterized in that it includes a mask determination unit and a correction code determination unit, the correction code is equal to the XOR combination of the mask and the second product obtained after the mask is multiplied by the multiplier, and for each data block, the authentication module determines the output code by the XOR combination of multiple data, and the multiple data include the first product and the correction code related to the data block.

[0029] The optional features of the method presented above may be applied to such an apparatus. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The following description with reference to the accompanying drawings provides a non-limiting example, which makes the composition and implementation of the present invention clear, in which:

[0031] - Figure 1 Schematically shows the main elements of an electronic entity implementing the invention;

[0032] - Figure 2 yes Figure 1 A functional representation of the components of an electronic entity;

[0033] - Figure 3 A first example of a method for generating an authentication code according to the present invention is shown; and

[0034] - Figure 4 A second example of the method of generating an authentication code according to the present invention is shown. DETAILED DESCRIPTION

[0035] Figure 1 The main elements of the electronic entity 1 implementing the invention are schematically shown. For example, the electronic entity is a microcircuit board, such as a Universal Integrated Circuit Card (UICC or "Universal Integrated Circuit Card"). Alternatively, it may be a secure element (or "secure element" SE) - for example a secure microcontroller; for example, such a secure element is integrated into a portable electronic device (or "handheld electronic device" in English) such as a communication terminal or an electronic passport. According to other variants, the electronic entity 1 may be a computer or a hardware security module (or "hardware security module" HSM).

[0036] The electronic entity 1 comprises a processor 2 (referred to herein as a microprocessor), a random access memory 4 and a writable non-volatile memory 6 (for example of the “Electrically Erasable Programmable Read-Only Memory” EEPROM type). The electronic entity 1 may also comprise a read-only memory. The random access memory 4 and the writable non-volatile memory 6 (and, if appropriate, a fixed memory) are connected to the processor 2 so that the processor 2 can read or write data in each of these memories.

[0037] One of these memories (e.g., the writable non-volatile memory 6) stores computer program instructions which, when executed by the processor 2, allow the following reference to be implemented: Figure 3 to Figure 4 One of the methods described.

[0038] The random access memory 4 and the writable non-volatile memory 6 also store data representing values ​​used when implementing the method. The writable non-volatile memory 6 notably stores an encryption key K (as used in the following description).

[0039] As described below, the electronic entity 1 is designed to execute a method for generating an authentication code T (English: "authentication mark") using some instructions stored in a random access memory 4 and a writable non-volatile memory 6 of the electronic entity 1 and executable by a processor 2 of the electronic entity. Here, this method includes at least one encryption processing step (for example, encrypting a data block D by applying an encryption cryptographic algorithm using an encryption key K) i Therefore, the electronic entity 1 is an encryption processing device.

[0040] The electronic entity 1 also includes a communication interface 8 connected to an external electronic device. For example, in the case where the electronic entity 1 described herein is a microcircuit board, the communication interface 8 includes exposed contacts on one side of the microcircuit board. Optionally, the communication interface 8 can be implemented by a contactless communication module. Typically, the communication interface 8 can be a (wired or wireless) communication module connected to other electronic entities.

[0041] In some embodiments, the processor 2 may receive data (here, m data blocks A) from other electronic entities via the communication interface 8. i The authentication data A and / or n data blocks D i The data D to be encrypted is formed and / or other data (here, for example, n data blocks C) is output to other electronic entities via the communication interface 8. i The encrypted data C composed of the above and / or the authentication code T generated as described below).

[0042] The following describes a scheme for performing block encryption on the encrypted data D according to the GCM algorithm (ie, "Galois Field Counter Mode") and generating an authentication code T (authentication only) of the encrypted data C and authentication data A.

[0043] n (ordered) data blocks D of the data to be encrypted i , (and n (ordered) data blocks C of encrypted data C i ), m (ordered) data blocks A of authentication data A i And the authentication code T has the same length (in bits), for example 128 bits as part of the GCM algorithm.

[0044] Figure 2 The elements of a cryptographic processing device according to the invention, here an electronic entity 1 , are shown in functional form.

[0045] Each element (module or unit) described below is actually implemented by hardware and software elements in collaboration, and the functions are implemented here by the processor 2, which executes computer program instructions stored in the memory (e.g., writable non-volatile memory 6) of the electronic entity 1. Alternatively, these elements can be implemented in a dedicated integrated circuit (or "application-specific integrated circuit" ASIC).

[0046] Therefore, the electronic entity 1 includes an encryption module 10 and an authentication module 20 .

[0047] The encryption module 10 is designed to treat the encrypted data block D i Apply the block cipher to obtain the encrypted data block C i .

[0048] Thus, the encryption module 10 comprises a counter 12 generating a counter value CNT, and an encryption unit 14 applying an encryption algorithm E to the current counter value CNT.

[0049] The encryption algorithm E used herein is an AES type encryption algorithm using an encryption key K (stored in the electronic entity 1 , as already indicated).

[0050] The value generated at the output of the encryption unit 14 may thus be denoted as E k The value of (CNT) is applied to the input of an exclusive OR operator 16 which receives as another input the current data block D to be encrypted. i .

[0051] The value output by the XOR operator 16 (and therefore the output of the encryption module 10) is the value obtained by comparing it with the current data block D i The relevant encrypted data block C i .

[0052]

[0053] The authentication module 20 is designed to generate the authentication code T mentioned above, which is associated with the generated encrypted data block C i And the authenticated data block A i Related.

[0054] The authentication module 20 includes a selection unit 22, which (according to the following reference Figure 3 The method for generating an authentication code described in the step of) selecting the current data block A of the authentication data i Or the current data block C of the encrypted data i .

[0055] The block thus selected and generated at the output of the selection unit 22 is subsequently denoted as B j .

[0056] The authentication module 20 further comprises a determination unit 28 designed to determine a mask M (here randomly drawn). The mask M here has the same i , A i and C i The same length (unit: bit) (for example, 128 bits in the example).

[0057] As described below, the mask M can mask the data operated on in the authentication module 20 (by combining the mask M and the relevant data block by an XOR operator ⊕ to mask each operated data block X). j ). Therefore, the determination unit 28 generates a single mask M during the authentication code generation (eg, the mask M is stored in the random access memory 4).

[0058] The authentication module 20 also includes an exclusive OR operator 24 which receives the selected data block B j (According to the method steps, the authenticated data block A i Or encrypted data block C i ) and input data X j as input.

[0059] refer to Figure 3 , from the process of generating the authentication code, it can be seen that in the first iteration, the input data X j is equal to the mask M, and the input data X in other iterations j Equal to the output data X obtained in the previous iteration j+1 .

[0060] The authentication module 20 also includes a multiplication operator 26 that receives the value obtained from the output of the XOR operator 24 (i.e. ) and the multiplier H as input.

[0061] In the example described herein, the multiplier H is equal to the value E obtained by applying the encryption algorithm E to the value 0 (i.e., the 128-bit 0 value) using the encryption key K. k (0). The bit length of the multiplier H is therefore (in particular) equal to that of each data block D to be encrypted i bit length (and therefore equal to each encrypted data block C i Here the length is 128 bits.

[0062] In practice, the multiplier H may be stored in the electronic entity 1 (eg writable in the non-volatile memory 6). Alternatively, the multiplier H may be calculated each time it is used by means of an encryption key K (stored in the electronic entity 1).

[0063] The multiplication operator 26 is in the Galois field GF(2 l ) performs multiplication on the values ​​received as input, that is, the operation Where l is the data block D i , A i , C i The length of (unit: bit) and the symbol “·” represent multiplication in the Galois field.

[0064] Therefore, in the example described in this article, in the Galois field GF(2 128 ) to perform multiplication. For example, the field structure is based on irreducible polynomials with coefficients in the Galois field GF(2):

[0065] X 128 +X 7 +X 2 +X+1

[0066] The authentication module 20 further comprises a determination unit 30 for determining a correction code P, the correction code P being equal to an exclusive OR combination of the mask M and a product M·H obtained by multiplying the mask M and the multiplier H (in the Galois field).

[0067] For example, the determination unit 30 comprises a multiplication operator 32 receiving as input the mask M and the multiplier H, and an exclusive-OR operator 34 receiving as input the mask M and the output of the multiplication operator 32 .

[0068] Therefore, the XOR operator 34 outputs the correction code P:

[0069]

[0070] The authentication module 20 finally comprises an exclusive-OR operator 36 which receives the product (generated by multiplication operator 26) and correction code P (generated by determination unit 30) as input to produce output data X j+1 :

[0071]

[0072] If the input data Y j (unmasked) is received as input data in this stage, according to the GCM algorithm (and thus ),Right now:

[0073]

[0074] This corresponds to the value generated at this step according to the GCM algorithm (value ) is masked by mask M.

[0075] The use of the correction code P allows the masking of the (same) mask M to be preserved when implementing the GCM algorithm, regardless of whether multiplication is used in the GCM algorithm step.

[0076] The authentication module 20 may also include generating an intermediate mask X m+n+1 A unit which is designed to (among other things) be based on the output data X m+n (generated in the last iteration of step E22 as described below) and the correction code P to generate the intermediate mask X m+n+1 , such as according to the following step E28.

[0077] The authentication module 20 may further include a unit (not shown) for generating an authentication code T so that the intermediate mask X m+n+1 Demasking, where the mask M is applied to the intermediate mask X by an XOR operation m+n+1 , and combined it with E according to the GCM algorithm k (CNT0) are XOR-combined (as described in the following step E30).

[0078] Figure 3 A first example of a method for generating an authentication code T according to the present invention is shown. For example, the method is performed by Figure 2 The functional elements in are implemented.

[0079] The method starts at step E2, in which the processor 2 initializes the multiplier H to the value E indicated above. k (0), initializing the first input data X0 (input data of the first iteration of step E10) to the value 0 (i.e. the value 0 of 128 bits), and initializing the counter CNT to a given numerical value (e.g. a value previously received from the external electronic entity via the communication interface 8). In the case where the encryption algorithm E used herein is an AES type encryption algorithm using an encryption key K, the initialization of the counter CNT can be performed according to clause 7.1 of the NIST SP800-38D document.

[0080] Here, step E2 also includes storing the current value (initial value) of the counter CNT in the CNT0 variable.

[0081] As indicated above, the multiplier H may optionally be stored in the writable non-volatile memory 6 (in this case it is not initialized during step E2 but is merely read in the writable non-volatile memory 6 ).

[0082] Then, the processor 2 determines the mask M by random extraction in step E4. Alternatively, for example, the processor 2 may obtain the mask M by coordination with an encryption processor connected to the processor 2.

[0083] The processor 2 may therefore perform the following processing involving the mask M in step E6:

[0084] - The first input data X0 is masked by combining it with the mask M (by means of an XOR operation), that is, the processor actually calculates And store the result in variable X0 and overwrite it:

[0085] - Processor 2 determines the correction code (where “·” represents the Galois field GF(2 128 ) in, see the above description related to the multiplication operator 26 and the determination unit 30).

[0086] The processor 2 then initializes the current index i to 1 (step E8 ).

[0087] The processor 2 then determines the output data X as follows (step E10): i (relevant to the current iteration):

[0088]

[0089] Among them, it should be noted that A i is the (ordered) data block of index i in the authentication data, and X i-1 is the input data of the current iteration (X i-1 Corresponding to i=1—the variable X0 already mentioned at the first iteration—and the output data of the previous iteration when i>1).

[0090] For example, at the initial iteration of step E10 (i=1), and when the initial input data X0 is initialized to a value of 0 and masked using the mask M as described above, the output data X i yes In this case, the initial iteration of step E10 implements part A of the authentication data A i The step of XOR combination with mask M.

[0091] Since the input data X is masked using mask M i-1 , so the operations masked by the mask M can be found in the context of the GCM algorithm:

[0092] Right now

[0093]

[0094] ( and is the value that would result from the normal operation of the GCM algorithm without masking, and is therefore the relationship required to verify the GCM algorithm).

[0095] The processor 2 then increases the current index i (step E12 ).

[0096] Processor 2 determines in step E14 whether the new current index i is greater than data block A of the authentication data. i The number m.

[0097] If yes (positive determination indicated by arrow P), all of these data blocks A are processed i , processor 2 continues operation in step E16 described below.

[0098] If not (case of a negative determination indicated by arrow N), the method loops back to step E10 described above to process the new current data block A i .

[0099] At step E16 , processor 2 resets index i to 1.

[0100] The processor 2 then increases the counter CNT (step E18 ).

[0101] By using the new value of the counter CNT, the processor 2 determines, at step E20, the value of the data block D to be encrypted. i (Block with index i) The encrypted data block C associated with it i (block at index i), as follows:

[0102]

[0103] For example, the processing is implemented by the encryption module 10 described above. (For more details on the operations performed, see Figure 2 For details about encryption module 10, see .

[0104] The processor 2 may then determine the output data X in step E22 m+i (relevant to the current iteration), as follows:

[0105]

[0106] Among them, X m+i-1 is the input data of the current iteration (when i=1, it corresponds to the output data X of the latest iteration of step E10 m, when i>1, it corresponds to the output data of the previous iteration).

[0107] Since the input data X m+i-1 is masked by mask M, so operations masked by mask M can be found in the context of the GCM algorithm:

[0108] Right now

[0109]

[0110] ( and is the value that enables normal operation of the GCM algorithm without masking, and therefore the ideal relationship required by the GCM algorithm can be verified).

[0111] The processor 2 then increases the current index i (step E24 ).

[0112] Processor 2 determines in step E26 whether the new current index i is greater than the encrypted data block C i The number n (equal to the number of data blocks Di to be encrypted).

[0113] If yes (positive determination indicated by arrow P), all encrypted data blocks C are processed. i , processor 2 continues to operate in step E28 described below.

[0114] If not (a negative determination is indicated by arrow N), the method loops back to step E18 described above to process the new current data block D i .

[0115] At step E28, processor 2 determines the intermediate mask X m+n+1 , as shown below:

[0116]

[0117] Among them, X m+n is the output data generated by the latest iteration of step E22 (the iteration when i=n in step E22), l A is the bit length of the authentication data A encoded as 64 bits (i.e. 128*m), l C is the bit length of the encrypted data C encoded as 64 bits (i.e. 128*n), and “||” is a cascade operation.

[0118] Here, since the output data X m+n Masking is done with mask M, so operations masked by mask M can be found in the context of the GCM algorithm:

[0119] Right now

[0120]

[0121] ( and is the value that enables normal operation of the GCM algorithm without masking, and therefore the relationship required by the GCM algorithm can be verified).

[0122] The processor 2 can then make the value X obtained in step E28 m+n+1 The authentication code T is determined by unmasking (step E30), that is to say by applying the mask M to the value X by an XOR operation. m+n+1 , and further apply the value E through an XOR operation k (CNT0) (as provided by the GCM algorithm):

[0123]

[0124] In fact, as described above, the application of the correction code P in the operations of steps E10 , E22 and E28 makes it possible to preserve the mask M constant throughout the process, regardless of whether or not Galois field multiplications are used in these steps.

[0125] Figure 4 A second example of a process of generating an authentication code according to the present invention is shown.

[0126] As described below, the second example differs from the first example in that t ordered masks are used (t masks are used).

[0127] The process starts at step E52 (with Figure 3 The same as step E2 described above), in which the processor 2 initializes the multiplier H to E k (0), the first input data X0 (input data of the first iteration of step E60) are initialized to the value 0 (ie the 128-bit 0 value), and the counter CNT is initialized to given data (for example a value previously received from an external electronic entity via the communication interface 8).

[0128] Step E52 here also includes storing the current value (initial value) of the counter CNT in the CNT0 variable.

[0129] Then, the processor 2 determines a plurality of masks t by random sampling in step E54, namely, M1, ..., M t (t is preferably an odd number, such as 3). To ensure a higher order mask, each mask M j Determined by a random draw method different from other masks.

[0130] Among these t masks M1, ..., M t , divided into the first mask set M k+1,……,M t (including mask tk) and the second mask set M1, ..., M k (including mask k), where 0<k<t (k is preferably a quotient greater than or equal to t / 2).

[0131] Therefore, the first mask set may include mask M k+1 Or multiple masks M k+1 ,……,M t Similarly, the second mask set may include mask M1 or multiple masks M1, ..., M k .

[0132] An example in which each of the first mask set and the second mask set includes a plurality of masks is described below.

[0133] The processor 2 can therefore perform the following steps involving the mask M in step E56: j Processing:

[0134] - The first input data X0 is masked M j The continuous combination of (through XOR operation) masks, that is, in fact, the processor calculates And store the result in variable X0 and overwrite it:

[0135] - Processor 2 determines the mask M of the first mask set j The correction code P j (that is, including index j between k+1 and t), as shown below:

[0136] (where “·” represents the Galois field GF(2 128 ), see the above multiplication operation 26 and the determination unit 30 for related description).

[0137] The processor 2 then initializes the current index i to 1 (step E58 ).

[0138] The processor 2 then determines (step E60) the output data X i (Relevant to the current iteration):

[0139]

[0140] Among them, it is necessary to pay attention to A i is the (ordered) data block of index i in the authentication data, and X i-1 is the input data of the current iteration (i=1—corresponds to the already mentioned variable X0 for the first iteration, and i>1 corresponds to the output data of the previous iteration).

[0141] In this step, as described above (with reference in particular to step E10), the masks M of the first mask set k+1 ,……,M t Use the correction code P k+1 ,……,P t This keeps these masks unchanged (even after multiplication).

[0142] However, the masks M1, ..., M k is not affected, so step E60 also includes multiplying each mask by the multiplier H and updating the masks M1, ..., M of the second mask set. k steps.

[0143] The processor 2 then increases the current index i (step E62 ).

[0144] The processor 2 then determines, at step E64, whether the new current index i is greater than the data block A of the authentication data. i The number m.

[0145] If yes (positive determination indicated by arrow P), all of these data blocks A are processed i , and the processor 2 continues operation in step E66 described below.

[0146] If not (the case of a negative determination indicated by arrow N), the process loops back to step E60 described above to process the new current data block A. i .

[0147] At step E66 , processor 2 resets index i to the value 1 .

[0148] The processor 2 then increases the counter CNT (step E68 ).

[0149] By using the new value of the counter CNT, the processor 2 determines in a step E70 the value of the data block D to be encrypted. i (Data block with index i) Related encrypted data block C i (group with index i), as follows:

[0150]

[0151] This processing is implemented by the encryption module 10 described above. (For more details on the operations performed, please refer to Figure 2 Description of the cryptographic module 10. )

[0152] The processor 2 can then determine the output data X of step E72 m+i (regarding the current iteration), as follows:

[0153]

[0154] Among them, X m+i-1 is the input data of the current iteration (when i=1, it corresponds to the output data X of the latest iteration of step E60 m , when i>1, it corresponds to the output data of the previous iteration).

[0155] In step E60 as described above, the mask M of the first mask set k+1 ,……,M t Use the correction code P k+1 ,……,P t This causes these masks to remain unchanged (even after multiplication).

[0156] However, the masks M1, ..., M k is not affected, and therefore step E72 also includes updating each mask M1, ..., M of the second mask set after multiplying each mask by the multiplier H. k steps.

[0157] The processor 2 then increases the current index i (step E74 ).

[0158] The processor 2 then determines, at step E76, whether the new current index i is greater than the number n of encrypted data blocks Ci (equal to the number n of data blocks to be encrypted). i quantity).

[0159] If yes (positive determination indicated by arrow P), the encrypted data block C is processed i , and processor 2 continues operation in step E78 described below.

[0160] If not (the case of a negative determination indicated by arrow N), the process loops back to step E68 described above to process the new current data block D i .

[0161] At step E78, the processor 2 determines the intermediate mask X m+n+1 , as shown below:

[0162]

[0163] Among them, X m+n is the output data generated by the latest iteration of step E72 (the iteration when i=n in step E72), l A is the bit length of the authentication data A encoded as 64 bits (i.e. 128*m), l C is the bit length of the encrypted data C encoded as 64 bits (i.e. 128*n), and “||” is a cascade operation.

[0164] Here the mask M of the first mask setk+1 ,……,M t Use the correction code P k+1 ,……,P t This causes these masks to remain unchanged (even after multiplication).

[0165] However, the masks M1, ..., M k is not affected, and therefore step E78 also includes updating each mask M1, ..., M of the second mask set by multiplying each mask by the multiplier H. k steps.

[0166] The processor 2 can then make the value X obtained in step E78 m+n+1 Unmasking and generating the authentication code T (step E80), that is to say (by means of an XOR operation) each mask M1, ..., M t Applied to value X m+n+1 , and then applying the value E by an XOR operation (as obtained by the GCM algorithm) k (CNT0):

[0167]

Claims

1. A method for generating an authentication code (T), the authentication code and a plurality of ordered data blocks (C i ), among which, For the ordered data blocks (C i ) in each of the combinations, according to m+i-1 ⊕C i The first product obtained after multiplying ) and the multiplier (H) in the Galois field determines the output code (X m+i ), the combination code is input by the code (X m+i-1 ) and the associated data block (C i ), wherein, for at least one of the data blocks other than the first data block (C i ), the input code is equal to the output code determined by the previous data block, wherein for the first data block (C i ), obtain the input code (X) according to the authentication data (A) and the multiplier (H) m ), characterized in that the method comprises the following: Determine the mask (M; M t ) step (E4; E54) and determining the correction code (P; P t ) step (E6; E56), the correction code (P; P t ) is equal to the mask (M; M t ) and the mask (M; M t ) is multiplied by the multiplier (H) in the Galois field to obtain the second product (M·H; M t H), wherein the mask is determined by random sampling, and For each of the ordered data blocks (Ci), the output code (X m+i ) is determined by an XOR combination of a plurality of data, the plurality of data including the first product and the data block (C i ) related to the correction code (P; P t ); wherein, by using the mask (M; M t ) and for the last data block (C n )The output code (X m+n ) is combined with multiple data to determine the authentication code.

2. The method according to claim 1, wherein: For the ordered data blocks (C i ), the input code (X m+i-1 ) is composed of the mask (M; M t )masking.

3. The method according to claim 1, comprising: combining at least a part (A1) of the authentication data (A) with the mask (M; M t ) steps for performing XOR combination.

4. The method according to any one of claims 1 to 3, comprising the following steps: - determining (E54) an initial additional mask (M1); - storing the initial additional mask (M1) as the current mask in the memory; - For the ordered data blocks (C i ), read the current mask (M1) in the memory, obtain a third product (M1·H) by multiplying the current mask (M1) and the multiplier (H) in the Galois field, and store the third product (M1·H) as a new current mask in the memory (E72).

5. The method according to any one of claims 1 to 3, comprising the steps of: - Determine (E54) the first mask set (M k+1 , M t ) and the second mask set (M1, M k ), the first mask set includes masks (M t ), - For each mask (M) of the first mask set k+1 , M t ), determine the relevant correction code (P k+1 ;P t ), the correction code is equal to the associated mask (M k+1 ;M t ) is multiplied by the multiplier (H) in the Galois field and the product (M k+1 ·H;M t H) and the associated mask (M k+1 ;M t ), Among them, for the ordered data blocks (C i ) in each of the data blocks (C i ) and the mask (M k+1 , M t ) related correction code (P k+1 , P t ) is combined to determine the output code (X m+i ), To determine the output code (X m+i ), the method comprising a step (E72) of updating the masks of the second mask set after multiplying each mask of the second mask set by the multiplier (H) within a Galois field.

6. The method according to claim 5, wherein: A difference between the number of masks in the second mask set and the number of masks in the first mask set is equal to 0 or 1.

7. The method according to any one of claims 1 to 6, wherein: The length of the input code, the combination code, the output code and the mask is 128 bits.

8. An encryption processing device, comprising an encryption module (10), wherein the encryption module (10) is designed to generate a plurality of ordered data blocks (C i ) data; and an authentication module (20), the authentication module (20) being designed to generate an authentication code (T) associated with the data, wherein, For the ordered data blocks (C i ), the authentication module (20) is designed to input a code (X j ) and the associated data block (C i ) are combined to obtain a combined code, wherein, for at least one of the data blocks (C i ), the input code is equal to the output code determined by the previous data block, wherein for the first data block (C i ), obtain the input code (X) according to the authentication data (A) and the multiplier (H) m ), and determining the output code (X) according to the first product obtained by multiplying the combination code by the multiplier (H) in the Galois field j+1 ), The invention is characterized in that it comprises a determination unit (28) for determining a mask (M) and a correction code (P; P t ) of the determination unit (30), the correction code is equal to the mask (M; M t ) and the mask (M; M t ) is multiplied by the multiplier (H) in the Galois field, wherein the mask is determined by random extraction, The authentication module (20) is designed to i ) is determined by combining multiple data in an exclusive OR to obtain the output code (X j+1 ), the plurality of data includes the first product and the data block (C i ) related to the correction code (P; P t ); The authentication module (20) is designed to use a mask (M; M t ) and for the last data block (C n )The output code (X m+n ) is combined with multiple data to determine the authentication code.

Citation Information

Patent Citations

  • Multiple-mode cryptographic module usable with memory controllers

    US20110255689A1

  • Method And Arrangement For Protecting File-Based Information

    US20120087490A1

  • Low depth combinational finite field multiplier

    US20120226731A1

  • Methods and apparatus for correlation protected processing of cryptographic operations

    US20130259226A1

  • Hardware protection of inline cryptographic processor

    US20150363332A1