SPRUJ17H March 2022 – October 2024 AM2631 , AM2631-Q1 , AM2632 , AM2632-Q1 , AM2634 , AM2634-Q1
The basic operation of the LNME unit is the Modular Montgomery Multiplication (MMM). There are three versions of this operation that all perform the following operation:
Result = X × Y × R-1 mod N
In the formula above, the number R-1 is not really used as an operand to the operation, in reality X × Y + m × N is computed where m is derived from X, Y and N, but the end result is the same.
The difference between the three MMM-type operations is in the location where the Result vector is stored, as illustrated in Figure 7-105 below:
An 'MMM' type operation does not write its result before the operation is completed. As a consequence, there are no restrictions with respect to overlap of input and output vectors in PKA RAM.
In the actual Modular Montgomery Multiplication:
Montgomery parameter R is defined by the operational parameters of the LNME unit (see Table 7-106, LNME Operational Parameters) and the number of bits in the modulus vector. Let xbits be the number of bits needed to represent the X vector and nbits be the number of bits needed to represent the N vector, then R can be calculated as follows:
When r > (nbits + 1), the X and Y input operands may be up to 2N in value. This restriction on r is always adhered to due to the way that r is calculated.
An MMM-type operation can return a Result value equal to or higher than modulus N, but the Result will always be below 2N (even when X and/or Y are higher than N). If this happens, an overflow status bit will be set so that a correction can be performed.