WO2010103928A1 - 演算装置及びプログラム - Google Patents

演算装置及びプログラム Download PDF

Info

Publication number
WO2010103928A1
WO2010103928A1 PCT/JP2010/052904 JP2010052904W WO2010103928A1 WO 2010103928 A1 WO2010103928 A1 WO 2010103928A1 JP 2010052904 W JP2010052904 W JP 2010052904W WO 2010103928 A1 WO2010103928 A1 WO 2010103928A1
Authority
WO
WIPO (PCT)
Prior art keywords
bits
index
data
calculation table
computer
Prior art date
Application number
PCT/JP2010/052904
Other languages
English (en)
French (fr)
Inventor
小池 正修
Original Assignee
株式会社 東芝
東芝ソリューション株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社 東芝, 東芝ソリューション株式会社 filed Critical 株式会社 東芝
Priority to EP10750682.6A priority Critical patent/EP2410503A4/en
Publication of WO2010103928A1 publication Critical patent/WO2010103928A1/ja
Priority to US13/227,648 priority patent/US8631249B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/50Adding; Subtracting
    • G06F7/505Adding; Subtracting in bit-parallel fashion, i.e. having a different digit-handling circuit for each denomination
    • G06F7/5057Adding; Subtracting in bit-parallel fashion, i.e. having a different digit-handling circuit for each denomination using table look-up; using programmable logic arrays
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/76Arrangements for rearranging, permuting or selecting data according to predetermined rules, independently of the content of the data
    • G06F7/764Masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/002Countermeasures against attacks on cryptographic mechanisms
    • H04L9/003Countermeasures against attacks on cryptographic mechanisms for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/002Countermeasures against attacks on cryptographic mechanisms
    • H04L9/005Countermeasures against attacks on cryptographic mechanisms for timing attacks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/72Indexing scheme relating to groups G06F7/72 - G06F7/729
    • G06F2207/7219Countermeasures against side channel or fault attacks
    • G06F2207/7223Randomisation as countermeasure against side channel attacks
    • G06F2207/7233Masking, e.g. (A**e)+r mod n
    • G06F2207/7242Exponent masking, i.e. key masking, e.g. A**(e+r) mod n; (k+r).P
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/04Masking or blinding

