SPRUJ17H March 2022 – October 2024 AM2631 , AM2631-Q1 , AM2632 , AM2632-Q1 , AM2634 , AM2634-Q1
The MODEXP[-CRT] operations specified in Table 7-110, Modular Exponentiation, are at the core of the RSA, DSA and DH public key algorithms.
To speed up RSA private key operations, it is often advantageous to pre-calculate a number of odd powers. For RSA public (as opposed to private) key operations, typically no odd powers should be pre-calculated, that is, Shift should be set to '1'. When using multiple pre-calculated odd powers, make sure that the WorkSpace has sufficient room to store these.
To save PKA RAM space, the MODEXP operation allows the message input (M) to be located at the start of the WorkSpace. So PKA_CPTR and PKA_DPTR registers are allowed to be identical.
Function | Requirements |
---|---|
MODEXP | 1. 0 < ALen <= Max_Len |
2. 1 < BLen <= Max_Len | |
3. Modulus B must be odd (that is, the least significant bit must be ONE) | |
4. Modulus B > 232 | |
5. Base C < Modulus B | |
6. Vectors B and C must be followed by an empty 32-bit ‘buffer’ word | |
MODEXP-CRT | 1. 0 < ALen <= Max_Len |
2. 1 < BLen <= Max_Len | |
3. Mod P and Mod Q must be odd (that is, the least significant bits must be ONE) | |
4. Mod P > Mod Q > 232 (Mod P must be larger than Mod Q) | |
5. Mod P and Mod Q must be co-prime (their GCD must be 1) | |
6. 0 < Exp P < (Mod P -– 1) | |
7. 0 < Exp Q < (Mod Q -– 1) | |
8. (Q inverse · Mod Q) = 1 (modulo Mod P) | |
9. Input < (Mod P · Mod Q) | |
10. Mod P and Mod Q must be followed by an empty 32-bit ‘'buffer'’ word |
Function | WorkSpace Size (in 32-bit Words), Result Vector is either BLen or 2xBLen 32-bit Words Long |
---|---|
MODEXP | The maximum of: (2 x (BLen + 2 – (BLen MOD 2)) + 10 and (# of odd powers ) x (BLen + 2 – (BLen MOD 2)) |
MODEXP-CRT | The maximum of: (3 x (BLen + 2 – (BLen MOD 2)) + 10 and (# of odd powers + 1) x (BLen + 2 – (BLen MOD 2)) |
Status Code | Description |
---|---|
0x01 | Command executed successfully. |
0x03 | Modulus is even. |
0x05 | Exponent is zero; This value should never occur in practice and is treated as an error. |
0x07 | Modulus is too short, that is, less than 33 bits. |
0x09 | Exponent is one. This value should never occur in practice and is treated as an error. |