The following register bit-fields are used:
LNME0_BBASE
/
LNME1_BBASE
[10-1] BBASE and [30-16] BCNTR;
LNME0_NACC
/
LNME1_NACC
/[20:16] EXPARRAY;
LNME0_XBASE
/
LNME1_XBASE
[10-1] XBASE;
LNME0_NBASE
/
LNME1_NBASE
[10-1] NBASE and [25-16] NYDIGITS;
LNME0_NZERO
/
LNME1_NZERO
[7-0] NZERO (or LNME0_NACC
/
LNME1_NACC
[7-0] NACC);
LNME0_YBASE
/
LNME1_YBASE
[10-1] YBASE and [23-16] NPASSES;
LNME0_CONTROL
/
LNME1_CONTROL
[2] EXP_CMD;
LNME0_STATUS
/
LNME1_STATUS
[1] MMM_BUSY and [0] OVERFLOW.
The NXDIGITS field is ignored (don't care value) for a MMEXP operation.
- B is the exponent vector; the minimum amount of bits needed to represent the actual exponent value is bbits.
- BBASE specifies its base address as 32 bits word offset in PKA RAM: (0 <= BBASE < 2048d, must be even).
- BCNTR specifies the number of bits in the exponent B, offset by 2:
BCNTR = bbits – 2; (0 <= BCNTR < 4159d).
The most significant bit of the exponent is (by definition) always a '1' and need not be actually stored in PKA RAM. - N is the modulus vector, the minimum amount of bits needed to represent its value is nbits.
- NBASE specifies its base address as 32 bits word offset in PKA RAM: (0 <= NBASE < 2048d, must be even).
- NYDIGITS specifies its length in 32-bit words, offset by 1:
NYDIGITS = round[(nbits + Alpha + 1) / Beta] – 1; (0 <= NYDIGITS < 131d).
The operand should be padded with zeros, if an extra overflow digit is required. - X is the start location of a table with 'odd powers', each with value < 2N. EXPARRAY must be loaded with the number of odd powers minus 1. XBASE specifies its base address as 32 bits word offset in PKA RAM: (0 <= XBASE < 2048d, must be even).
Each of the 'odd powers' occupies the same number of words (NYDIGITS + 1) as the modulus vector N and should be padded with zeros to that length. Between 'odd powers', a buffer word is inserted, if the length of the vectors is an odd amount of words (needed to start the next 'odd power' at a 64 bits boundary).
When exponent recoding is used an array of 'odd powers', (A × R) mod N, (A × R)3 mod N etc, is pre-calculated and stored in PKA Memory. If no exponent recoding is done, just the first 'odd power' (representing the base value converted into Montgomery domain) needs to be loaded and EXPARRAY can be set to zero. - Y is the location where intermediate values and the final result will be stored. This area need not be initialized before starting the MMEXP operation.
- YBASE specifies its base address where it is stored in PKA RAM: (0 <= YBASE < 2048d, must be even).
The final result will have the same number of words (NYDIGITS+1) as the modulus vector N. - nrOfPasses specifies the number of passes the Y- and N-operands have to pass the MMM data path:
- nrOfPasses = round[(nbits + 2 + Alpha) / (Pe * Alpha)]; (1 <= nrOfPasses < 128d)
- The NPASSES register must be loaded with: nrOfPasses – 1; (0 <= NPASSES < 127d)
- NACC must contain the 8 least significant bits of N’ in equation R × R–1 – N × N' = 1.
Loading the NZERO register field with the least significant 8 bits of the N vector automatically performs the following algorithm to set NACC correctly: - Set the 'MMEXP' bit ([2] EXP_CMD) of the LNME0_CONTROL/LNME1_CONTROL
register to '1' to start the MMEXP operation. This bit will be cleared
automatically at the end of the operation.
- The MMMbusy bit ([1] MMM_BUSY) in the LNME0_STATUS/LNME1_STATUSregister indicates that the MMEXP operation is busy. This
bit will be cleared automatically at the end of the operation.
- Upon completion of the MMEXP operation, the overflow bit ([0] OVERFLOW) in the
LNME0_STATUS/LNME1_STATUS
register will be set to indicate that there was an overflow. This bit is cleared
at the start of the operation.
All numbers in the PKA RAM are stored least
significant word first. See Figure 7-106, PKA Memory Map for MMEXP Operation, for the location of all operands and
the result vector for the MMEXP operation.