Processor and method for processing masked data

By using arithmetic and logical units, address generation units and register groups in the processor, combined with mask processing, the problem of insufficient confidentiality when processing masked data is solved, and the complete masking of data during processing is achieved , improves data security.

CN112650471BActive Publication Date: 2024-11-12STMICROELECTRONICS (GRENOBLE 2) SAS +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011079492.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-10-11
Filing Date
2020-10-10
Publication Date
2024-11-12
Estimated Expiration
2040-10-10

AI Technical Summary

Technical Problem

Existing processors find it difficult to maintain the complete confidentiality of data when processing masked data, and there is a risk of non-masking operations, affecting data security.

Method used

A processor is designed, using arithmetic and logical units, combining address generation units and register groups, and data masking is performed through masking to ensure that data remains masked throughout the process, and the masking type is modified using masking circuits to avoid demasking. operate.

Benefits of technology

Reliable processing of masked data in the processor is realized, ensuring that the data remains masked during arithmetic and logical operations, and improving data confidentiality and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112650471B_ABST
    Figure CN112650471B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a processor and method for processing masked data. The method is for processing masked data using a processor including an arithmetic and logic unit, wherein the masked data remains masked during processing of the masked data in the arithmetic and logic unit.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims the benefit of French Application No. 1911348, filed October 11, 2019, which is hereby incorporated by reference. Technical Field

[0003] The present disclosure relates generally to electronic systems, circuits and methods, and more particularly to processors and methods. The present disclosure relates more particularly to processors configured to process masked data and methods of operating the same. Background Art

[0004] A processor is an electronic component found in many electronic systems and circuits that is configured to process data by executing commands and instructions from a computer program.

[0005] In some cases, the processor may have to process secret data. These secret data are usually encrypted, for example by masking.

[0006] It would be desirable to be able to at least partially improve upon certain aspects of known processors. Summary of the invention

[0007] There is a need in the art for more reliable processors.

[0008] There is a need in the art for a processor configured to process masked data.

[0009] There is a need in the art for a processor that is configured to process masked data without performing unmasked operations on the masked data.

[0010] One embodiment addresses all or some of the disadvantages of known processors.

[0011] One embodiment provides a method for processing masked data using a processor including an arithmetic and logic unit, wherein the masked data remains masked during processing of the masked data in the arithmetic and logic unit.

[0012] According to one embodiment, the processor further comprises an address generation unit, wherein the masked data remains masked during processing of the masked data in the address generation unit.

[0013] According to one embodiment, the processor further comprises a register bank, wherein the masked data is stored in the register bank, and the masked data remains masked throughout its storage.

[0014] According to one embodiment, the register set includes at least one register set for data and at least one register set for a mask of the data.

[0015] According to one embodiment, the processor further comprises a register for storing a mask pointer.

[0016] According to one embodiment, the register stores at least one masked register pointer and at least one masked program pointer.

[0017] According to one embodiment, the register includes a pointer referencing data and a pointer mask.

[0018] According to one embodiment, the masked data may be masked according to a first masking type and a second masking type.

[0019] According to one embodiment, the first masking type uses only arithmetic operations.

[0020] According to one embodiment, masking data by a first masking type is equal to adding the data to be masked with a mask.

[0021] According to one embodiment, the second masking type uses only logical operations.

[0022] According to one embodiment, data masked by the second masking type is equal to applying a bitwise exclusive-OR operation between the data to be masked and the mask.

[0023] According to one embodiment, the arithmetic and logic unit comprises a masking circuit configured to modify a masking type of the masked data.

[0024] Another embodiment provides a processor configured to execute the aforementioned method. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above-mentioned features and advantages and other features and advantages will be described in detail in the following description of specific embodiments given by way of example and not limitation, in the accompanying drawings:

[0026] Figure 1 An embodiment of a processor is schematically shown in block diagram form;

[0027] Figure 2 The block diagram schematically shows the process for generating Figure 1 An embodiment of an address arithmetic and logic unit of a processor;

[0028] Figure 3 Shows the description Figure 2 Operation flow chart of the unit;

[0029] Figure 4 Shows the description Figure 2 Another operation flow chart of the unit;

[0030] Figure 5 An embodiment of an addition logic circuit is schematically shown in block diagram form;

[0031] Figure 6 Another embodiment of a logic circuit for calculating a complement number is schematically shown in block diagram form;

[0032] Figure 7 Another embodiment of a logic circuit for shifting bits in a binary word is schematically shown in block diagram form;

[0033] Figure 8 An embodiment of a multiplication logic circuit is schematically shown in block diagram form;

[0034] Fig. 9 Another embodiment of a multiplication logic circuit is schematically shown in block diagram form;

[0035] Fig.10 Another embodiment of a multiplication logic circuit is schematically shown in block diagram form;

[0036] Fig.11 Another embodiment of a logic circuit for calculating a bitwise AND logic is schematically shown in block diagram form;

[0037] Fig.12 An embodiment of a logic circuit for calculating a bitwise OR logic is schematically shown in block diagram form; and

[0038] Fig.13 An embodiment of a logic circuit for calculating a bitwise XOR logic is schematically shown in block diagram form. DETAILED DESCRIPTION

[0039] In the various drawings, similar features have been denoted by similar reference numerals. In particular, common structural and / or functional features between the various embodiments may have the same reference numerals and may be provided with the same structure, dimensions, and material properties.

