Patent ID: 8050402

Claim:
A method for secure conversion between two different random maskings used for cryptographic functions, comprising converting a first binary data word masked by a binary mask word according to a first masking process, into a corresponding second binary data word masked by said binary mask word according to a second masking process, the first and second binary data words and the binary mask word comprising corresponding pluralities of bits wherein each of said pluralities of bits comprises a least significant bit, and at least one i-th bit, i≧2, wherein converting a first binary data word into a second binary data word comprises: taking as a least significant bit of the second binary data word the least significant bit of the first binary data word; calculating the first bit of the second binary data word by: performing a first XORing of the least significant bit of the binary mask word with the first bit of the first binary data word and selecting as a value of the first bit of the second binary data word either a result of said first XORing or the first bit of the first binary data word, depending on a value related to the least significant bit of the first or the second binary data word; and calculating the i-th bit of the second binary data word by: performing a second XORing of the i-th bit of the first binary data word with the (i−1)-th bit of the binary mask word; performing a third XORing of the i-th bit of the first binary data word with a first value related to the (i−1)-th bit of the first or the second binary data word; and selecting as a value of the i-th bit of the second binary data word a result of either said second XORing or said third XORing, depending on a second value related to the (i−1)-th bit of the first or the second binary data word.