Public key accelerator (PKA)
Note:
Fractional results for above formulas are rounded up to the nearest integer since PKA core
processes 32-bit words.
Note:
The maximum ROS is 99 words (3136-bit max exponent size), while the maximum EOS is
21 words (640-bit max operand size).
•
The column indicated with Storage in the following tables indicates either the Register
PKA_CR, or the address offset within the PKA, located in the PKA RAM area (starting
from 0x400). To recover the physical address of an operand the application must add to
the indicated offset the base address of the PKA.
•
About writing parameters ("IN" direction)
–
–
–
•
About PKA outputs ("OUT" direction)
–
Caution:
Validity of all input parameters to the PKA must be checked before issuing any PKA
operation. Indeed, the PKA assumes that all input parameters are valid and consistent with
each other.
24.4.2
Montgomery parameter computation
This function is used to compute the Montgomery parameter (R
convert operands into the Montgomery residue system representation.
Note:
This operation can also be used with ECC curves. In this case prime modulus length and
EOS size must be used.
Operation instructions for Montgomery parameter computation are summarized in
Table
146.
Parameters with direction
IN
OUT
702/1450
When elements are written as input in the PKA memory, an additional word with all
bits equal to zero must be added. As an example, when ECC P256 is used and
when loading an input (represented on 256 bits or 8 words), an additional word is
expected by the PKA and it has to be filled with zeros.
About endianess, for example to prepare the operation ECC Fp scalar
multiplication, when application writes x
(EOS= 9 words) the least significant bit is to be placed in bit 0 at address offset
0x55C; the most significant bit is to be placed in bit 31 of address offset 0x578.
Then, as mentioned above, word 0x00000000 should also be written at address
offset 0x57C.
Unless indicated otherwise all operands in the tables are integers.
Unless specified in the tables PKA does not provide an error output when a wrong
parameter is written by the application.
Table 146. Montgomery parameter computation
MODE
0x01
Modulus length
(In bits, 0 ≤ value < 3136bits)
Modulus value n
(Odd integer only, n < 2
2
Result: R
n
coordinate for an ECC P256 curve
p
Value (Note)
3136
-
RM0453 Rev 5
2
mod n) used by PKA to
Storage
PKA_CR
RAM@0x404
)
RAM@0xD5C
RAM@0x594
RM0453
Size
6 bits
32 bits
ROS
Need help?
Do you have a question about the STM32WL5 Series and is the answer not in the manual?
Questions and answers