[0040] For clarity, only operations and elements useful for understanding the embodiments described herein are shown and described in detail. The complete operation of the processor will not be disclosed here, and the embodiments disclosed below are compatible with most typical operation methods of the processor.

[0041] Unless otherwise specified, when referring to two elements being connected together, it means a direct connection without any intermediate elements other than conductors; and when referring to two elements being coupled together, it means the two elements may be connected or they may be coupled via one or more other elements.

[0042] In the following disclosure, unless otherwise stated, when referring to absolute position qualifiers (such as terms "front", "back", "top", "bottom", "left", "right", etc.), or relative position qualifiers (such as terms "above", "below", "upper", "lower", etc.), or orientation qualifiers (such as "horizontal", "vertical", etc.), reference is made to the direction shown in the figure.

[0043] Unless otherwise indicated, the expressions "approximately," "approximately," "substantially," and "about" mean within 10%, preferably within 5%.

[0044] Figure 1 The architecture of an embodiment of a processor 100 (CPU) is schematically shown in block diagram form.

[0045] The processor 100 is a processor configured to process masked data and masked instructions. More specifically, the processor 100 receives masked data Data_M and its mask Mask_D, and masked instruction Instr_M and its mask Mask_I as input. The processor provides masked address Add_M and its mask Mask_A, masked result data Result_M and its mask Mask_R as output, and may also provide masked data Data_S and its mask Mask_S stored by the processor. According to a variant embodiment, the processor 100 may directly provide an unmasked address as output.

[0046] The processor 100 is composed of several electronic circuits among the following:

[0047] - a register group 101 (DATA REG) configured to store masked data;

[0048] - Register group 102 (MASK REG), configured to store in register group 101

[0049] the stored masked data mask;

[0050] - Circuit 103 (INSTRUCTION DECODE EXECUTE) for decoding and executing

[0051] Run the command;

[0052] - Arithmetic and logic and address generation unit 104 (ALU AGU);

[0053] - Register 105 (SP / PC DATA), configured to store data and program pointers; and

[0054] - Register 106 (SP / PC MASK), configured to store a pointer mask.

[0055] The register group 101 receives masked data Data_M or masked result Result_M as input and provides masked data Data_S as output. The register group 101 is configured to store the masked data Data_M and the masked result Result_M during processing of the masked data Data_M and the masked result Result_M by the processor 100.

[0056] The register set 102 receives the data mask Mask_D and the result mask Mask_R as inputs and provides the mask Mask_S as output. The register set 102 is configured to store the data mask Mask_D and the result mask Mask_R during processing of the data mask Mask_D and the result mask Mask_R by the processor 100.

[0057] The decoding and instruction execution circuit 103 receives as input the masked instruction Instr_M and the instruction mask Mask_I and provides as output the operation code Opcode. The operation code Opcode is not masked. The circuit 103 unmasks the instruction Instr_M in order to determine the operation code Opcode.

[0058] The arithmetic and logic and address generation unit 104 receives masked data Data_S, mask Mask_S, masked data pointer Point_D, pointer mask Mask_P and operation code Opcode as input. Unit 104 provides masked address Add_M, address mask Mask_A, masked result data Result_M and result mask Mask_R as output. Unit 104 has two functions. The first function is to perform operation code Opcode by applying arithmetic and / or logic operation to masked data Data_S and mask Mask_S to provide masked result data Result_M and its mask Mask_R. The second function is to perform operation code Opcode so as to calculate address Add_M and its mask Mask_A. According to a variant, unit 104 can be composed of an arithmetic and logic unit and an address generation unit.

[0059] Register 105 receives masked result data Result_M as input, and provides masked data pointer Point_D as output.Register 105 is for example composed of a register storing a masked register pointer or a masked stack pointer (SP), and another register storing a masked program pointer (PC).The stack pointer is a pointer that references the address of the last reference stored in the reference register, or references the address of the next reference stored in the reference register.The program pointer is a pointer that references the address of the last opcode used, or references the address of the next opcode to be used.In the case described here, the masked data pointer Point_D is composed of the following pointers: a masked register pointer that references the address of the last data written in the memory, and a masked program pointer that references the address of the last opcode Opcode used by the unit 104.

[0060] Register 106 receives result mask Mask_R as input, and provides pointer mask Mask_P as output.Register 106 is similar to register 105, but is associated with mask.Therefore, register 106 is composed of a register storing register pointer mask and another register storing program pointer mask, for example.In the case described here, pointer mask Mask_P is a mask of masked data pointer Point_D stored in register 105.

[0061] The operating mode of the processor 100 is as follows. The processor 100 receives as input the instruction Instr_M and the masked data Data_M to be processed and its masks Mask_I and Mask_M. The instruction Instr_M is not masked and is then converted by the circuit 103 to provide the operation code Opcode. The masked data Data_M and its mask Mask_M are stored in the register groups 101 and 102, respectively. The unit 104 receives the operation code Opcode and the masked data Data_S to be processed and its mask Mask_S, as well as the masked data pointer Point_D and its mask Mask_P. The unit 104 performs different arithmetic and / or logical operations to provide masked result data Result_M and its mask Mask_R, and the address Add_M and its mask Mask_A. The unit 104 performs all its operations without performing a demasking operation on the masked data processed by all operations. In other words, the masked data remains masked throughout the entire processing performed on it by the unit 104. Combined with Figure 2 The unit 104 is disclosed in more detail. The masked result data Result_M may be stored in the data register bank 101 and used to obtain the masked data pointer Point_D. The result mask Mask_R may be stored in the register bank 102 and used to obtain the pointer mask Mask_P.