Definitions

  • the present invention provides, for example, the size of a pre-calculation table required when arithmetic mask data with an arithmetic mask so as to have resistance to side channel analysis is converted into logical mask data with a logical mask.
  • the present invention relates to an arithmetic device and a program that can reduce the size of the program.
  • Cryptographic technology has become an indispensable technology for recent information and communication technologies.
  • Examples of this type of encryption technology include SSL (Secure Socket Layer), which is a communication encryption technology, and an electronic signature that can detect whether a message has been tampered with. These support the digitization of society as part of PKI (Public Key Infrastructure).
  • attack techniques for cryptographic techniques are also becoming more sophisticated.
  • side channel analysis in which processing time and power consumption of a cryptographic processor are measured and secret information inside the cryptographic processor is analyzed from the measurement result has become a real threat.
  • timing analysis and power analysis are known.
  • FIG. 7 is a schematic diagram showing a data conversion unit at the final 16th stage in the DES encryption apparatus.
  • the result of bit transposing IP ⁇ 1 of the output data L 16 and R 16 is the ciphertext output from the DES encryption device.
  • the output data L 16 and R 16 are also known to the attacker.
  • the 32-bit input data R 15 is expanded to 48-bit data by E transposition.
  • Data after expansion is taken is exclusive OR of the 48-bit key data K 16.
  • 48-bit data after the exclusive OR is divided into 6-bit eight divided data, the divided data respectively S box (S-box) S 1, S 2, ..., are input to the S 8.
  • Each S box has 6-bit input and 4-bit output, and a total of 32-bit output data is obtained.
  • This 32-bit output data is converted into another 32-bit data by P transposition, and then exclusive ORed with the input data L 15 to become one output data L 16 .
  • the other output data R 16 is obtained by outputting the input data R 15 as it is.
  • the attacker collects the power consumption waveform v i (t) for the DES processing of 1,000 samples while replacing the input plaintext M i .
  • t represents a discrete time
  • i represents a sample number (where 0 ⁇ i ⁇ 999).
  • One output of one S box s at the 16th stage is set as a target bit.
  • the 6-bit input data c in the S box s can be derived by tracing backward from the output data L 16 .
  • As the input data c of the S box there is a 6-bit partial key k j exclusive-ORed with the input data c in addition to the input data c.
  • this partial key k j as an unknown variable, one bit of the target S box output is written as s i (k j , c i ).
  • the difference average trace T j (t) is calculated by the following equation.
  • a logical mask is used for a cryptographic algorithm composed of logical operations
  • an arithmetic mask is used for a cryptographic algorithm composed of arithmetic operations. It is efficient that the calculation used for masking and the calculation of the cryptographic algorithm are interchangeable. In other words, when performing cryptographic algorithm operations on masked data, the operation result after removing the mask at the end is the same as the operation result when masking is not performed from the beginning. The operation used for is defined. In general, common key cryptosystems often use logical masks, and public key cryptosystems often use arithmetic masks.
  • the common key cryptosystem includes IDEA (International Data Encryption Algorithm), SEED, and the hash function SHA-1 (Secure Hash Algorithm 1).
  • IDEA International Data Encryption Algorithm
  • SEED SEED
  • hash function SHA-1 Secure Hash Algorithm 1
  • x ′ x ⁇ R (where ⁇ is a symbol representing exclusive OR)
  • a symbol representing exclusive OR
  • A x-R mod 2 w
  • w 32 bits.
  • the simplest method for converting the logic mask data x ′ to the arithmetic mask data A is a method of calculating (x ′ ⁇ R) ⁇ R mod 2 w .
  • a conversion method from the arithmetic mask data A to the logical mask data x 'in the [CT2003] method will be described with reference to FIGS.
  • the unit for performing the operation is b bits.
  • b is a divisor of w
  • the pre-calculation table G is a table composed of 2 b element data, and each element data is b bits.
  • the arithmetic mask data A can be converted into a logical mask x ′ by obtaining the element data G [A] of the pre-calculation table G. The reason is as follows.
  • FIG. 9 shows an algorithm for converting the arithmetic mask data A to the logical mask data x ′ by the [CT2003] method when k> 1 (ie, w> b).
  • k k ⁇ b bits of arithmetic mask data A and a number R are input
  • w bits of logical mask data x ′ are output.
  • step S130 the random number r is subtracted from the arithmetic mask data A under mod 2 mb (step S130).
  • the number R LSB splitting from (Least Significant Bit) in b th bit values of the number R 2 having R 1 and the lower-level (step S140). That is, the upper number R 1 is the upper (m ⁇ 1) b bits of the number R, and the lower number R 2 is the lower b bits.
  • the lower number R 2 is added to the arithmetic mask data A under mod 2 mb (step S150).
  • m 1 for the integer m (step S160).
  • the higher-order logic mask data x ′ 1 is calculated as follows (steps S170 and S180).
  • the arithmetic mask data A is divided into upper arithmetic mask data A 1 and lower arithmetic mask data A 2 in the same manner as the number R (step S161).
  • step S 130 and step S 150 correspond to the upper arithmetic mask data A 1 .
  • the following equations are calculated (steps S 162 and S 163).
  • “carry” may be read as “carry”.
  • the pre-calculation table C and the b-bit random number ⁇ are used to mask the carry information when adjusting the carry (carry) from the lower digits in steps S130 and S150.
  • the pre-calculation table C is defined as follows for each integer I from 0 to 2 b ⁇ 1.
  • the pre-calculation table C is a table composed of 2 b element data, and each element data is b bits.
  • two b ⁇ 2 b bits are stored as areas for storing the pre-calculation tables G and C.
  • An area is required.
  • a small storage capacity such as an IC card
  • 512-byte pre-calculation tables G and C there is a problem that resources are squeezed or cannot be implemented.
  • this problem is caused by a pre-calculation table required when the number A of kb bits and the number r of b bits are added together to obtain an addition result of upper (k ⁇ 1) b bits. It can be solved if the size of can be reduced. In other words, if the size of the pre-calculation table C required when the carry (the value of the (b + 1) th bit generated by A 2 + r) in step S130 and step S150 is associated with the upper arithmetic mask data A 1 can be reduced. It is thought that can be solved.
  • An object of the present invention is to perform an operation capable of reducing the size of a pre-calculation table required when the number A of kb bits and the number r of b bits are added together to obtain an addition result of upper (k ⁇ 1) b bits To provide an apparatus and a program.
  • the upper (k-1) b Number of kb bits consisting of several A 1 and lower b number of bits A 2-bit A (where, b> 4), the number r of b bits
  • An arithmetic unit capable of propagating a carry from the addition result with the number r to the number A 1 based on the pre-calculation table C ′, the means for generating the b-bit random number ⁇ ,
  • a memory for storing a pre-calculation table C ′ having an index y and each element data C ′ [y] associated with each index y
  • one aspect of the present invention is expressed as an apparatus, the present invention is not limited to an apparatus, and may be expressed as a computer-readable storage medium storing a method, a program, and a program.
  • the upper b / 2-bit value A H of the lower-order b-bit number A 2 of the number A and the upper-order of the random number r the sum of b / 2-bit value r H a H + r H and the number sum of the lower b / 2-bit value r L values from the low b / 2 bits of the a 2 a L and the random number r a L + r L
  • the element data of the pre-calculation table C ′ is set so as to indicate whether or not A 2 + r is carried, the number of kb bits A and b bits are compared with the method described in the [CT2003] method. It is possible to reduce the size of the pre-calculation table required when adding the number r to each other to obtain the addition result of the upper (k ⁇ 1) b bits.
  • the size of the pre-calculation table required when the number A of kb bits and the number r of b bits are added together to obtain the addition result of the upper (k ⁇ 1) b bits. Can be reduced.
  • FIG. 1 is a schematic diagram of a computing device according to the first embodiment of the present invention.
  • FIG. 2 is a flowchart showing a procedure for generating the pre-calculation table C in the embodiment.
  • FIG. 3 is a diagram illustrating an example of the pre-calculation table C in the embodiment.
  • FIG. 4 is a flowchart showing an addition procedure in the embodiment.
  • FIG. 5 is a flowchart showing a conversion procedure from an arithmetic mask to a logical mask applied to the arithmetic device according to the second embodiment of the present invention.
  • FIG. 6 is a flowchart for explaining the outline of the present invention.
  • FIG. 7 is a diagram illustrating the 16th stage of a general DES data conversion unit.
  • FIG. 1 is a schematic diagram of a computing device according to the first embodiment of the present invention.
  • FIG. 2 is a flowchart showing a procedure for generating the pre-calculation table C in the embodiment.
  • FIG. 3 is a diagram
  • FIG. 8 is a diagram showing an example of a conventional pre-calculation table G.
  • FIG. 9 is a flowchart showing a conversion procedure from a conventional arithmetic mask to a logical mask.
  • FIG. 10 is a diagram showing an example of a conventional pre-calculation table C. As shown in FIG.
  • the number of the upper b / 2 bits of the integer A is represented as A H
  • the number of the lower b / 2 bits is represented as A L
  • the number of upper b / 2 bits is represented as r H
  • the precalculation table C ′ is generated so that the value ⁇ (random number) is read when the precalculation table C ′ is referred to.
  • a b-bit value ⁇ is obtained (where 2 ⁇ 2 b / 2 ⁇ y ⁇ 3 ⁇ 2 b / 2 ⁇ r L ) (2 b / 2 ⁇ r L ) .
  • the size of the pre-calculation table C ′ is a value obtained by adding all these sizes. Specifically, the size of (2 b / 2 ⁇ r H ⁇ 1) ⁇ b bits and 2 b / 2 ⁇ b bits, r H ⁇ b bits, 2 b / 2 ⁇ b bits, 1 ⁇ b bits, 2 b / 2 ⁇ r L ⁇ b It is a value obtained by adding the bit size and the size of r L ⁇ b bits. That is, the size of the pre-calculation table C ′ is 4 ⁇ 2 b / 2 ⁇ b bits, that is, 4b ⁇ 2 b / 2 bits.
  • the size of the pre-calculation table can be reduced in the [CT2003] method. For this reason, it becomes easier to mount on a device such as an IC card that has severe restrictions on resources.
  • FIG. 1 is a schematic diagram showing the configuration of an arithmetic device according to the first embodiment of the present invention.
  • the arithmetic device 101 is configured as a cryptographic processing unit of a computer such as an IC card, and performs cryptographic processing by hardware or software. Specifically, it includes a CPU (Central Processing Unit) 102, an input / output unit 103, a program storage unit 104, a random number generation unit 105, a volatile memory 106, and a bus 107.
  • the arithmetic device 101 can be implemented with either a hardware configuration or a combination configuration of hardware resources and software.
  • a program that is installed in advance from a network or a computer-readable storage medium M into a computer serving as an arithmetic device and realizes the functions of the arithmetic device 101 is used.
  • each function is realized by the CPU 102 executing the program stored in the program storage unit 104.
  • This program includes at least a subprogram for data addition.
  • the CPU 102 has a function of executing the processing shown in FIGS. 2, 4, and 5 by executing the program stored in the program storage unit 104.
  • the input / output unit 103 is an interface between the inside of the arithmetic unit 101 and the outside. 101 to output to the outside.
  • the program storage unit 104 is a storage device that can be read from the CPU 102, and is, for example, a ROM (read-only memory) or an EEPROM (electrically rewritable ROM), and performs the processing shown in FIGS.
  • the program is stored.
  • the program storage unit 104 may be configured to install and hold a program from the outside.
  • the random number generation unit 105 is controlled by the CPU 102 to generate a random number, and has a function of generating, for example, a b-bit random number ⁇ .
  • the random number generation unit 105 may be realized by independent hardware, or may be realized by the CPU 102 and a program. Alternatively, the random number generation unit 105 may be omitted from the arithmetic unit 101 and an externally generated random number may be input from the input / output unit 103.
  • the volatile memory 106 is a storage device that can be read / written from the CPU 102, and is, for example, a RAM (Random Access Memory), for example, a pre-calculation table C ′, a number A, a number r, a random number ⁇ , and an addition result. As described above, data necessary for calculation, data in the middle of calculation, calculation result, and the like are stored.
  • a RAM Random Access Memory
  • Input-output unit 103 is provided with an upper (k-1) number of b bits A 1 and lower b number of kb bits consisting of several A 2-bit A (where, b> 4), the number r of b bits, these
  • the addition command for the numbers A and r is received from, for example, a cryptographic processing unit (not shown)
  • the numbers A and r and the addition command are input to the CPU 102.
  • the numbers A, A 1 and A 2 are also called “arithmetic mask data”.
  • the CPU 102 Upon receiving these numbers A and r and an addition command, the CPU 102 adds these numbers A and r and obtains the addition result of the upper (k ⁇ 1) b bits as shown in FIG. In order to generate the pre-calculation table C ′, the random number generation unit 105 is activated.
  • the random number generation unit 105 when activated by the CPU 102, generates a b-bit random number ⁇ (step S210).
  • This random number ⁇ is sent to the CPU 102 and stored in the volatile memory 106 from the CPU 102.
  • step S210 has been described by taking the case of the first execution as an example. However, the present invention is not limited to this, and can be executed at any timing as long as it is before steps S250, S260, S270, and S280 using random number ⁇ . It is. Further, the following steps S220 to S280 can be executed in an arbitrary order.
  • the CPU 102 determines (4 ⁇ 2 b / 2 ) indexes y (where 0 ⁇ y ⁇ 4 ⁇ 2 b / 2 ) and element data C ′ [y] associated with each index y. Is written in the volatile memory 106.
  • Each element data C ′ [y] has (4 ⁇ 2 b / 2 ) pieces, and is a b-bit value that can be individually read by each index y. However, at this stage, the value of each element data C ′ [y] is not set.
  • the index y is an integer.
  • the CPU 102 converts the element data C ′ [y] from the first to 2 b / 2 items of the pre-calculation table C ′ in the volatile memory 106 into an index y and a number r of 0 ⁇ y ⁇ 2 b / 2. based on the number r H of the upper b / 2 bits, it is set with the following values (steps S220 ⁇ S240).
  • the value of the upper element data C ′ [y] indicates which element data C ′ [] of the pre-calculation table should be viewed next in accordance with the value of the upper calculated mask data A H.
  • C ′ [2 b / 2 ] for the upper case
  • C ′ [2 ⁇ 2 b / 2 ] for the second case
  • C ′ [3 ⁇ 2 b / 2 ] for the third case. Represents.
  • the CPU 102 stores the element data C ′ [y] from the (2 b / 2 +1) th to the (2 ⁇ 2 b / 2 ) th in the pre-calculation table C ′ in the volatile memory 106 as 2 Based on the index y of b / 2 ⁇ y ⁇ 2 ⁇ 2 b / 2 and the random number ⁇ , the following values are set (step S250).
  • the CPU 102 stores element data C ′ [y] from (2 ⁇ 2 b / 2 +1) th to (3 ⁇ 2 b / 2 ) th in the pre-calculation table C ′ in the volatile memory 106.
  • the index y of 2 ⁇ 2 b / 2 ⁇ y ⁇ 3 ⁇ 2 b / 2 the random number ⁇ , and the number r L of the lower b / 2 bits of the number r, the following values are set (step S260, S270).
  • the CPU 102 stores the element data C ′ [y] from the (3 ⁇ 2 b / 2 +1) th to the (4 ⁇ 2 b / 2 ) th in the pre-calculation table C ′ in the volatile memory 106.
  • the following values are set (step S280).
  • C ′ [y] ⁇ + 1
  • the size of the pre-calculation table C ′ configured in this way is 4b ⁇ 2 b / 2 bits.
  • the pre-calculation table C ′ is in hexadecimal notation.
  • the vertical columns multiples of 2 b / 2 of the index, the horizontal lines represent the index of less than 2 b / 2.
  • the CPU 102 extracts the numbers A 1 and A 2 from the input number A. Specifically, the upper (k ⁇ 1) b bits of the arithmetic mask data A are set as the upper arithmetic mask data A 1 and the lower b bits are set as the lower arithmetic mask data A 2 (step S310).
  • a b-bit random number ⁇ is used, and when there is no carry information, addition of carry information “0” A 1 ⁇ (A 1 + ⁇ ) ⁇ , and when carry information is present, carry information Addition of “1” A 1 ⁇ (A 1 + ⁇ + 1) ⁇ is performed.
  • whether to add random number ⁇ or carry information with random number ⁇ + 1 corresponds to whether A 2 + r ⁇ 2 b / 2 , which is determined by referring to pre-calculation table C ′. it can.
  • CPU 102 extracts the number A H and the number A L of the lower b / 2 bits of the upper b / 2 bits of the number A 2 from the number of A 2. That is, the upper b / 2 bits of the arithmetically masked data A 2 of the lower and the arithmetically masked data A H of the upper and lower b / 2 bits and low-order of the arithmetically masked data A L (step S320). Note that these steps S310 and S320 are executed after the above-described step S280 for convenience of explanation. However, the present invention is not limited to this, and can be executed at any timing between steps S210 to S280.
  • the CPU 102 reads out the first element data C ′ [A H ] from the pre-calculation table C ′ in the volatile memory 106 using the extracted number A H as an index y. Note that the process of reading the first element data C ′ [A H ] is executed after step S280 described above.
  • the CPU 102 uses the sum of the first element data C ′ [A H ] and the extracted number A L as an index y from the pre-calculation table C ′ in the volatile memory 106 to obtain the second element data C ′ [C ′ [A H ] + A L ] is read out.
  • the pre-calculation table necessary for adding the number A of kb bits and the number r of b bits to obtain the addition result of the upper (k ⁇ 1) b bits. Can be reduced in size.
  • the pre-calculation table size can be reduced while having resistance to side channel analysis, so that resources such as an IC card are difficult. It becomes easier to mount on a restricted device.
  • the first embodiment is applied to a conversion method from a conventional arithmetic mask to a logical mask.
  • the hardware configuration is the same as the configuration shown in FIG. 1, and the software configuration is a configuration in which a program for executing the processing shown in FIG. It has become.
  • the added program is a program for executing a conversion process from an arithmetic mask to a logical mask, and replaces the conventional step S162 shown in FIG. 9 with step S162a (first embodiment) described later. (Processing using the prior calculation table C ′) is executed (steps other than step S162a are executed in the same manner as the conventional steps shown in FIG. 9).
  • steps S161 to S163 shown in FIG. 5 correspond to steps S310 to S340 of the first embodiment, and before executing step S162a at the latest, steps S210 to S280 (pre-calculation table) of the first embodiment are performed.
  • C ′ generation process is executed in advance.
  • steps S210 to S280 are executed in advance before the first step S110 shown in FIG.
  • the volatile memory 106 stores the second pre-calculation table G, the integer m, and the logic mask data x ′ in addition to the storage contents of the first embodiment. Used to do.
  • the CPU 102 previously generates and writes the pre-calculation table C ′ described in the first embodiment in the volatile memory 106 by the processing in steps S210 to S280 described above. Similarly, the CPU 102 generates a second pre-calculation table G based on 2 b indexes I from 0 to 2 b ⁇ 1, a random number r, and a bit number b, and the second pre-calculation table G Is written into the volatile memory 106.
  • the mb-bit number R consisting of the b-bit number R 2 is input into the arithmetic unit 101 and written into the volatile memory 106.
  • the CPU 102 subtracts the random number r from the number A as the arithmetic mask data under mod 2 mb (step S130). By this subtraction, the subtraction result A ⁇ A ⁇ r mod 2 mb is obtained.
  • the CPU 102 extracts the upper (m ⁇ 1) b bit number R 1 and the lower b bit number R 2 from the input number R (step S140).
  • the CPU 102 adds the number R 2 to the number A under mod 2 mb (step S150). By this addition, the addition result A ⁇ AR 2 mod 2 mb is obtained.
  • the CPU 102 arranges the higher-order logic mask data x ′ 1 obtained by this calculation in the most significant b bits of the logic mask data x ′ in the volatile memory 106 (step S190).
  • steps S161, S162a, and S163 are sequentially executed as the same processing as steps S310 to S340 described above.
  • the CPU 102 extracts the numbers A 1 and A 2 from the number A after the addition in step S150. Specifically, the upper (k ⁇ 1) b bits of the arithmetic mask data A are set as the upper arithmetic mask data A 1 and the lower b bits are set as the lower arithmetic mask data A 2 (step S161).
  • the CPU 102 executes the following step S162a.
  • CPU 102 is as before, and extracts the number A H and the number A L of the lower b / 2 bits of the upper b / 2 bits of the number A 2 from the number of A 2.
  • the CPU 102 reads out the first element data C ′ [A H ] from the pre-calculation table C ′ in the volatile memory 106 using the extracted number A H as an index y.
  • the CPU 102 uses the sum of the first element data C ′ [A H ] and the extracted number A L as an index y from the pre-calculation table C ′ in the volatile memory 106 to the second element data C ′ [C 'Read [A H ] + A L ].
  • the CPU 102 uses the low-order logic mask data x ′ 2 obtained by this calculation as the low-order (km) b-th bit of the logic mask data x ′ in the volatile memory 106. Arrangement is made so that the least significant bit of the data x ′ 2 matches (step S166).
  • the CPU 102 re-executes the processing after step S130.
  • the arithmetic mask data is converted into the logical mask data by the configuration in which the first embodiment is applied to the conventional conversion method from the arithmetic mask to the logical mask. It is possible to reduce the size of the pre-calculation table required in some cases.
  • the pre-calculation table size can be reduced while having resistance to side channel analysis. Therefore, it becomes easier to mount on an apparatus such as an IC card that has severe restrictions on resources.
  • the method described in the above embodiment is a program that can be executed by a computer as a magnetic disk (floppy (registered trademark) disk, hard disk, etc.), optical disk (CD-ROM, DVD, etc.), magneto-optical disk (MO). ), And can be distributed in a storage medium such as a semiconductor memory.
  • a magnetic disk floppy (registered trademark) disk, hard disk, etc.
  • optical disk CD-ROM, DVD, etc.
  • MO magneto-optical disk
  • the storage medium can store a program and can be read by a computer
  • the storage format may be any form.
  • an OS operating system
  • MW middleware
  • database management software network software
  • the storage medium in the present invention is not limited to a medium independent of a computer, but also includes a storage medium in which a program transmitted via a LAN, the Internet, or the like is downloaded and stored or temporarily stored.
  • the number of storage media is not limited to one, and the case where the processing in the above embodiment is executed from a plurality of media is also included in the storage media in the present invention, and the media configuration may be any configuration.
  • the computer executes each process in the above-described embodiment based on a program stored in a storage medium, and is a single device such as a personal computer or a system in which a plurality of devices are connected to a network. Any configuration may be used.
  • the computer in the present invention is not limited to a personal computer, but includes an arithmetic processing device, a microcomputer, and the like included in an information processing device, and is a generic term for devices and devices that can realize the functions of the present invention by a program. .
  • the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage.
  • various inventions can be formed by appropriately combining a plurality of constituent elements disclosed in the embodiment. For example, some components may be deleted from all the components shown in the embodiment. Furthermore, you may combine the component covering different embodiment suitably.

