Hardened encoded message check for RSA signature verification
Aspects of hardened encoded message check systems and methods for RSA signature verification are described. In one implementation, an encoded message is received that includes an array of words. Each of the words in the encoded message are processed using an expected value and a share associated with each word. A verification value is calculated based on the array of words in the encoded message, the expected value, and the share associated with each word. A determination is performed regarding whether the verification value is correct and, if the verification value is correct, a hardware device is unlocked.
1 . A method performed by a hardware device, the method comprising:
receiving an encoded message that comprises an array of words and a digest value;
performing an exclusive OR (XOR) operation on each word of the array of the words in the encoded message using an expected value that corresponds to the word and a share value associated with the word of the array of the words;
calculating a verification value based on respective results of the XOR operations performed on the words of the array of the words of the encoded message, the expected values that correspond to the words, and the share values associated with words;
determining, based on an expected value of the verification value, whether the verification value is correct;
comparing the digest value of the encoded message to a digest of a boot image of the hardware device; and
unlocking the hardware device responsive to determining that the verification value is correct and the digest value matches the digest of the boot image of the hardware device.
2 . The method of claim 1 , further comprising writing the verification value to a hardware register associated with the hardware device.
3 . The method of claim 1 , wherein calculating the verification value of the words comprises:
performing a plurality of XOR operations on the respective results provided by the XOR operations performed on the words of the array of the words, the expected values that correspond to the words, and the share values associated with the array of the words.
4 . The method of claim 1 , wherein the encoded message further comprises a padding value or a hash function identifier.
5 . The method of claim 1 , further comprising computing the encoded message based on a Rivest-Shamir-Adleman (RSA) signature scheme.
6 . The method of claim 1 , further comprising determining the encoded message by performing a plurality of XOR operations on a plurality of word, expected value, and share value groups.
7 . The method of claim 1 , further comprising maintaining the hardware device in a locked state responsive to determining that the verification value is not correct.
8 . A method performed by a hardware device, the method comprising:
receiving an encoded message that comprises an array of words, a padding value, a hash function identifier, and a digest value;
performing an exclusive OR (XOR) operation on each of the words in the array of the words in the encoded message using an expected value that corresponds to the word and a share value associated with the word;
calculating a verification value based on respective results of the XOR operation performed on each word of the array of the words in the encoded message, the expected value that corresponds to the word, and the share value associated with the word;
determining whether the verification value matches an expected verification value for the encoded message;
comparing the digest value of the encoded message to a digest of a boot image of the hardware device; and
unlocking a hardware device responsive to determining that the verification value matches the expected verification value and the digest value matches the digest of the boot image of the hardware device; or
maintaining the hardware device in a locked state responsive to determining that the verification value does not match the expected verification value.
9 . The method of claim 8 , further comprising writing the verification value to a hardware register associated with the hardware device.
10 . The method of claim 8 , wherein performing the XOR operation on each of the words of the array of the words comprises:
performing, for each word of the array of the words, an XOR operation on the expected value that corresponds to the word and the share value associated with the word; and
performing, for each word in the array of the words, the XOR operation on the word with a result of the XOR operation between the expected value that corresponds to the word and the share value associated with the word.
11 . A hardware device comprising:
a processor; and
a computer-readable storage medium comprising instructions that, responsive to execution by the processor, implement an access control module of the hardware device to:
receive an encoded message that comprises an array of words and a digest value;
perform an exclusive OR (XOR) operation on each word of the array of the words in the encoded message with an expected value that corresponds to the word and a share value associated with the word of the array of the words;
calculate a verification value based on respective results of the XOR operations performed on each word of the array of the words in the encoded message, the expected value that corresponds to the word, and the share value associated with the word;
determine whether the verification value is correct;
compare the digest value of the encoded message to a digest of a boot image of the hardware device; and
unlock the hardware device responsive to determining that the verification value is correct and the digest value matches the digest of the boot image of the hardware device.
12 . The hardware device of claim 11 , wherein the access control module is further implemented to:
write the verification value to a hardware register associated with the hardware device.
13 . The hardware device of claim 11 , wherein to calculate the verification value, the access control module is further implemented to:
perform a plurality of XOR operations on the respective results provided by the XOR operations performed on the words of the array of the words, the expected values that correspond to the words, and the share values associated with the words.
14 . The hardware device of claim 11 , wherein the access control module is further implemented to:
determine the digest of the boot image of the hardware device.
15 . The hardware device of claim 14 , wherein the access control module is further implemented to apply a hash function to the boot image of the hardware device to determine the digest of the boot image.
16 . The method of claim 8 , further comprising determining the encoded message based on a Rivest-Shamir-Adleman (RSA) signature scheme.
17 . The method of claim 1 , further comprising determining the digest of the boot image of the hardware device.
18 . The method of claim 17 , further comprising applying a hash function to the boot image of the hardware device to determine the digest of the boot image.
19 . The method of claim 8 , further comprising determining the digest of the boot image of the hardware device.
20 . The method of claim 19 , further comprising applying a hash function to the boot image of the hardware device to determine the digest of the boot image.