[0062] Figure 2 The block diagram schematically shows the Figure 1 More details of an example of a portion of the architecture of the disclosed unit 104 (ALU AGU). The portion disclosed herein is configured to apply arithmetic and / or logical operations on mask data Data_S and mask Mask_S provided to the unit 104.

[0063] Unit 104 includes:

[0064] - two masking circuits 1041 and 1044 (TRANSMASKING);

[0065] - Circuit 1042 (ARITH OPERATIONS), configured to perform arithmetic operations;

[0066] as well as

[0067] -Circuit 1043 (LOGIC OPERATIONS), configured to perform logic operations.

[0068] The masking circuit 1041 is a circuit configured to modify the masking type, which is used to mask the masked data Data_S. In fact, the masked data Data_S can be masked in two different ways. The first method of masking the masked data Data_S is to use one or more arithmetic operations to combine the reference and its mask, and thereby obtain the masked reference. As an example, the masked data Data_S is masked by using an addition operation, more specifically, by adding the mask to the reference that is desired to be masked. The second method of masking the masked data Data_S is to use one or more logical operations to combine the reference and its mask, and thereby obtain the masked reference. As an example, the masked data Data_S is masked by using a bitwise "exclusive OR" operation, more specifically, by performing a bitwise "exclusive OR" operation between the data and its mask.

[0069] According to a preferred embodiment, the masked data stored in the register set 101 preferably have the same masking type. According to one embodiment, the masking type used is arithmetic masking. As a variant, the masked data may have different masking types.

[0070] The masking circuit 1041 is specifically configured to modify the masking type used to adapt it to the masking type of the masking reference Data_S according to the operation that will subsequently be applied to the masking reference Data_S. More specifically, the circuit 1041 is configured to perform two mask conversion operations, the first operation making it possible to convert a mask of a logical type into a mask of an arithmetic type, and the second operation making it possible to convert a mask of an arithmetic type into a mask of a logical type. These two mask conversion operations do not include a de-masking operation on the masked data. In the example disclosed here, these two mask conversion operations do not modify the mask used; they can only modify the masked data. As a variant, the mask conversion operation can modify the mask associated with the masked data. In combination Figure 3 and 4 An example of a mask conversion operation is disclosed. Thus, circuit 1041 receives masked data Data_S and mask Mask_S as inputs, and provides masked data Data_A and its mask Mask_S, and masked data Data_L and its mask Mask_S as outputs. Masked data Data_A is masked by a mask of arithmetic type. Masked data Data_L is masked by a mask of logic type.

[0071] The masking circuit 1044 is a circuit having a functionality similar to that of the circuit 1041. The masking circuit 1044 differs from the circuit 1041 in that it receives masked data as input and its mask at the output of the circuits 1042 and 1043. The masking circuit 1044 makes it possible to adapt the type of masking of the masked data it receives for future storage of the masked data in registers of the register bank 101. The circuit 1044 provides as output the masked result data Result_M and its mask Mask_R.

[0072] It should be noted that if data arriving at circuit 1041 or circuit 1044 already has a mask type corresponding to the operation then requested, circuits 1041 and 1044 do not modify their mask types.

[0073] Circuit 1042 receives masked data Data_A and its mask Mask_S as input, and provides masked result data ResultA_M and its mask Mask_RA as output. Circuit 1042 is a circuit that implements arithmetic operations such as addition, calculation of complement, multiplication, bit shift operation, etc. Figures 5 to 10 Examples of circuits that allow these operations to be implemented are disclosed.

[0074] Circuit 1043 receives masked data Data_L and its mask Mask_S as input, and provides masked result data ResultL_M and its mask Mask_RL as output. Circuit 1043 is a circuit that implements logic operations such as bitwise AND, bitwise OR, bitwise XOR, etc. Figures 11 to 13 Examples of circuits that allow these operations to be implemented are disclosed.

[0075] In some cases, logical operations and arithmetic operations may be applied to execute the same instruction, so the masked result data ResultA_M and ResultL_M may be reused within the same cycle while being resent to masking circuit 1041 or masking circuit 1044 to adjust their masking types according to the operations to be applied to them.

[0076] Figure 3 and 4 It is shown in the figure about Figure 2 An example flow chart of a masked conversion operation used in the disclosed circuit 1041.

[0077] The masked reference A_M represents the reference A masked by the mask MA. The data A and A_M and the mask MA are binary words comprising n bits, n being a natural integer. As a variant, the data A, A_M and the mask MA are binary words having different numbers of bits.

[0078] exist Figure 3 and 4 In the example of , arithmetic masking is an additive type of masking, where the mask is added to the reference to be masked. More specifically, the masked reference A_M is given by the following formula:

[0079] A_M=(A+MA)mod2 n

[0080] in:

[0081] - "+" indicates addition; and

[0082] - "mod" means modulo operation.

[0083] Logical masking is masking using a bitwise XOR operation. More specifically, the masking reference A_M is given by the following formula:

[0084] A_M=A xor MA

[0085] "xor" represents the bitwise exclusive OR operation.

[0086] Figure 3 A masked conversion operation ArithToLogic is shown from a masked reference produced by an arithmetic masking operation to a masked reference produced by a logical masking operation.