Abstract

 一つの実施形態においては、kbビットの数Aとbビットの乱数rとの加算について、数Aの下位bビットの数A2の上位b/2ビットの値AHと乱数rの上位b/2ビットの値rHとの和AH+rHと、数A2の下位b/2ビットの値ALと乱数rの下位b/2ビットの値rLとの和AL+rLとに基づいて、A2+rの桁上げの有無を示すように事前計算テーブルC'の要素データを設定する。これにより、kbビットの数Aとbビットの数rとを互いに加算して上位(k-1)bビットの加算結果を得る場合に必要な事前計算テーブルのサイズを縮小する。

Description

演算装置及びプログラム
 本発明は、例えば、サイドチャネル解析への耐性を持たせるように算術的マスクをした被算術マスクデータを、論理的マスクをした被論理マスクデータに変換する場合に、必要な事前計算テーブルのサイズを縮小し得る演算装置及びプログラムに関する。
 近年の情報通信技術にとって、暗号技術は欠かせない技術となってきている。この種の暗号化技術には、例えば通信の暗号化技術であるSSL(Secure Socket Layer)や、メッセージの改ざんの有無を検出可能な電子署名などがある。これらはPKI(Public Key Infrastructure:公開鍵基盤)の一部として、社会の電子化を支えている。
 しかしながら、暗号技術に対する攻撃手法も高度化してきている。その中でも、暗号プロセッサの処理時間や消費電力を測定し、測定結果から暗号プロセッサ内部の秘密情報を解析するというサイドチャネル解析が現実的な脅威となってきている。代表的なサイドチャネル解析としては、タイミング解析及び電力解析が知られている。
 電力解析の例として、DES(Data Encryption Standard)に対する解析方法を図面を用いて説明する。この方法は、 L. Goubin, J. Patarin, “DES and Differential Power Analysis - The Duplication Method”, CHES ’99, LNCS 1717, pp.158-172, 1999に記載されている。
 図7はDES暗号装置における最終16段目のデータ変換部を示す模式図である。
 16段目のデータ変換部においては、2つの32ビットの入力データL15、R15及び48ビットの鍵データK16が入力されると、データ変換処理が実行され、2つの32ビットの出力データL16、R16が出力される。
 この出力データL16、R16をビット転置IP-1した結果がDES暗号装置から出力される暗号文となる。ここで、暗号文及びビット転置IP-1は、それぞれ攻撃者に既知であるため、出力データL16、R16も攻撃者に既知となる。
 16段目のデータ変換部では、32ビットの入力データR15をE転置により48ビットのデータに拡大する。拡大後のデータは48ビットの鍵データK16との排他的論理和が取られる。排他的論理和後の48ビットのデータは6ビットの8個の分割データに分割され、各分割データがそれぞれSボックス(S-box)S1,S2,…,S8に入力される。
 各Sボックスは6ビット入力4ビット出力であり、全部で32ビットの出力データが得られる。この32ビットの出力データは、P転置により別の32ビットのデータに変換された後、入力データL15との排他的論理和が取られて一方の出力データL16となる。他方の出力データR16は、入力データR15がそのまま出力されたものである。
 このようなデータ変換処理において、攻撃者に未知のデータは48ビットの鍵データK16のみである。攻撃者は、この48ビットの値を、16段目のデータ変換処理を実行中のDES暗号装置の消費電力を解析して求める。
 具体的には、攻撃者は入力平文Miを取り替えながら1,000サンプルのDES処理に対する消費電力波形vi(t)を収集する。ここで、tは離散的な時刻を表し、iはサンプル番号(但し、0≦ i ≦999)を表す。
 16段目のある1つのSボックスsの出力1ビットをターゲットビットとする。このSボックスsの6ビットの入力データcは、出力データL16から逆にたどることで導出可能である。Sボックスの入力データcとしては、入力データc以外に、入力データcと排他的論理和される6ビットの部分鍵kjがある。この部分鍵kjを未知変数として、ターゲットとなるSボックス出力1ビットをsi(kj,ci)と書く。
 収集した消費電力波形を基に、差分平均トレースTj(t)を次の式により計算する。
