摘要 |
PROBLEM TO BE SOLVED: To perform masking to a variable of any data length and to obtain a value in which an AND operation result or OR operation result of the variable is subjected to masking, in a small circuit scale.SOLUTION: A logical operation device 10 includes: a mask processing unit 11 that performs mask processing of a variable of any data length by using a mask value that has any data length and varies with variable; and a logical operation unit 12 that performs an XOR operation between a common function F and an AND operation or OR operation of the variable having been subjected to the mask processing. The common function F is defined by the expression: F(mx,my,X,Y)=mx.Y[xor]my.X; where mx,my are mask values, and X,Y are variables for storing values obtained by masking variables x, y with mx, my. For instance, for the AND operation, the logical operation unit 12 performs an exclusive OR operation between the function F and the AND operation of variables X and Y, and the exclusive OR operation result is equal to a value subjected to an exclusive OR operation between an AND operation result of original variables x and y and an AND operation result of mask values mx and my. |