[0087] Data B_M represents data B masked by mask MB using an arithmetic masking operation. Data B and B_M and mask MB are all binary words including n bits, where n is a natural integer.

[0088] The operation ArithToLogic takes as input the masked reference B_M and its mask MB and provides as output a new masked reference B_M'. The data B_M represents the data B masked by the mask MB using a logical masking operation.

[0089] In step 21 (Comp), the complement of the masked reference B_M is calculated! B_M. This step does not require the use of reference B; combined Figure 6 An exemplary circuit for implementing this operation is disclosed.

[0090] In step 22 (Carry), the carry digit CarryB is calculated according to the mask reference B_M and the mask MB. More specifically, the carry digit CarryB is given by the following formula:

[0091]

[0092] in:

[0093] - "i" is a natural integer from 0 to n-1;

[0094] - "x[i]" represents the bit of level i of binary word x;

[0095] - "." represents a bitwise AND logical operation; and

[0096] - "!x" represents the complement of the binary word x.

[0097] Step 22 does not require the use of an unmasked reference B. Figures 5 to 13 An example of a circuit configured to perform the operations used by the formula is disclosed. As an example, steps 21 and 22 may be performed simultaneously.

[0098] In step 23 (XOR), a new masked reference B_M' is calculated by performing the following operation:

[0099] B_M′=! B_M xor CarryB

[0100] about Fig.13 An exemplary circuit for performing a bitwise exclusive-OR operation is disclosed.

[0101] One advantage of the ArithToLogic operation is that it does not use the unmasked reference B to transform reference B_M to reference B_M'.

[0102] Figure 4A masked conversion operation ArithToLogic of data masked with a logical mask to data masked with an arithmetic mask is shown.

[0103] Reference C_M represents reference C masked by mask MC through a logical masking operation. Data C and C_M and mask MC are all binary words including n bits.

[0104] The operation LogicToArith uses as input a masked reference C_M and its mask MC and provides as output a new masked reference C_M'. The reference C_M represents the reference C masked by the mask MC through an arithmetic masking operation.

[0105] In step 31 (Carry), the carry digit CarryC is calculated according to the mask reference C_M and the mask MC. More specifically, the carry digit CarryC is given by the following formula:

[0106]

[0107] In step 32 (XOR), the new masked reference C_M' is calculated by performing the following operation bitwise:

[0108] C_M′=C_M xor CarryC

[0109] One advantage of the LogicToArith operation is that it does not use the unmasked reference C to convert reference C_M to reference C_M'.

[0110] Figures 5 to 10 shows a system configured to perform Figure 2 A circuit example of an arithmetic operation of circuit 1042 is disclosed.

[0111] In the examples disclosed in these figures, the arithmetic masking operation is related to Figure 3 and 4 Same as public.

[0112] Figure 5 Logic circuitry configured to implement the addition operation represented by block 41 (+) is schematically shown in block diagram form.

[0113] exist Figure 5 In the example shown, the addition operation uses two masked data D_M and E_M, and their masks MD and ME as input, and provides a masked reference F_M and its mask MF as output. The reference D_M (respectively E_M, F_M) is the result of arithmetic masking of the data D (respectively E, F) by the mask MD (respectively ME, MF). The masked reference F_M and the mask MF are given by the following relationship:

[0114]

[0115] As a variant, the addition operation may include more input data.

[0116] An advantage of this operation is that the data D and E are not necessary for calculating the masking reference F_M.

[0117] Figure 6 Schematically illustrated in block diagram form is a logic circuit 42 (Comp) configured to implement an operation for calculating a one's complement number.

[0118] exist Figure 6 In the example shown, the operation for calculating the complement of 1 includes as input a masked reference G_M and its mask MG, and provides as output a masked reference H_M and its mask MH. The references (G_M, H_M, respectively) are the result of arithmetic masking of the references (G, H, respectively) by the masks (MG, MH, respectively). The masked reference H_M and the mask MH are given by the following relationship:

[0119]

[0120] One advantage of this operation is that the reference G is not necessary for calculating the masking reference H_M.

[0121] According to one embodiment variant, the mask reference H_M and the mask MH are given by the following relations:

[0122]

[0123] The “-” indicates a subtraction operation.

[0124] Figure 7 A logic circuit 43 (Shift) configured to implement a bit shift operation is schematically shown in block diagram form.

[0125] exist Figure 7 In the example shown, the bit shift operation includes a masked reference I_M and its mask MI as input, and provides a masked reference J_M and its mask MJ as output. The references (respectively I_M, J_M) are the result of arithmetic masking of the data (respectively I, J) by the masks (respectively MI, MJ). The binary words I_M, J_M, I, J, MI, MJ are, for example, binary words with n bits, n being a natural integer. The bit shift operation also uses a binary word SelectLR as input to indicate to it whether the operation performed is a bit shift to the right or to the left. In the case of a bit shift to the left, the masked reference J_M and the mask MJ are given by the following relationship:

[0126]

[0127] The “*” indicates a multiplication operation.

[0128] Where m is the desired shift of the bits of the masked reference as input, and m is a natural integer less than or equal to n.

[0129] An advantage of this operation is that the data I are not necessary for calculating the masking reference J_M.

[0130] Figure 8 and 9 An embodiment of a logic circuit configured to implement a multiplication operation is schematically shown in block diagram form.