Figure JPOXMLDOC01-appb-M000001
 部分鍵kjとして6ビット64通りの全ての場合について差分平均トレースTj(t)を計算すると、64通りの内の一つの部分鍵kjは、実際に使われている部分鍵kjと一致しており、その時の差分平均トレースTj(t)は値の偏りを示す。それ以外の63通りの部分鍵の場合には部分平均トレースTj(t)は偏らない。この偏り特性により、6ビットの部分鍵kjを特定可能となっている。
 この操作を他の7つのSボックスsにも適用することで48ビットの部分鍵K16を見出すことが可能である。
 このような電力解析においては、攻撃者が予想した未知変数kjの値と消費電力vi(t)に相関があることが効いている。このことは未知変数の値と測定時間との相関を見るタイミング解析でも同様である。
 従って、逆にこのような相関をなくせば、サイドチャネル解析から秘密情報の漏洩を阻止可能である。そこで、暗号装置が処理するデータと攻撃者が予想したデータとの相関を無くすため、暗号装置が処理するデータに乱数をマスクする手法が知られている。
 マスク方法としては、主に論理的マスクと算術的マスクの2種類があり、暗号アルゴリズムを構成する演算を基に、いずれのマスクを使用するかを決定する。例えば、論理演算から構成される暗号アルゴリズムには論理的マスクを使用し、算術演算から構成される暗号アルゴリズムには算術マスクを使用する。マスクの際に用いる演算と暗号アルゴリズムの演算は、可換とすることが効率的に良い。すなわち、マスクされたデータに暗号アルゴリズムの演算を施す場合には、最後にマスクを外した後の演算結果が、最初からマスクをしなかった場合の演算結果と同じになるように、マスクの際に用いる演算を定める。一般に、共通鍵暗号方式は論理的マスクを使用し、公開鍵暗号方式は算術的マスクを使用することが多い。
 共通鍵暗号方式やハッシュ関数の中には、1つのアルゴリズムの中で論理演算と算術演算の両方を用いるアルゴリズムが存在する。例えば共通鍵暗号方式ではIDEA(International Data Encryption Algorithm)、SEED、ハッシュ関数ではSHA-1(Secure Hash Algorithm - 1)などがある。これらのアルゴリズムにおいてデータをマスクするには、暗号アルゴリズムで論理演算を用いる部分では論理的マスクをする一方、算術演算を用いる部分では算術的マスクをする必要がある。
 これらのアルゴリズムでは、処理単位(ワード)をwビットとしたとき、wビットのデータxをwビットの数Rでマスクするには、論理的マスクの場合は排他的論理和を用いて、次式の演算を実行する。
 x’=x^R   (但し、^は排他的論理和を表す記号)
 算術的マスクの場合は剰余付き減算を用いて、次式の演算を実行する。 
 A=x-R mod 2 
 上の暗号アルゴリズムの例ではw=32ビットである。
 従って、暗号アルゴリズムにおける演算列において論理演算から算術演算に変わる場面では、論理的マスクが施されたデータ(以下、被論理マスクデータという)x’から算術的マスクが施されたデータ(以下、被算術マスクデータという)Aへデータを変換する必要がある。同様に、算術演算から論理演算に変わる場面では、被算術マスクデータAから被論理マスクデータx’へ、データを変換する必要がある。
 例えば被論理マスクデータx’から被算術マスクデータAに変換する最も簡単な方法は、(x’^R)-R mod 2 を演算する方式である。但し、この方式は、x’^R=xであるから、マスクされていない状態のデータxが演算中に出現するので、望ましくない。
 データに常にマスクをつけた状態で被論理マスクデータx’と被算術マスクデータAを変換する方法として、 L. Goubin, “A Sound Method for Switching between Boolean and Arithmetic Masking”, CHES 2001, LNCS 2162, pp.3-15, 2001 (以下、[Goubin2001]方式という)及び J-S, Coron, A. Tchulkine, “A New Algorithm for Switching from Arithmetic to Boolean Masking”, CHES 2003, LNCS 2779, pp.89-97, 2003 (以下、[CT2003]方式という)が知られている。[Goubin2001]方式では、被論理マスクデータx’から被算術マスクデータAへ変換する方法と、被算術マスクデータAから被論理マスクデータx’へ変換する方法が提案されている。後者の方法は効率が低いため、事前計算テーブルを用いて高速化を図る[CT2003]方式が提案されている。
 図8乃至図10を用いて、[CT2003]方式での被算術マスクデータAから被論理マスクデータx’への変換方法を説明する。演算を行う単位をbビットとする。簡単のため、bはwの約数であるとし、ある整数kにより、w=k×bとかけるものとする。
 始めに、論理的マスク及び算術的マスクがbビットの場合(すなわちw=b、k=1)の事前計算テーブルGを構成する。0から2b-1までの各整数Iに対して、事前計算テーブルを次式で定義する。
 G[I]=((I+r) mod 2b)^r
 ここで、便宜上、bビットの乱数をrと記載している。w=bの場合、上記数Rとの関係はR=rである。事前計算テーブルGは、2b個の要素データからなるテーブルであり、各要素データがbビットである。被算術マスクデータAは、事前計算テーブルGの要素データG[A]を求めることで被論理的マスクx’に変換可能となっている。その理由は以下の通りである。
 G[A]=((A+r) mod 2b)^r
     =((x-r)+r mod 2)^r
     =(x mod 2)^r
     =x^r
     =x’
 図8に、w=b=4、r=3の場合の事前計算テーブルGを示す。図の配列は、左側から順にG[0],G[1],…,G[15]の値を16進数表記で示している。例えばG[9]=0xFである。
 図9にk>1(すなわちw>b)の場合に、[CT2003]方式による被算術マスクデータAから被論理マスクデータx’に変換するアルゴリズムを示す。このアルゴリズムはw=k×bビットの被算術マスクデータAと数Rを入力したとき、wビットの被論理マスクデータx’を出力するアルゴリズムである。
 始めに、整数m及び被論理マスクデータx’をそれぞれm=k、x’=0とする(ステップS110、S120)。
 次に、被算術マスクデータAから乱数rをmod 2mb の下で減算する(ステップS130)。
 数RをLSB(Least Significant Bit:最下位ビット)からbビット目の値で上位の数R1と下位の数R2に分割する(ステップS140)。すなわち上位の数R1は数Rの上位(m-1)bビットであり、下位の数R2は下位bビットである。
 被算術マスクデータAに下位の数R2をmod 2mb の下で加算する(ステップS150)。
 次に、整数mについて、m=1か否かを判断する(ステップS160)。m=1の場合は上位の被論理マスクデータx’1を次式の通り計算する(ステップS170、S180)。
 x’1=(G[A]^R2)^r 
 しかる後、得られた上位の被論理マスクデータx’1を被論理マスクデータx’の最上位bビットに配置して(ステップS190)アルゴリズムを終了する。
 m>1の場合は、以下の処理を行う。
 被算術マスクデータAを数Rと同様に上位の被算術マスクデータA1と、下位の被算術マスクデータA2とに分割する(ステップS161)。
 ステップS130とステップS150による桁上げ(A2+rにより生じるb+1ビット目の値)を上位の被算術マスクデータA1に対応させるため、次式を計算する(ステップS162、S163)。なお、本明細書中、「桁上げ」は「キャリー」に読み替えてもよい。
 A1=(A1+C[A2])-γ mod 2(m-1)b 
 続いて、下位の被論理マスクデータx’2を次式に示すように計算する(ステップS164、S165)。
 x’2=(G[A2]^R2)^r
 しかる後、下位の被論理マスクデータx’2を、被論理マスクデータx’の下位(k-m)bビット目に、当該下位の被論理マスクデータx’2の最下位ビットLSBが合うように配置する(ステップS166)。
 しかる後、整数mを、m=m-1と更新し(ステップS167)、ステップS130からくり返す。
 上記アルゴリズムにおいて、ステップS130とステップS150における下位桁からの桁上げ(キャリー)を調整する際に、桁上げ情報をマスクするために事前計算テーブルC及びbビットの乱数γを利用している。事前計算テーブルCは、0から2b-1までの各整数Iに対し、次のように定義される。
 C[I]=γ  (I+r<2bのとき)
 C[I]=γ+1(I+r≧2bのとき)
 ここで、事前計算テーブルCは、2b個の要素データからなるテーブルであり、各要素データがbビットである。
 図10に、b=4、r=3、γ=9の場合の事前計算テーブルCを示す。図の配列は、左側から順にC[0],C[1],…,C[15]の値を16進数表記で示している。例えばC[0xE]=0xAである。
 しかしながら、以上のような[CT2003]方式における被算術マスクデータAから被論理マスクデータx’への変換方法では、事前計算テーブルG,Cを格納する領域として、2つのb×2bビットの格納領域が必要となる。例えばb=4の場合には128ビット(=16バイト)の格納領域、b=8の場合には4,096ビット(=512バイト)の格納領域でよいが、b=16の場合には2,097,152ビット(=262,144バイト)の格納領域が必要となり、非現実的である。
 従って、実際にはb=8程度の場合の格納領域が妥当な大きさではあるが、それでもICカードのような記憶容量の小さい装置に実装する際には、512バイトの事前計算テーブルG,Cでも、リソースを圧迫するか、あるいは実装できないという問題がある。
 本発明者の検討によれば、この問題は、kbビットの数Aとbビットの数rとを互いに加算して上位(k-1)bビットの加算結果を得る場合に必要な事前計算テーブルのサイズを縮小できれば、解消できると考えられる。すなわち、ステップS130とステップS150による桁上げ(A2+rにより生じるb+1ビット目の値)を上位の被算術マスクデータA1に対応させる場合に必要な事前計算テーブルCのサイズを縮小できれば、この問題を解消できると考えられる。
 本発明の目的は、kbビットの数Aとbビットの数rとを互いに加算して上位(k-1)bビットの加算結果を得る場合に必要な事前計算テーブルのサイズを縮小し得る演算装置及びプログラムを提供することにある。
 本発明の一つの局面は、上位(k-1)bビットの数A1及び下位bビットの数A2からなるkbビットの数A(但し、b>4)と、bビットの数rとを加算して上位(k-1)bビットの加算結果を得る処理の前に、(4×2b/2)個のインデックスy(但し、0≦y<4×2b/2)の各々により個別に読出可能な(4×2b/2)個のbビットの要素データC’[y]を備えた事前計算テーブルC’を生成し、前記加算する処理中に、前記数A2と前記数rとの加算結果から前記数A1への桁上げを前記事前計算テーブルC’に基づいて伝播可能な演算装置であって、前記bビットの乱数γを生成する手段と、前記各インデックスyと、当該各インデックスyに関連付けた各要素データC’[y]とを備えた事前計算テーブルC’を記憶するための記憶手段と、前記記憶手段内の事前計算テーブルC’の1個目から2b/2個目までの要素データC’[y]を、前記インデックスyと前記数rの上位b/2ビットの数rHとに基づいて、C’[y]=2b/2 (但し、0≦y<2b/2-rH-1 )、C’[y]=2×2b/2 (但し、y=2b/2-rH-1 )、C’[y]=3×2b/2 (但し、2b/2-rH≦y<2b/2 )、の値に設定する手段と、前記記憶手段内の事前計算テーブルC’の(2b/2+1)個目から(2×2b/2)個目までの要素データC’[y]を、前記インデックスyと前記乱数γとに基づいて、C’[y]=γ (但し、2b/2≦y<2×2b/2)、の値に設定する手段と、前記記憶手段内の事前計算テーブルC’の(2×2b/2+1)個目から(3×2b/2)個目までの要素データC’[y]を、前記インデックスyと前記乱数γと前記数rの下位b/2ビットの数rLとに基づいて、C’[y]=γ (但し、2×2b/2≦y<3×2b/2-rL)、C’[y]=γ+1 (但し、3×2b/2-rL≦y<3×2b/2)、の値に設定する手段と、前記記憶手段内の事前計算テーブルC’の(3×2b/2+1)個目から(4×2b/2)個目までの要素データC’[y]を、前記インデックスyと前記乱数γとに基づいて、C’[y]=γ+1 (但し、3×2b/2≦y<4×2b/2)の値に設定する手段と、前記数Aから前記数A1及び前記数A2を抽出する第1抽出手段と、前記数A2の上位b/2ビットの数AH及び下位b/2ビットの数ALを当該数A2から抽出する第2抽出手段と、前記(4×2b/2)個の要素データC’[y]の値を設定した後、前記抽出した数AHをインデックスyとして前記記憶手段内の事前計算テーブルC’から第1の要素データC’[AH]を読み出す第1読出手段と、前記第1の要素データC’[AH]と前記抽出した数ALとの和をインデックスyとして前記記憶手段内の事前計算テーブルC’から第2の要素データC’[C’[AH]+AL]を読み出す第2読出手段と、前記第2の要素データC’[C’[AH]+AL]、前記乱数γ、前記数A1及び当該数A1のビット数(k-1)bに基づいて、A1+C’[C’[AH]+AL]-γ mod 2(k-1)b を計算することにより、前記数A1への桁上げを伝播する桁上げ伝播手段と、を備えた演算装置である。
 なお、本発明の一つの局面は、装置として表現したが、装置に限らず、方法、プログラム、プログラムを記憶したコンピュータ読み取り可能な記憶媒体として表現してもよい。
 本発明の一つの局面においては、kbビットの数Aとbビットの乱数rとの加算について、数Aの下位bビットの数A2の上位b/2ビットの値AHと乱数rの上位b/2ビットの値rHとの和AH+rHと、数A2の下位b/2ビットの値ALと乱数rの下位b/2ビットの値rLとの和AL+rLとに基づいて、A2+rの桁上げの有無を示すように事前計算テーブルC’の要素データを設定したので、[CT2003]方式に記載の方法に比べ、kbビットの数Aとbビットの数rとを互いに加算して上位(k-1)bビットの加算結果を得る場合に必要な事前計算テーブルのサイズを縮小することができる。
 以上説明したように本発明によれば、kbビットの数Aとbビットの数rとを互いに加算して上位(k-1)bビットの加算結果を得る場合に必要な事前計算テーブルのサイズを縮小できる。