[0131] The multiplication operation uses two masked data K_M and L_M and their corresponding masks MK and ML as input, and provides a masked reference M_M and its mask MM as output. The reference K_M (respectively L_M, M_M) is the result of arithmetic masking of the reference K (respectively L, M) by the mask MK (respectively ML, MM). The binary words K_M, L_M, M_M, K, L, M, MK, ML and MM are binary words with n bits, n being a natural integer. The masked reference M_M and the mask MM are given, for example, by the following formula:

[0132]

[0133] Other expressions for the masked reference M_M and the mask MM may be considered.

[0134] Figure 8 A circuit 51 for implementing a multiplication operation is shown. The circuit 51 comprises:

[0135] - four multiplication circuits 511, 512, 513 and 514 (X); and

[0136] - Two adding circuits 515 and 516 (+).

[0137] The multiplication circuit 511 receives as input the masked reference K_M and the masked reference L_M and provides as output the multiplication of these data K_M*L_M.

[0138] The multiplication circuit 512 receives as input the masked reference K_M and the mask ML and provides as output the result of the multiplication K_M*ML.

[0139] The multiplication circuit 513 receives as input the masked reference L_M and the mask MK and provides as output the result of the multiplication L_M*MK.

[0140] The multiplication circuit 514 receives the mask MK and the mask ML as input and provides the result of the multiplication MK*ML as output.

[0141] Adding circuit 515 receives as input the result of the multiplication K_M*L_M of circuit 511 and the result of the multiplication MK*ML of circuit 514 and provides as output the masked reference M_M.

[0142] Addition circuit 516 receives as input the result K_M*ML of the multiplication of circuit 512 and the result M_L*MK of the multiplication of circuit 513 and provides as output a mask MM.

[0143] One advantage of the circuit 51 is that it does not use the unmasked data K and L to calculate the masked reference M_M and its mask MM.

[0144] Another advantage of the circuit 51 is that it allows the multiplication of two masked data to be performed in a single clock cycle.

[0145] Fig. 9 A circuit 52 is shown that implements a multiplication operation. The circuit 52 comprises:

[0146] - three selectors 521, 522 and 523;

[0147] - a multiplication circuit 524 (X);

[0148] - an adding circuit 525 (+);

[0149] - Switching circuit 526; and

[0150] -Register 527 (REG).

[0151] The selector 521 receives the mask reference K_M and the mask MK as input and provides a first binary word select1 as output.

[0152] The selector 522 receives the masked reference L_M and the mask ML as input and provides a second binary word select2 as output.

[0153] The multiplication circuit 524 receives as input the two binary words select1 and select2 and provides as output the result of the multiplication Prod.

[0154] The selector 523 receives a binary word corresponding to zero (0) (hereinafter referred to as a zero reference) and a time delay reference Temp as inputs, and provides a third binary word select3 as an output.

[0155] The adding circuit 525 receives as input the result of the multiplication Prod and the binary word select3 and provides as output the result of the addition Sum.

[0156] The switching circuit 526 receives the result Sum of the adding circuit 525 as input, and uses the result Sum to form a masked reference M_M, a mask MM, or a time delay reference Temp as output.

[0157] Register 527 receives as input a time delay reference Temp and provides as output the same time delay reference Temp. Register 527 allows the time delay reference Temp to be stored between different cycles of operation.

[0158] The circuit 52 makes it possible to perform a multiplication operation by using four clock cycles. An example of calculation steps used within four clock cycles is as follows.

[0159] In the first clock cycle, the selector 521 selects the masked reference K_M, and therefore the binary word select1 is equal to the masked reference K_M. The selector 522 selects the masked reference L_M, and therefore the binary word select2 is equal to the masked reference L_M. The multiplication circuit 524 provides the result Prod of the product of the binary words select1 and select2. Therefore, the result Prod is equal to the product of the masked reference K_M and the masked reference L_M. The selector 523 selects the zero reference, and therefore the binary word select3 is equal to the zero reference. The addition circuit 525 provides the result Sum of the sum of the product Prod and the binary word select3. Therefore, the result Sum is equal to the product of the masked reference K_M and the masked reference L_M. The switching circuit 526 provides the result Sum to the time delay reference Temp so that the result Sum is stored in the register 527.

[0160] In the second clock cycle, the selector 521 selects the mask MK, and thus the binary word select1 is equal to the mask MK. The selector 522 selects the mask ML, and thus the binary word select2 is equal to the mask ML. The multiplication circuit 524 provides the result Prod of the product of the binary words select1 and select2. Therefore, the result Prod is equal to the product of the mask MK and the mask ML. The selector 523 selects the time delay reference Temp from the register 527, and thus the binary word select3 is equal to the time delay reference Temp. The addition circuit 525 provides the result Sum of the sum of the product Prod and the binary word select3. Therefore, the result Sum is equal to:

[0161] Sum=K_M*L_M+MK*ML

[0162] The switching circuit 526 provides the result Sum to the masked reference M_M.

[0163] In the third clock cycle, the selector 521 selects the mask reference K_M, and therefore the binary word select1 is equal to the mask reference K_M. The selector 522 selects the mask ML, and therefore the binary word select2 is equal to the mask ML. The multiplication circuit 524 provides the result Prod of the product of the binary words select1 and select2. Therefore, the result Prod is equal to the product of the mask reference K_M and the mask ML. The selector 523 selects the zero reference, and therefore the binary word select3 is equal to the zero reference. The addition circuit 525 provides the result Sum of the sum of the product Prod and the binary word select3. Therefore, the result Sum is equal to the product of the mask reference K_M and the mask ML. The switching circuit 526 provides the result Sum to the time delay reference Temp so that the result Sum is stored in the register 527.

[0164] In the fourth clock cycle, the selector 521 selects the mask reference L_M, and thus the binary word select1 is equal to the mask reference L_M. The selector 522 selects the mask MK, and thus the binary word select2 is equal to the mask MK. The multiplication circuit 524 provides the result Prod of the product of the binary words select1 and select2. The result Prod is equal to the product of the mask reference L_M and the mask MK. The selector 523 selects the time delay reference Temp, and thus the binary word select3 is equal to the time delay reference Temp. The addition circuit 525 provides the result Sum of the sum of the product Prod and the binary word select3. Then the result Sum is equal to:

[0165] Sum=K_M*ML+L_M*MK

[0166] The switching circuit 526 provides the result Sum to the mask MM.

[0167] One advantage of the circuit 52 is that the multiplication operation can be implemented by using a single multiplication circuit and a single addition circuit. Thus, the circuit 52 can have a smaller size.

[0168] Fig.10 An embodiment of an addition logic circuit configured to implement a multiply-accumulate operation (MAC) is schematically illustrated in block diagram form. Fig.10 The circuit 53 is shown in more detail.

[0169] The multiplication-accumulation operation uses two masked data K_M and L_M and their corresponding masks MK and ML, as well as a masked reference N_M and its mask MN as input. The operation provides a masked reference M_M and its mask MM as output. The reference N_M is the result of arithmetic masking of the reference N by the mask MN. The binary words N_M, N and MN are, for example, binary words with n bits, where n is a natural integer. The multiplication-accumulation operation is defined by the following formula:

[0170] M=K*L+N

[0171] The base M_M and the mask MM are given by the following formulas:

[0172]

[0173] Other expressions for the masked reference M_M and the mask MM may be considered.

[0174] Fig.10 The circuit 53 includes Fig. 9 Hereinafter, these similar elements will not be described in detail, and only the differences between the two circuits 52 and 53 will be emphasized. Circuit 52 includes:

[0175] - four selectors 521, 522, 523 and 531;

[0176] - a multiplication circuit 524;

[0177] - Adding circuit 525;

[0178] - Switching circuit 526; and

[0179] -Register 527.

[0180] The difference between circuit 53 and circuit 52 is that in circuit 53, selector 523 does not receive a zero reference, but receives a binary word select4 and a time delay reference Temp.

[0181] The binary word select4 is the output of the selector 531. The selector 531 receives as input the masked reference N_M and its mask MN.

[0182] The circuit 53 enables a multiply-accumulate operation to be performed by using four clock cycles. An example of the calculation steps used during the four clock cycles is as follows.

[0183] In the first clock cycle, the selector 521 selects the masked reference K_M, and therefore the binary word select1 is equal to the masked reference K_M. The selector 522 selects the masked reference L_M, and therefore the binary word select2 is equal to the masked reference L_M. The multiplication circuit 524 provides the result Prod of the product of the binary words select1 and select2. Therefore, the result Prod is equal to the product of the masked reference K_M and the masked reference L_M. The selector 531 selects the masked reference N_M, and therefore the binary word select4 is equal to the masked reference N_M. The selector 523 selects the binary word select4, and therefore the binary word select3 is equal to the masked reference N_M. The addition circuit 525 provides the result Sum of the sum of the product Prod and the binary word select3. Therefore, the result Sum is given by the following formula:

[0184] Sum=K_M*L_M+N_M

[0185] The switching circuit 526 provides the result Sum to the time delay reference Temp by storing the result Sum in the register 527 .

[0186] In the second clock cycle, the selector 521 selects the mask MK, and thus the binary word select1 is equal to the mask MK. The selector 522 selects the mask ML, and thus the binary word select2 is equal to the mask ML. The multiplication circuit 524 provides the result Prod of the product of the binary words select1 and select2. Therefore, the result Prod is equal to the product of the mask MK and the mask ML. The selector 523 selects the time delay reference Temp stored in the register 527, and thus the binary word select3 is equal to the time delay reference Temp. The addition circuit 525 provides the result Sum of the sum of the product Prod and the binary word select3. Then the result Sum is equal to:

[0187] Sum=K_M*L_M+MK*ML+N_M

[0188] The switching circuit 526 provides the result Sum to the masked reference M_M.

[0189] In the third clock cycle, the selector 521 selects the mask reference K_M, and therefore the binary word select1 is equal to the mask reference K_M. The selector 522 selects the mask ML, and therefore the binary word select2 is equal to the mask ML. The multiplication circuit 524 provides the result Prod of the product of the binary words select1 and select2. Therefore, the result Prod is equal to the product of the mask reference K_M and the mask ML. The selector 531 selects the mask MN, and therefore the binary word select4 is equal to the mask MN. The selector 523 selects the binary word select4, and therefore the binary word select3 is equal to the mask MN. The addition circuit 525 provides the result Sum of the sum of the product Prod and the binary word select3. Then the result Sum is equal to:

[0190] Sum=K_M*ML+MN

[0191] Switching circuit 526 provides the result Sum to the time delay reference Temp.