図1は、本発明の第1の実施形態に係る演算装置の概略図である。 図2は、同実施形態における事前計算テーブルCの生成手順を示すフローチャートである。 図3は、同実施形態における事前計算テーブルCの一例を示す図である。 図4は、同実施形態における加算手順を示すフローチャートである。 図5は、本発明の第2の実施形態に係る演算装置に適用された算術的マスクから論理的マスクへの変換手順を示すフローチャートである。 図6は、本発明の概要を説明するためのフローチャートである。 図7は、一般的なDESのデータ変換部の16段目を示す図である。 図8は、従来の事前計算テーブルGの一例を示す図である。 図9は、従来の算術的マスクから論理的マスクへの変換手順を示すフローチャートである。 図10は、従来の事前計算テーブルCの一例を示す図である。
 以下、本発明の各実施形態について図面を用いて説明するが、その前に本発明の概要を図6を参照して述べる。 
 事前計算テーブルC’を生成するときに、0から2b-1までの範囲内の整数Aに対して、整数rでマスクした値A+rが2bより小さいか否かの判断(桁上げの有無の判断)を、上位b/2ビットと下位b/2ビットに分けて行う。
 ここで、整数Aの上位b/2ビットの数をAH、下位b/2ビットの数をALと表すことにする。整数rについても同様に、上位b/2ビットの数をrH、下位b/2の数をrLと表す(例、r=0x19の場合、rH=1、rL=9)。
 例えば、上位b/2ビット同士AH,rHの加算結果がAH+rH<2b/2-1であれば、AL,rLの値によらず、A+r<2bである(即ち、桁上げ無し)と判断できる。そのため、この桁上げ無しの場合には事前計算テーブルC’を参照したときに値γ(乱数)が読み出されるように事前計算テーブルC’を生成する。この場合は、具体的には、数AHをインデックスyとしてbビットの値C’[AH]を得る場合(但し、0≦y<2b/2-rH-1)の(2b/2-rH-1)個×bビットのサイズ(例、図3の0行目の14個の値C’[0x00],…,C’[0x1D]=0x10,…,0x10のサイズ)と、このインデックスyにより得られた値C’[AH]に数ALを加算した値(0x10+AL)をインデックスyとしてbビットの値γを得る場合(但し、2b/2≦y<2×2b/2)の2b/2個×bビットのサイズ(例、図3の1行目の16個の値C’[0x10]~C’[0x1F]=0x56,…,0x56のサイズ)とを必要とする。
 次に、上位b/2ビット同士AH,rHの加算結果がAH+rH≧2b/2 であれば、AL,rLの値によらず、A+r≧2bである(即ち、桁上げ有り)と判断できる。そのため、この桁上げ有りの場合には事前計算テーブルC’を参照したときに値γ+1(乱数付き桁上げ情報)が読み出されるように事前計算テーブルC’を生成する。この場合は、具体的には、数AHをインデックスyとしてbビットの値C’[AH]を得る場合(但し、2b/2-rH≦y<2b/2 )のrH個×bビットのサイズ(例、図3の0行目の1個の値C’[0x0F]=0x30のサイズ)と、このインデックスyにより得られた値C’[AH]に数ALを加算した値(0x30+AL)をインデックスyとしてbビットの値γを得る場合(但し、3×2b/2≦y<4×2b/2)の2b/2個×bビットのサイズ(例、図3の3行目の16個の値C’[0x30],…,C’[0x3F]=0x57,…,0x57のサイズ)とを必要とする。
 最後に、上位b/2ビット同士AH,rHの加算結果がAH+rH=2b/2-1のときには、下位b/2ビット同士AL,rLの加算結果がAL+rL<2b/2であればA+r<2bである(即ち、桁上げ無し)と判断でき、そうでなければA+r≧2bである(即ち、桁上げ有り)と判断できる。そのため、事前計算テーブルC’を参照したときに、桁上げ無しの場合には値γが読み出され、桁上げ有りの場合には値γ+1が読み出されるように事前計算テーブルC’を生成する。これらの場合には、具体的には、数AHをインデックスyとしてbビットの値C’[AH]を得る場合(但し、y=2b/2-rH-1)の1個×bビットのサイズ(例、図3の0行目の1個の値C’[0x0E]=0x20のサイズ)と、このインデックスyにより得られた値C’[AH]に数ALを加算した値(0x20+AL)をインデックスyとしてbビットの値γを得る場合(但し、2×2b/2≦y<3×2b/2-rL)の(2b/2-rL)個×bビットのサイズ(例、図3の2行目の7個の値C’[0x20],…,C’[0x26]=0x56,…,0x56のサイズ)と、値C’[AH]に数ALを加算した値(0x20+AL)をインデックスyとしてbビットの値γ+1を得る場合(但し、3×2b/2-rL≦y<3×2b/2)のrL個×bビットのサイズ(例、図3の2行目の9個の値C’[0x27],…,C’[0x2F]=0x57,…,0x57のサイズ)とを必要とする。
 このような事前計算テーブルC’のサイズは、これら全てのサイズを足し合わせた値となり、具体的には、(2b/2-rH-1)個×bビットのサイズと、2b/2個×bビットのサイズと、rH個×bビットのサイズと、2b/2個×bビットのサイズと、1個×bビットのサイズと、2b/2-rL個×bビットのサイズと、rL個×bビットのサイズとを足し合わせた値となる。すなわち、事前計算テーブルC’のサイズは、4×2b/2×bビット、即ち、4b×2b/2ビットとなる。
 このサイズを、従来の事前計算テーブルCのサイズb×2bビットと比較すると縮小された割合は(4b×2b/2)/(b×2b)=4/2b/2 である。この割合は、例えばb=4の場合には1であるが、b>4であればbの値に応じて1より縮小される。例えば、b=8の場合には1/4に縮小され、b=16の場合には1/64と顕著に縮小される。
 以上により、[CT2003]方式において、事前計算テーブルのサイズを縮小できる。このため、ICカードのようなリソースに厳しい制約のある装置上へ実装することがより容易となる。
 (第1の実施形態)
 図1は本発明の第1の実施形態に係る演算装置の構成を示す概略図である。この演算装置101は、ICカードなどの計算機の暗号処理部として構成されていて、ハードウェア又はソフトウェアによって暗号処理を行うものである。具体的にはCPU(中央演算装置)102、入出力部103、プログラム記憶部104、乱数生成部105、揮発性メモリ106及びバス107からなる。この演算装置101は、ハードウェア構成、又はハードウェア資源とソフトウェアとの組合せ構成のいずれでも実施可能となっている。組合せ構成のソフトウェアとしては、予めネットワーク又はコンピュータ読み取り可能な記憶媒体Mから演算装置となるコンピュータにインストールされ、演算装置101の機能を実現させるためのプログラムが用いられる。ここでは、プログラム記憶部104に格納されたプログラムをCPU102で実行する形で、各機能を実現するものとしている。このプログラムは、データ加算のためのサブプログラムを少なくとも含んでいる。
 ここで、CPU102は、プログラム記憶部104に格納されたプログラムを実行することにより、図2、図4及び図5に示す処理を実行する機能をもっている。
 入出力部103は、演算装置101内と外部との間のインターフェースであり、例えば、演算対象の数A,rを演算装置101内に入力する機能と、CPU102により得られた演算結果を演算装置101の外部に出力する機能とをもっている。
 プログラム記憶部104は、CPU102から読出可能な記憶装置であり、例えばROM(リードオンリーメモリ)又はEEPROM(電気的に書換え可能なROM)であって、図2、図4及び図5に示す処理のプログラムが記憶されている。なお、プログラム記憶部104は、プログラムを外部からインストールして保持する構成でもよい。
 乱数生成部105は、CPU102に制御されて乱数を生成するものであり、例えば、bビットの乱数γを生成する機能をもっている。なお、乱数生成部105は、独立のハードウェアで実現してもよいし、CPU102とプログラムで実現してもよい。あるいは、乱数生成部105を演算装置101から省略し、外部で生成した乱数を入出力部103から入力する構成としてもよい。
 揮発性メモリ106は、CPU102から読出/書込可能な記憶装置であり、例えばRAM(ランダムアクセスメモリ)であって、例えば、事前計算テーブルC’、数A、数r、乱数γ及び加算結果のように、計算に必要なデータ、計算途中のデータ及び計算結果などを格納する。
 次に、以上のように構成された演算装置の動作を図2乃至図4を用いて説明する。なお、この動作は、事前計算テーブルの生成処理、及び加算処理(桁上げ伝播処理)の順に説明する。
 (事前計算テーブルC’の生成処理:図2)
 入出力部103は、上位(k-1)bビットの数A1及び下位bビットの数A2からなるkbビットの数A(但し、b>4)と、bビットの数rと、これらの数A,rに対する加算指令とを例えば図示しない暗号処理部から受けると、これらの数A,r及び加算指令をCPU102に入力する。なお、数A,A1,A2は、それぞれ「被算術マスクデータ」とも呼ぶ。
 CPU102は、これらの数A,r及び加算指令を受けると、これらの数A,rを加算して上位(k-1)bビットの加算結果を得る処理の前に、図3に示す如き、事前計算テーブルC’を生成するため、乱数生成部105を起動する。
 乱数生成部105は、CPU102に起動されると、bビットの乱数γを生成する(ステップS210)。この乱数γはCPU102に送出され、CPU102から揮発性メモリ106に格納される。なお、ステップS210は、最初に実行する場合を例に挙げて説明したが、これに限らず、乱数γを用いるステップS250、S260、S270及びS280よりも前であれば、任意のタイミングで実行可能である。また、以下の各ステップS220~S280は、任意の順序で実行可能である。
 次に、CPU102は、(4×2b/2)個のインデックスy(但し、0≦y<4×2b/2)と、当該各インデックスyに関連付けた各要素データC’[y]とを備えた事前計算テーブルC’を揮発性メモリ106に書き込む。各要素データC’[y]は(4×2b/2)個あり、インデックスyの各々により個別に読出可能なbビットの値である。但し、この段階では、各要素データC’[y]の値は設定されていない。また、インデックスyは整数である。
 CPU102は、揮発性メモリ106内の事前計算テーブルC’の1個目から2b/2個目までの要素データC’[y]を、0≦y<2b/2 のインデックスyと数rの上位b/2ビットの数rHとに基づいて、以下の値に設定する(ステップS220~S240)。
 C’[y]=2b/2   (0≦y<2b/2-rH-1 :即ちy+rH<2b/2-1)
 C’[y]=2×2b/2 (y=2b/2-rH-1   :即ちy+rH=2b/2-1)
 C’[y]=3×2b/2 (2b/2-rH≦y<2b/2 :即ちy+rH>2b/2-1)
 ここで、インデックスyには、後述する上位の被算出マスクデータAHの値が入力されることを想定しており、上の3通りの要素データC’[y]は、それぞれAH+rH<2b/2-1、AH+rH=2b/2-1、AH+rH≧2b/2の場合に対応している。
 上の要素データC’[y]の値は、上位の被算出マスクデータAHの値に応じて次に事前計算テーブルのどの要素データC’[ ]を見ればよいのかを示しており、一番上の場合はC’[2b/2]、2番目の場合はC’[2×2b/2]、3番目の場合はC’[3×2b/2]を参照することを表している。
 次に、CPU102は、揮発性メモリ106内の事前計算テーブルC’の(2b/2+1)個目から(2×2b/2)個目までの要素データC’[y]を、2b/2≦y<2×2b/2 のインデックスyと乱数γとに基づいて、以下の値に設定する(ステップS250)。
 C’[y]=γ
 ここで、y-2b/2には、後述する下位の被算術マスクデータALの値が入力されることを想定しており、これはAH+rH<2b/2-1の場合に、下位の被算術マスクデータALの値に関わらず、乱数γを返すことを示している。
 次に、CPU102は、揮発性メモリ106内の事前計算テーブルC’の(2×2b/2+1)個目から(3×2b/2)個目までの要素データC’[y]を、2×2b/2≦y<3×2b/2 のインデックスyと乱数γと数rの下位b/2ビットの数rLとに基づいて、以下の値に設定する(ステップS260、S270)。 
 C’[y]=γ   (2×2b/2≦y<3×2b/2-rL:即ちy+rL<2b/2)、
 C’[y]=γ+1 (3×2b/2-rL≦y<3×2b/2:即ちy+rL≧2b/2)、
 ここで、y-2×2b/2には、下位の被算術マスクデータALの値が入力されることを想定しており、上の2通りはそれぞれAL+rL<2b/2、AL+rL≧2b/2の場合に対応している。
 最後に、CPU102は、揮発性メモリ106内の事前計算テーブルC’の(3×2b/2+1)個目から(4×2b/2)個目までの要素データC’[y]を、3×2b/2≦y<4×2b/2 のインデックスyと乱数γとに基づいて、以下の値に設定する(ステップS280)。 
 C’[y]=γ+1
 ここで、y-3×2b/2には、下位の被算術マスクデータALの値が入力されることを想定しており、これはAH-rH≧2b/2の場合に、下位の被算術マスクデータALの値に関わらず、乱数付き桁上げ情報γ+1を返すことを示している。
 このように構成した事前計算テーブルC’のサイズは4b×2b/2ビットとなる。
 図3に、b=8、r=0x19、γ=0x56の場合の事前計算テーブルC’を示す。事前計算テーブルC’は16進数表記である。図3の配列は、縦の列がインデックスの2b/2の倍数を、横の行が2b/2未満のインデックスを表している。例えば縦のインデックスが1で横のインデックスが5の場合は、事前計算テーブルC’の1×2b/2+5(=21)番目の要素を指しており、C’[21]=0x56となる。
 縦のインデックス0の行は、rH=1であるため、2b/2-rH-1=14である。従って横のインデックスが13(=0x0D)以下のものは事前計算テーブルC’の要素は2b/2=0x10、14(=0x0E)のものは2×2b/2=0x20、15以上(=0x0F)のもの(15のみ)は3×2b/2=0x30となる。
 縦のインデックス1の行は、全ての要素データが乱数γ=0x56となる。
 縦のインデックス3の行は、全ての要素データが乱数付き桁上げ情報γ+1=0x57となる。
 縦のインデックス2の行は、rL=9であるため、2b/2-rL=7である。従って、横のインデックスが6以下のものは事前計算テーブルC’の要素データが乱数γ=0x56となり、横のインデックスが7以上のものは要素データが乱数付き桁上げ情報γ+1=0x57となる。
 (加算処理:図4)
 始めに、CPU102は、入力された数Aから数A1,A2を抽出する。具体的には、被算術マスクデータAの上位(k-1)bビットを上位の被算術マスクデータA1とし、下位bビットを下位の被算術マスクデータA2とする(ステップS310)。
 加算結果A+rを求めるためには、加算結果の下位の被算術マスクデータA2←A2+rにおける桁上げ情報(b+1ビット目)を、加算結果の上位の被算術マスクデータA1に伝える必要がある。すなわち加算結果の下位の被算術マスクデータA2+rの桁上げ情報がない場合には桁上げ情報“0”の加算A1←A1+0を、桁上げ情報がある場合には桁上げ情報“1”の加算A1←A1+1を行う必要がある。但し、桁上げ情報の有無によって加算が異なるため、サイドチャネル解析を阻止する観点から好ましくない。
 そのため、bビットの乱数γを用い、それぞれ桁上げ情報がない場合には桁上げ情報“0”の加算A1←(A1+γ)-γを、桁上げ情報がある場合には桁上げ情報“1”の加算A1←(A1+γ+1)-γを行う。
 ここで、乱数γ又は乱数付き桁上げ情報γ+1のいずれを加えるかはA2+r<2b/2であるか否かに対応しており、これは事前計算テーブルC’を参照することで判定できる。
 そこで、CPU102は、数A2の上位b/2ビットの数AH及び下位b/2ビットの数ALを当該数A2から抽出する。すなわち、下位の被算術マスクデータA2の上位b/2ビットを上位の被算術マスクデータAHとし、下位b/2ビットを下位の被算術マスクデータALとする(ステップS320)。なお、これらステップS310、S320は、説明の便宜上、前述したステップS280の後に実行したが、これに限らず、ステップS210~S280の間の任意のタイミングで実行可能となっている。
 次に、CPU102は、抽出した数AHをインデックスyとして揮発性メモリ106内の事前計算テーブルC’から第1の要素データC’[AH]を読み出す。なお、この第1の要素データC’[AH]を読み出す処理は、前述したステップS280よりも後に実行される。
 CPU102は、第1の要素データC’[AH]及び抽出した数ALの和をインデックスyとして揮発性メモリ106内の事前計算テーブルC’から第2の要素データC’[C’[AH]+AL]を読み出す。
 CPU102は、第2の要素データC’[C’[AH]+AL]、乱数γ、数A1及び当該数A1のビット数(k-1)bに基づいて、
  A1+C’[C’[AH]+AL]-γ mod 2(k-1)b 