[0192] In the fourth clock cycle, the selector 521 selects the mask reference L_M, and thus the binary word select1 is equal to the mask reference L_M. The selector 522 selects the mask MK, and thus the binary word select2 is equal to the mask MK. The multiplication circuit 524 provides the result Prod of the product of the binary words select1 and select2. The result Prod is equal to the product of the mask reference L_M and the mask MK. The selector 523 selects the time delay reference Temp, and thus the binary word select3 is equal to the time delay reference Temp. The addition circuit 525 provides the result Sum of the sum of the product Prod and the binary word select3. Then the result Sum is equal to:

[0193] Sum=K_M*ML+L_M*MK+MN

[0194] The switching circuit 526 provides the result Sum to the mask MM.

[0195] As a variant, the selector 523 may also receive a zero reference to enable execution of the Fig. 9 Similar multiplication operations are disclosed.

[0196] One advantage of the circuit 53 is that the multiplication-accumulation operation can be realized by using a single multiplication circuit and a single addition circuit. Then, the circuit 53 can have a smaller size.

[0197] Another advantage of circuit 53 is that it can perform multiply-accumulate operations without using the unmasked data K, L and N.

[0198] Figures 11 to 13is configured to execute about Figure 2 A circuit example of a logical operation of the circuit 1043 is disclosed.

[0199] In the examples disclosed in these figures, the logical masking operation is related to Figure 3 and 4 Same as public.

[0200] Fig.11 Logic circuit 61 (OR) configured to implement a bitwise OR logic operation is schematically shown in block diagram form.

[0201] exist Fig.11 In the example shown, a bitwise OR logic operation uses two masked data O_M and P_M and their corresponding masks MO and MP as inputs, and provides a masked reference Q_M and its mask MQ as output. The masked reference O_M (respectively P_M, Q_M) is the result of logically masking the data O (respectively P, Q) by the mask MO (respectively MP, MQ). The masked reference Q_M and its mask MQ are given by the following relationship, performed bit by bit:

[0202]

[0203] Here, "or" represents a bitwise "or" logical operation.

[0204] The circuit 61 can be implemented by using, for example, an OR gate having four inputs and four AND gates having three inputs.

[0205] One advantage of circuit 61 is that it does not use the unmasked data O and P to calculate the masked reference Q_M.

[0206] Fig.12 Logic circuit 62 (AND) configured to implement a bitwise AND logic operation is schematically shown in block diagram form.

[0207] exist Fig.12 In the example shown, the bitwise AND logic operation uses two masked data R_M and S_M and their corresponding masks MR and MS as inputs, and provides a masked reference T_M and its mask MT as output. The masked reference R_M (respectively S_M, T_M) is the result of logically masking the data R (respectively S, T) by the mask MR (respectively MS, MT). The masked reference T_M and the mask MT are given by the following relationship:

[0208]

[0209] Circuit 62 can be implemented by using, for example, an OR gate with four inputs and four AND gates with three inputs. As an example, Fig.11 and12 The circuits 61 and 62 can be implemented by similar circuits.

[0210] One advantage of circuit 62 is that it does not use the unmasked data R and S to calculate the masked reference T_M.

[0211] Fig.13 Logic circuit 63 configured to implement a bitwise exclusive OR logic operation (XOR) is schematically shown in block diagram form.

[0212] exist Fig.13 In the example shown, a bitwise XOR logic operation uses two masked data U_M and V_M and their corresponding masks MU and MV as inputs, and provides a masked reference W_M and its mask MW as outputs. The masked reference U_M (V_M, W_M respectively) is the result of logically masking the data U (V, W respectively) by the mask MU (MV, MW respectively). The masked reference W_M and the mask MW are given by the following relationship:

[0213]

[0214] One advantage of circuit 62 is that it does not use the unmasked data U and V to calculate the masked reference W_M.

[0215] Various embodiments and variations have been described. Those skilled in the art will appreciate that certain features of these embodiments may be combined, and those skilled in the art will readily appreciate other variations. In particular, other arithmetic and logical operations may be considered. In addition, the examples of logical and arithmetic masking mentioned in this disclosure are merely examples, and other masking operations may be considered.

[0216] Furthermore, another example of a portion of the architecture of the arithmetic and logic unit 104 may include a first masking circuit preceding the circuit implementing the logic operation and a second masking circuit preceding the circuit implementing the arithmetic operation, each masking circuit enabling adaptation of the masking type prior to the requested operation.

[0217] Finally, based on the functional description provided above, actual implementation of the embodiments and variations described herein is within the capabilities of those skilled in the art.

Claims

1. A method for operating an arithmetic and logic unit of a central processing unit (CPU), the method comprising: The arithmetic-to-logic circuit of the first masking circuit (1041) in the arithmetic and logic unit receives the arithmetic-masked first data and the first mask; generating, by the complementary circuit of the arithmetic-to-logic circuit, masked complementary data based on the arithmetically masked first data; generating, by a first carry circuit of the arithmetic-to-logic circuit, an arithmetic carry number according to the arithmetic masked first data and the first mask; generating, by a first XOR circuit of the arithmetic-to-logic circuit, a first logically masked data according to the masked complementary data and the arithmetic carry number; The logic-to-arithmetic circuit of the first masking circuit (1041) in the arithmetic and logic unit receives the logic-masked second data and the second mask; A second carry circuit of the logic-to-arithmetic circuit generates a logical carry number according to the logically masked second data and a second mask; generating, by the second XOR circuit of the logic-to-arithmetic circuit, the arithmetic masked second data according to the logic masked second data and the logic carry digit; performing an arithmetic operation on the arithmetic masked first data, the first mask, the arithmetic masked second data and the second mask by an arithmetic circuit (1042) to generate arithmetic masked intermediate result data and a first intermediate result mask; The logic circuit (1043) performs a logic operation on the first data of the logic mask, the first mask, the second data of the logic mask and the second mask to generate the intermediate result data of the logic mask and the second intermediate result mask; The second masking circuit (1044) generates final masked result data and a final result mask according to the arithmetic masked intermediate result data, the first intermediate result mask, the logical masked intermediate result data and the second intermediate result mask; as well as The arithmetic and logic unit maintains the arithmetic and logic unit masked first data and the logic masked second data throughout processing of the arithmetic and logic unit on the arithmetic and logic unit.

2. The method according to claim 1, further comprising: The masked address of the final masked result data and the associated address mask are calculated by the address generation unit of the CPU.

3. The method according to claim 1, further comprising: The arithmetic-masked first data, the logical-masked first data, the arithmetic-masked second data, and the logical-masked second data are stored in a register group of the CPU.

4. The method according to claim 3, wherein the register group includes at least one first register group for the arithmetic masked first data, the logical masked first data, the arithmetic masked second data, and the logical masked second data, and at least one second register group for the first mask and the second mask.

5. The method according to claim 1, further comprising: The mask pointer is stored in a register of the CPU.

6. The method according to claim 5, further comprising: At least one masked register pointer and at least one masked program pointer are stored in the register.

7. The method of claim 5, wherein the masked pointer stored in the register comprises a pointer to reference data and a pointer mask. 8 . The method according to claim 1 , wherein the arithmetically masked first data is obtained by performing an arithmetic masking operation on the first data to be masked using the first mask.

9. The method according to claim 1, wherein the logically masked first data is obtained by performing a logical operation on the masked complementary data and the arithmetic carry number, and the logically masked second data is obtained by performing a logical masking operation on the second data to be masked using the second mask.

10. A central processing unit (CPU), comprising: Arithmetic and logic unit, including: A first masking circuit (1041) comprising: Arithmetic to logic circuits, including: a complementary circuit configured to receive the arithmetically masked first data and generate masked complementary data; a first carry circuit configured to receive the arithmetic masked first data and a first mask and generate an arithmetic carry number; and a first XOR circuit coupled to the complementary circuit and the first carry circuit and configured to generate a logically masked first data; and Logic to arithmetic circuits, including: a second carry circuit configured to receive the logically masked second data and the second mask and generate a logical carry number; and a second XOR circuit coupled to the second carry circuit and configured to receive the logically masked second data and generate an arithmetic masked second data; an arithmetic circuit coupled to the first masking circuit and configured to apply an arithmetic operation to the arithmetic masked first data, the first mask, the arithmetic masked second data, and the second mask to generate arithmetic masked intermediate result data and a first intermediate result mask; a logic circuit coupled to the second masking circuit and configured to apply a logic operation to the logically masked first data, the first mask, the logically masked second data, and the second mask to generate logically masked intermediate result data and a second intermediate result mask; and a second masking circuit (1042) coupled to the arithmetic circuit and the logic circuit and configured to generate final masked result data and a final result mask; The arithmetic and logic unit is configured to keep the first arithmetic masked data and the second logical masked data masked throughout the processing of the first arithmetic masked data and the second logical masked data in the arithmetic and logic unit. 11 . The CPU according to claim 10 , wherein the arithmetic and logic unit is further configured to calculate a masked address of the final masked result data and an associated address mask. 12 . The CPU according to claim 10 , wherein the CPU further comprises a register group configured to store the arithmetic-masked first data, the logical-masked first data, the arithmetic-masked second data, and the logical-masked second data.

13. The CPU according to claim 12, wherein the register group includes at least one first register group for the arithmetic masked first data, the logical masked first data, the arithmetic masked second data, and the logical masked second data, and at least one second register group for the first mask and the second mask.

14. The CPU of claim 10, wherein the CPU further comprises a register configured to store a mask pointer.

15. The CPU of claim 14, wherein the register is configured to store at least one masked register pointer and at least one masked program pointer.

16. The CPU according to claim 14, wherein the masked pointer stored in the register includes a pointer to reference data and a pointer mask.

17. The CPU according to claim 10, wherein the arithmetically masked first data is obtained by performing an arithmetic masking operation on the first data to be masked using the first mask, and wherein the arithmetically masked second data is obtained by performing a logical masking operation on the logically masked second data and the logical carry number.

18. The CPU according to claim 10, wherein the logically masked first data is obtained by performing a logical operation on the masked complementary data and the arithmetic carry number, and the logically masked second data is obtained by performing a logical masking operation on the second data to be masked using the second mask.

19. The CPU according to claim 10, wherein the second masking circuit comprises: a second arithmetic-to-logic circuit configured to receive the arithmetic-masked intermediate result data; and a first intermediate result mask; as well as The second logic-to-arithmetic circuit is configured to receive the logic-masked intermediate result data and a second intermediate result mask. 20 . The CPU according to claim 19 , wherein the second arithmetic-to-logic circuit is configured to convert the arithmetic-masked intermediate result data into logic-masked final result data.

21. The CPU according to claim 19, wherein the second logic-to-arithmetic circuit is configured to convert the logic-masked intermediate result data into the arithmetic-masked final result data.