を計算することにより、数A1への桁上げを伝播する(ステップS330、S340)。
 上述したように第1の実施形態によれば、kbビットの数Aとbビットの数rとを互いに加算して上位(k-1)bビットの加算結果を得る場合に必要な事前計算テーブルのサイズを縮小することができる。
 補足すると、ステップS340により生成された上位の被算術マスクデータA1は、加算結果A+rの上位(k-1)bビットとなっており、下位bビットからの桁上げ伝播を事前計算テーブルC’に基づいて乱数γでマスクしながら実行したため、サイドチャネル解析に対して耐性を有している。さらに事前計算テーブルC’のサイズが4b×2b/2ビットであるので、従来の事前計算テーブルCのサイズb×2bビットと比較すると縮小された割合は(4b×2b/2)/(b×2b)=4/2b/2である。この割合は、例えばb=4の場合には1であるが、b=8の場合には1/4、b=16の場合には1/64と顕著になる。
 また、第1の実施形態においては、[CT2003]方式を踏襲しているため、サイドチャネル解析に対して耐性を有しつつ、事前計算テーブルサイズを縮小できるため、ICカードのようなリソースに厳しい制約のある装置上へ実装することがより容易となる。
 (第2の実施形態)
 次に、本発明の第2の実施形態に係る演算装置について説明するが、図9と同一部分には同一符号を付してその詳しい説明を省略し、ここでは異なる部分について主に述べる。
 本実施形態は、従来の算術的マスクから論理的マスクへの変換方法に第1の実施形態を適用したものである。演算装置101の構成のうち、ハードウェア構成は、図1に示した構成と同一であり、ソフトウェア構成は、プログラム記憶部104内に図5に示す処理を実行するためのプログラムが付加された構成となっている。
 当該付加されたプログラムは、算術的マスクから論理的マスクへの変換処理を実行するためのプログラムであり、従来の図9に示したステップS162に代えて、後述するステップS162a(第1の実施形態の事前計算テーブルC’を用いる処理)を実行する内容となっている(なお、ステップS162a以外のステップは、従来の図9に示した各ステップと同様に実行される。)。
 補足すると、図5に示すステップS161~S163は、第1の実施形態のステップS310~S340に相当し、遅くともステップS162aを実行する前に、第1の実施形態のステップS210~S280(事前計算テーブルC’の生成処理)が予め実行される。なお、通常は、図5に示す最初のステップS110よりも前に、予めステップS210~S280が実行される。
 いずれにしても図5に示す処理の実行に伴い、揮発性メモリ106は、第1の実施形態の記憶内容に加え、第2の事前計算テーブルG、整数m及び被論理マスクデータx’を記憶するように用いられる。ここで、第2の事前計算テーブルGは、図8に示したように、0から2b-1までの2b個のインデックスIと、当該各インデックスIにより個別に読出可能な2b個の要素データG[I]=((I+r) mod 2b)^r とを備えている。
 次に、以上のように構成された演算装置の動作を図5を用いて説明する。
 なお、CPU102は、前述したステップS210~S280の処理により、第1の実施形態に述べた事前計算テーブルC’を予め生成して揮発性メモリ106に書き込んでいるとする。また同様に、CPU102は、0から2b-1までの2b個のインデックスI、乱数r及びビット数bに基づいて第2の事前計算テーブルGを生成し、当該第2の事前計算テーブルGを揮発性メモリ106に書き込む。
 入出力部103においては、上位(k-1)bビットの数A1及び下位bビットの数A2からなるkbビットの数Aと、上位(m-1)bビットの数R1及び下位bビットの数R2からなるmbビットの数Rとを演算装置101内に入力して揮発性メモリ106に書き込む。
 続いて、CPU102は、整数m及び被論理マスクデータx’をそれぞれm=k、x’=0に設定し、これら整数m及び被論理マスクデータx’を揮発性メモリ106に書き込む(ステップS110~S120)。
 CPU102は、被算術マスクデータとしての数Aから乱数rをmod 2mb の下で減算する(ステップS130)。この減算により、減算結果A←A-r mod 2mbが得られる。
 この減算の後、CPU102は、入力された数Rから上位(m-1)bビットの数R1及び下位bビットの数R2を抽出する(ステップS140)。
 この抽出の後、CPU102は、数Aに数R2をmod 2mb の下で加算する(ステップS150)。この加算により、加算結果A←A-R2 mod 2mbが得られる。
 この加算の後、CPU102は、揮発性メモリ106内の整数mについて、m=1か否かを判定する。
 CPU102は、判定の結果、m=1の場合には加算後の数AをインデックスIとして、揮発性メモリ106内の事前計算テーブルGから要素データG[A]を読み出す。しかる後、CPU102は、この要素データG[A]、数R2及び乱数rに基づいて、上位の被論理マスクデータx’1を、x’1=(G[A]^R2)^r の値に計算する手段(ステップS170~S180)。
 CPU102は、この計算により得られた上位の被論理マスクデータx’1を、揮発性メモリ106内の被論理マスクデータx’の最上位bビットに配置する(ステップS190)。
 一方、ステップS160による判定の結果、m>1の場合には、前述したステップS310~S340と同様の処理として、ステップS161、S162a及びS163を順次実行する。
 詳しくは、CPU102は、ステップS150による加算後の数Aから数A1,A2を抽出する。具体的には、被算術マスクデータAの上位(k-1)bビットを上位の被算術マスクデータA1とし、下位bビットを下位の被算術マスクデータA2とする(ステップS161)。
 次に、CPU102は、従来のステップS162とは異なり、以下のステップS162aを実行する。
 すなわち、CPU102は、前述同様に、数A2の上位b/2ビットの数AH及び下位b/2ビットの数ALを当該数A2から抽出する。
 次に、CPU102は、抽出した数AHをインデックスyとして揮発性メモリ106内の事前計算テーブルC’から第1の要素データC’[AH]を読み出す。
 また、CPU102は、第1の要素データC’[AH]と抽出した数ALとの和をインデックスyとして揮発性メモリ106内の事前計算テーブルC’から第2の要素データC’[C’[AH]+AL]を読み出す。
 CPU102は、第2の要素データC’[C’[AH]+AL]、乱数γ、数A1及び当該数A1のビット数(m-1)bに基づいて、
  A1←A1+C’[C’[AH]+AL]-γ mod 2(m-1)b 
の計算により、数A1への桁上げを伝播する(ステップS162a、S163)。
 次に、CPU102は、ステップS161で抽出した数A2をインデックスIとして、揮発性メモリ106内の事前計算テーブルGから要素データG[A2]を読み出す。しかる後、CPU102は、この要素データG[A2]、数R2及び乱数rに基づいて、下位の被論理マスクデータx’2を、x’2=(G[A2]^R2)^r の値に計算する(ステップS164、S165)。
 CPU102は、この計算により得られた下位の被論理マスクデータx’2を、揮発性メモリ106内の被論理マスクデータx’の下位(k-m)bビット目に、当該下位の被論理マスクデータx’2の最下位ビットが合うように配置する(ステップS166)。
 この配置の後、CPU102は、揮発性メモリ106内の整数mを、m=m-1と更新してステップS130の処理に戻る(ステップS167)。 
 以下、CPU102は、ステップS130以降の処理を再実行する。
 上述したように第2の実施形態によれば、従来の算術的マスクから論理的マスクへの変換方法に第1の実施形態を適用した構成により、被算術マスクデータを被論理マスクデータに変換する場合に必要な事前計算テーブルのサイズを縮小することができる。
 補足すると、第2の実施形態においては、第1の実施形態と同様に、[CT2003]方式を踏襲しているためサイドチャネル解析に対して耐性を有しつつ、事前計算テーブルサイズをより小さくできるため、ICカードのようなリソースに厳しい制約のある装置上へ実装することがより容易となる。
 なお、上記実施形態に記載した手法は、コンピュータに実行させることのできるプログラムとして、磁気ディスク(フロッピー(登録商標)ディスク、ハードディスクなど)、光ディスク(CD-ROM、DVDなど)、光磁気ディスク(MO)、半導体メモリなどの記憶媒体に格納して頒布することもできる。
 また、この記憶媒体としては、プログラムを記憶でき、かつコンピュータが読み取り可能な記憶媒体であれば、その記憶形式は何れの形態であっても良い。
 また、記憶媒体からコンピュータにインストールされたプログラムの指示に基づきコンピュータ上で稼働しているOS(オペレーティングシステム)や、データベース管理ソフト、ネットワークソフト等のMW(ミドルウェア)等が上記実施形態を実現するための各処理の一部を実行しても良い。
 さらに、本発明における記憶媒体は、コンピュータと独立した媒体に限らず、LANやインターネット等により伝送されたプログラムをダウンロードして記憶または一時記憶した記憶媒体も含まれる。
 また、記憶媒体は1つに限らず、複数の媒体から上記実施形態における処理が実行される場合も本発明における記憶媒体に含まれ、媒体構成は何れの構成であっても良い。
 尚、本発明におけるコンピュータは、記憶媒体に記憶されたプログラムに基づき、上記実施形態における各処理を実行するものであって、パソコン等の1つからなる装置、複数の装置がネットワーク接続されたシステム等の何れの構成であっても良い。
 また、本発明におけるコンピュータとは、パソコンに限らず、情報処理機器に含まれる演算処理装置、マイコン等も含み、プログラムによって本発明の機能を実現することが可能な機器、装置を総称している。
 なお、本願発明は、上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組合せにより種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。更に、異なる実施形態に亘る構成要素を適宜組合せてもよい。

Claims (4)

  1.  上位(k-1)bビットの数A1及び下位bビットの数A2からなるkbビットの数A(但し、b>4)と、bビットの数rとを加算して上位(k-1)bビットの加算結果を得る処理の前に、(4×2b/2)個のインデックスy(但し、0≦y<4×2b/2)の各々により個別に読出可能な(4×2b/2)個のbビットの要素データC’[y]を備えた事前計算テーブルC’を生成し、前記加算する処理中に、前記数A2と前記数rとの加算結果から前記数A1への桁上げを前記事前計算テーブルC’に基づいて伝播可能な演算装置であって、
     前記bビットの乱数γを生成する手段(105)と、
     前記各インデックスyと、当該各インデックスyに関連付けた各要素データC’[y]とを備えた事前計算テーブルC’を記憶するための記憶手段(106)と、
     前記記憶手段内の事前計算テーブルC’の1個目から2b/2個目までの要素データC’[y]を、前記インデックスyと前記数rの上位b/2ビットの数rHとに基づいて、
      C’[y]=2b/2     (但し、0≦y<2b/2-rH-1 )、
      C’[y]=2×2b/2   (但し、y=2b/2-rH-1 )、
      C’[y]=3×2b/2   (但し、2b/2-rH≦y<2b/2 )、
    の値に設定する手段(102)と、
     前記記憶手段内の事前計算テーブルC’の(2b/2+1)個目から(2×2b/2)個目までの要素データC’[y]を、前記インデックスyと前記乱数γとに基づいて、
    C’[y]=γ   (但し、2b/2≦y<2×2b/2)、
    の値に設定する手段(102)と、
     前記記憶手段内の事前計算テーブルC’の(2×2b/2+1)個目から(3×2b/2)個目までの要素データC’[y]を、前記インデックスyと前記乱数γと前記数rの下位b/2ビットの数rLとに基づいて、
      C’[y]=γ     (但し、2×2b/2≦y<3×2b/2-rL)、
      C’[y]=γ+1   (但し、3×2b/2-rL≦y<3×2b/2)、
    の値に設定する手段(102)と、
     前記記憶手段内の事前計算テーブルC’の(3×2b/2+1)個目から(4×2b/2)個目までの要素データC’[y]を、前記インデックスyと前記乱数γとに基づいて、
      C’[y]=γ+1   (但し、3×2b/2≦y<4×2b/2
    の値に設定する手段(102)と、
     前記数Aから前記数A1及び前記数A2を抽出する第1抽出手段(102)と、
     前記数A2の上位b/2ビットの数AH及び下位b/2ビットの数ALを当該数A2から抽出する第2抽出手段(102)と、
     前記(4×2b/2)個の要素データC’[y]の値を設定した後、前記抽出した数AHをインデックスyとして前記記憶手段内の事前計算テーブルC’から第1の要素データC’[AH]を読み出す第1読出手段(102)と、
     前記第1の要素データC’[AH]と前記抽出した数ALとの和をインデックスyとして前記記憶手段内の事前計算テーブルC’から第2の要素データC’[C’[AH]+AL]を読み出す第2読出手段(102)と、
     前記第2の要素データC’[C’[AH]+AL]、前記乱数γ、前記数A1及び当該数A1のビット数(k-1)bに基づいて、A1+C’[C’[AH]+AL]-γ mod 2(k-1)b を計算することにより、前記数A1への桁上げを伝播する桁上げ伝播手段(102)と、
     を備えたことを特徴とする演算装置。
  2.  請求項1に記載の演算装置において、
     0から2b-1までの2b個のインデックスIと、当該各インデックスIにより個別に読出可能な2b個の要素データG[I]=((I+r) mod 2b)^r とを備えた第2の事前計算テーブルGを記憶するための第2の記憶手段(但し、^は排他的論理和を表す記号)(106)と、
     前記インデックスI、前記乱数r及びビット数bに基づいて前記第2の事前計算テーブルGを生成し、当該第2の事前計算テーブルGを前記第2の記憶手段に書き込む手段(102)と、
     整数m及び被論理マスクデータx’を記憶するための第3の記憶手段(106)と、
     整数m及び被論理マスクデータx’をそれぞれm=k、x’=0に設定し、これら整数m及び被論理マスクデータx’を前記第3の記憶手段に書き込む手段(102)と、
     上位(m-1)bビットの数R1及び下位bビットの数R2からなるmbビットの数Rを入力するための手段(103)と、
     被算術マスクデータとしての前記数Aから前記乱数rをmod 2mb の下で減算する減算手段(102)と、
     この減算の後、前記入力された数Rから前記数R1,R2を抽出する手段(102)と、
     この抽出の後、前記Aに前記数R2をmod 2mb の下で加算する手段(102)と、
     この加算の後、前記第3の記憶手段内の整数mについて、m=1か否かを判定する手段(102)と、
     前記判定の結果、m=1の場合には前記加算後の数AをインデックスIとして、前記第2の記憶手段内の事前計算テーブルGから要素データG[A]を読み出す手段(102)と、
     この要素データG[A]、前記数R2及び前記乱数rに基づいて、上位の被論理マスクデータx’1を、x’1=(G[A]^R2)^r の値に計算する手段(102)と、
     この計算により得られた上位の被論理マスクデータx’1を、前記第3の記憶手段内の被論理マスクデータx’の最上位bビットに配置する手段(102)と、
     前記判定の結果、m>1の場合には、前記第1抽出手段、前記第2抽出手段、前記第1読出手段、前記第2読出手段及び前記桁上げ伝播手段による処理を順次実行する手段(102)と、
     この桁上げ伝播手段による処理の実行後、前記加算後の数Aの下位bビットの数A2をインデックスIとして、前記第2の記憶手段内の事前計算テーブルGから要素データG[A2]を読み出す手段(102)と、
     この要素データG[A2]、前記数R2及び前記乱数rに基づいて、下位の被論理マスクデータx’2を、x’2=(G[A2]^R2)^r の値に計算する手段(102)と、
     この計算により得られた下位の被論理マスクデータx’2を、前記第3の記憶手段内の被論理マスクデータx’の下位(k-m)bビット目に、当該下位の被論理マスクデータx’2の最下位ビットが合うように配置する手段(102)と、
     この配置の後、前記第3の記憶手段内の整数mを、m=m-1と更新し、前記減算手段の処理に戻る手段(102)と、
     を更に備えたことを特徴とする演算装置。
  3.  上位(k-1)bビットの数A1及び下位bビットの数A2からなるkbビットの数A(但し、b>4)と、bビットの数rとを加算して上位(k-1)bビットの加算結果を得る処理の前に、(4×2b/2)個のインデックスy(但し、0≦y<4×2b/2)の各々により個別に読出可能な(4×2b/2)個のbビットの要素データC’[y]を備えた事前計算テーブルC’を生成し、前記加算する処理中に、前記数A2と前記数rとの加算結果から前記数A1への桁上げを前記事前計算テーブルC’に基づいて伝播可能な演算装置に用いられ、コンピュータ読み取り可能な記憶媒体に記憶されたプログラムであって、
     前記bビットの乱数γを生成する処理を前記コンピュータに実行させるための第1プログラムコード(S210)、
     前記各インデックスyと、当該各インデックスyに関連付けた各要素データC’[y]とを備えた事前計算テーブルC’を前記演算装置の記憶手段(106)に書き込む処理を前記コンピュータに実行させるための第2プログラムコード、
     前記記憶手段内の事前計算テーブルC’の1個目から2b/2個目までの要素データC’[y]を、前記インデックスyと前記数rの上位b/2ビットの数rHとに基づいて、
      C’[y]=2b/2     (但し、0≦y<2b/2-rH-1 )、
      C’[y]=2×2b/2   (但し、y=2b/2-rH-1 )、
      C’[y]=3×2b/2   (但し、2b/2-rH≦y<2b/2 )、
    の値に設定する処理を前記コンピュータに実行させるための第3プログラムコード(S220~S240)、
     前記記憶手段内の事前計算テーブルC’の(2b/2+1)個目から(2×2b/2)個目までの要素データC’[y]を、前記インデックスyと前記乱数γとに基づいて、
    C’[y]=γ   (但し、2b/2≦y<2×2b/2)、
    の値に設定する処理を前記コンピュータに実行させるための第4プログラムコード(S250)、
     前記記憶手段内の事前計算テーブルC’の(2×2b/2+1)個目から(3×2b/2)個目までの要素データC’[y]を、前記インデックスyと前記乱数γと前記数rの下位b/2ビットの数rLとに基づいて、
      C’[y]=γ     (但し、2×2b/2≦y<3×2b/2-rL)、
      C’[y]=γ+1   (但し、3×2b/2-rL≦y<3×2b/2)、
    の値に設定する処理を前記コンピュータに実行させるための第5プログラムコード(S260,S270)、
     前記記憶手段内の事前計算テーブルC’の(3×2b/2+1)個目から(4×2b/2)個目までの要素データC’[y]を、前記インデックスyと前記乱数γとに基づいて、
      C’[y]=γ+1   (但し、3×2b/2≦y<4×2b/2
    の値に設定する処理を前記コンピュータに実行させるための第6プログラムコード(S280)、
     前記数Aから前記数A1及び前記数A2を抽出する第1抽出処理を前記コンピュータに実行させるための第7プログラムコード(S310)、
     前記数A2の上位b/2ビットの数AH及び下位b/2ビットの数ALを当該数A2から抽出する第2抽出処理を前記コンピュータに実行させるための第8プログラムコード(S320)、
     前記(4×2b/2)個の要素データC’[y]の値を設定した後、前記抽出した数AHをインデックスyとして前記記憶手段内の事前計算テーブルC’から第1の要素データC’[AH]を読み出す第1読出処理を前記コンピュータに実行させるための第9プログラムコード(S330)、
     前記第1の要素データC’[AH]と前記抽出した数ALとの和をインデックスyとして前記記憶手段内の事前計算テーブルC’から第2の要素データC’[C’[AH]+AL]を読み出す第2読出処理を前記コンピュータに実行させるための第10プログラムコード(S330)、
     前記第2の要素データC’[C’[AH]+AL]、前記乱数γ、前記数A1及び当該数A1のビット数(k-1)bに基づいて、A1+C’[C’[AH]+AL]-γ mod 2(k-1)b を計算することにより、前記数A1への桁上げを伝播する桁上げ伝播処理を前記コンピュータに実行させるための第11プログラムコード(S340)、
     を備えたことを特徴とするプログラム。
  4.  請求項3に記載のプログラムにおいて、
     0から2b-1までの2b個のインデックスIと、当該各インデックスIにより個別に読出可能な2b個の要素データG[I]=((I+r) mod 2b)^r とを備えた第2の事前計算テーブルG(但し、^は排他的論理和を表す記号)を、前記インデックスI、前記乱数r及びビット数bに基づいて生成し、当該生成した第2の事前計算テーブルGを前記演算装置の第2の記憶手段(106)に書き込む処理を前記コンピュータに実行させるための第12プログラムコード、
     整数m及び被論理マスクデータx’をそれぞれm=k、x’=0に設定し、これら整数m及び被論理マスクデータx’を前記演算装置の第3の記憶手段に書き込む処理を前記コンピュータに実行させるための第13プログラムコード(S110,S120)、
     上位(m-1)bビットの数R1及び下位bビットの数R2からなるmbビットの数Rを入力するための処理を前記コンピュータに実行させるための第14プログラムコード(S140)、
     被算術マスクデータとしての前記数Aから前記乱数rをmod 2mb の下で減算する減算処理を前記コンピュータに実行させるための第15プログラムコード(S130)、
     この減算の後、前記入力された数Rから前記数R1,R2を抽出する処理を前記コンピュータに実行させるための第16プログラムコード(S150)、
     この抽出の後、前記Aに前記数R2をmod 2mb の下で加算する処理を前記コンピュータに実行させるための第17プログラムコード(S150)、
     この加算の後、前記第3の記憶手段内の整数mについて、m=1か否かを判定する処理を前記コンピュータに実行させるための第18プログラムコード(S160)、
     前記判定の結果、m=1の場合には前記加算後の数AをインデックスIとして、前記第2の記憶手段内の事前計算テーブルGから要素データG[A]を読み出す処理を前記コンピュータに実行させるための第19プログラムコード(S170)、
     この要素データG[A]、前記数R2及び前記乱数rに基づいて、上位の被論理マスクデータx’1を、x’1=(G[A]^R2)^r の値に計算する処理を前記コンピュータに実行させるための第20プログラムコード(S170,S180)、
     この計算により得られた上位の被論理マスクデータx’1を、前記第3の記憶手段内の被論理マスクデータx’の最上位bビットに配置する処理を前記コンピュータに実行させるための第21プログラムコード(S190)、
     前記判定の結果、m>1の場合には、前記第1抽出処理、前記第2抽出処理、前記第1読出処理、前記第2読出処理及び前記桁上げ伝播処理を順次実行する処理を前記コンピュータに実行させるための第22プログラムコード(S161~S163)、
     この桁上げ伝播処理の実行後、前記加算後の数Aの下位bビットの数A2をインデックスIとして、前記第2の記憶手段内の事前計算テーブルGから要素データG[A2]を読み出す処理を前記コンピュータに実行させるための第23プログラムコード(S164)、
     この要素データG[A2]、前記数R2及び前記乱数rに基づいて、下位の被論理マスクデータx’2を、x’2=(G[A2]^R2)^r の値に計算する処理を前記コンピュータに実行させるための第24プログラムコード(S164,S165)、
     この計算により得られた下位の被論理マスクデータx’2を、前記第3の記憶手段内の被論理マスクデータx’の下位(k-m)bビット目に、当該下位の被論理マスクデータx’2の最下位ビットが合うように配置する処理を前記コンピュータに実行させるための第25プログラムコード(S166)、
     この配置の後、前記第3の記憶手段内の整数mを、m=m-1と更新し、前記減算処理に戻る処理を前記コンピュータに実行させるための第26プログラムコード(S167)、
     を更に備えたことを特徴とするプログラム。
PCT/JP2010/052904 2009-03-10 2010-02-24 演算装置及びプログラム WO2010103928A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP10750682.6A EP2410503A4 (en) 2009-03-10 2010-02-24 CALCULATION DEVICE AND PROGRAM
US13/227,648 US8631249B2 (en) 2009-03-10 2011-09-08 Operation unit and program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2009056873A JP4837058B2 (ja) 2009-03-10 2009-03-10 演算装置及びプログラム
JP2009-056873 2009-03-10

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/227,648 Continuation US8631249B2 (en) 2009-03-10 2011-09-08 Operation unit and program

Publications (1)

Publication Number Publication Date
WO2010103928A1 true WO2010103928A1 (ja) 2010-09-16

Family

ID=42728218

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/052904 WO2010103928A1 (ja) 2009-03-10 2010-02-24 演算装置及びプログラム

Country Status (4)

Country Link
US (1) US8631249B2 (ja)
EP (1) EP2410503A4 (ja)
JP (1) JP4837058B2 (ja)
WO (1) WO2010103928A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010210940A (ja) * 2009-03-10 2010-09-24 Toshiba Corp 演算装置及びプログラム

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101026439B1 (ko) * 2009-07-20 2011-04-07 한국전자통신연구원 Seed 암호화에서 차분 전력 분석 공격을 방어하기 위한 마스킹 방법
KR101467719B1 (ko) * 2010-12-24 2014-12-01 미쓰비시덴키 가부시키가이샤 서명 생성 장치 및 서명 생성 방법 및, 컴퓨터 판독 가능한 기록 매체
EP2634953A1 (en) * 2012-03-02 2013-09-04 Gemalto SA Countermeasure method against side channel analysis for cryptographic algorithms using boolean operations and arithmetic operations
FR2994608B1 (fr) * 2012-08-16 2015-09-04 Oberthur Technologies Procede de traitement cryptographique comprenant un acces securise a une pluralite de tables de substitution, dispositifs et produit programme d'ordinateur correspondants.
US9391773B2 (en) * 2014-04-04 2016-07-12 Qualcomm Incorporated Elliptic curve point multiplication procedure resistant to side-channel information leakage
AU2015263874B2 (en) 2014-05-23 2020-01-30 Hologic, Inc. Methods and devices for treating pelvic conditions
DE102017002153A1 (de) * 2017-03-06 2018-09-06 Giesecke+Devrient Mobile Security Gmbh Übergang von einer booleschen Maskierung zu einer arithmetischen Maskierung
CN109474268B (zh) * 2018-12-19 2024-02-06 北京比特大陆科技有限公司 电路结构、电路板和超算设备
US11507699B2 (en) * 2019-09-27 2022-11-22 Intel Corporation Processor with private pipeline

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000066585A (ja) * 1998-08-20 2000-03-03 Toshiba Corp 暗号化・復号装置、暗号化・復号方法、およびそのプログラム記憶媒体
JP2002366029A (ja) * 2001-06-13 2002-12-20 Fujitsu Ltd Dpaに対して安全な暗号化
JP2005236977A (ja) * 2004-02-19 2005-09-02 Samsung Electronics Co Ltd 電力分析攻撃に安全な基本演算装置および方法
JP2008233683A (ja) * 2007-03-22 2008-10-02 Toshiba Corp 暗号処理装置及びプログラム

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10341096A1 (de) * 2003-09-05 2005-03-31 Giesecke & Devrient Gmbh Übergang zwischen maskierten Repräsentationen eines Wertes bei kryptographischen Berechnungen
JP2008224830A (ja) * 2007-03-09 2008-09-25 Toshiba Corp 耐タンパーベキ乗演算方法
JP4837058B2 (ja) * 2009-03-10 2011-12-14 株式会社東芝 演算装置及びプログラム

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000066585A (ja) * 1998-08-20 2000-03-03 Toshiba Corp 暗号化・復号装置、暗号化・復号方法、およびそのプログラム記憶媒体
JP2002366029A (ja) * 2001-06-13 2002-12-20 Fujitsu Ltd Dpaに対して安全な暗号化
JP2005236977A (ja) * 2004-02-19 2005-09-02 Samsung Electronics Co Ltd 電力分析攻撃に安全な基本演算装置および方法
JP2008233683A (ja) * 2007-03-22 2008-10-02 Toshiba Corp 暗号処理装置及びプログラム

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
J-S. CORON, A. TCHULKINE: "A New Algorithm for Switching from Arithmetic to Boolean Masking", CHES 2003, LNCS, vol. 2779, 2003, pages 89 - 97
L. GOUBIN, J. PATARIN: "DES and Differential Power Analysis - The Duplication Method", CHES' 99, LNCS, vol. 1717, 1999, pages 158 - 172
L. GOUBIN: "A Sound Method for Switching Between Boolean and Arithmetic Masking", CHES 2001, LNCS, vol. 2162, 2001, pages 3 - 15
MESSERGES T.S.: "Securing the AES Finalists Against Power Analysis Attacks", 7TH INTERNATIONAL WORKSHOP, FSE 2000 PROCEEDINGS, April 2000 (2000-04-01), pages 150 - 164, XP002240613 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010210940A (ja) * 2009-03-10 2010-09-24 Toshiba Corp 演算装置及びプログラム

Also Published As

Publication number Publication date
EP2410503A1 (en) 2012-01-25
JP2010210940A (ja) 2010-09-24
EP2410503A4 (en) 2014-08-27
US8631249B2 (en) 2014-01-14
JP4837058B2 (ja) 2011-12-14
US20120047417A1 (en) 2012-02-23

Similar Documents

Publication Publication Date Title
JP4837058B2 (ja) 演算装置及びプログラム
US20070064930A1 (en) Modular exponentiation with randomized exponent
JP4700051B2 (ja) 暗号装置及び暗号方法
US20060067527A1 (en) Method for making seed value used in pseudo random number generator and device thereof
Samwel et al. Breaking ed25519 in wolfssl
JPWO2008146482A1 (ja) 暗号化装置、復号化装置、暗号化方法及び集積回路
JP4662802B2 (ja) 計算方法、計算装置及びコンピュータプログラム
TWI686722B (zh) 用於加密操作之指數分拆技術
KR20040067779A (ko) 정보 처리방법
CN112740618A (zh) 签名装置、验证装置、签名系统、签名方法、签名程序、验证方法以及验证程序
CN113467750A (zh) 用于基数为4的srt算法的大整数位宽除法电路及方法
WO2019113844A1 (zh) 生成随机数的方法、芯片和电子设备
JP5175983B2 (ja) 演算装置
CN108418687B (zh) 一种适合sm2算法的快速模约减方法和介质
JP2009169316A (ja) ハッシュ関数演算装置及び署名装置及びプログラム及びハッシュ関数演算方法
KR20180121248A (ko) 부채널 공격에 안전한 연산 장치 및 방법
CN114257380A (zh) 一种数字签名方法、系统及设备
WO2017102879A1 (en) A computation device and method
Knežević et al. Signal processing for cryptography and security applications
Simões et al. Low-latency masking with arbitrary protection order based on click elements
WO2011036747A1 (ja) 演算装置
JP4243179B2 (ja) 演算装置
JP6973677B1 (ja) 逆数算出方法、装置、およびプログラム
US20230047879A1 (en) Methods and systems for reducing propagation delays in hardware implementation of zuc cryptographic algorithms
KR101775597B1 (ko) 고속 모듈로 연산 장치

Legal Events

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

Ref document number: 10750682

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2010750682

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE