RM0453
Using precomputed Montgomery parameters (PKA fast mode)
As explained in
can be beneficial for the application to compute only once the corresponding Montgomery
parameter (see, for example,
To manage Fast Mode usage the recommended procedure is described below:
1.
Load in PKA RAM the modulus size and value information. Such information is
compiled in
2.
Program in PKA_CR register the PKA in
(MODE="0x1") then assert the START bit.
3.
Wait until the PROCENDF bit in the PKA_SR register is set to "1", then read back from
PKA memory the corresponding Montgomery parameter, and then clear PROCENDF
bit by setting PROCENDFC bit in PKA_CLRFR.
4.
Proceed with the required PKA operation, loading on top of regular input data the
Montgomery information R2 mod m. All addresses are indicated in
24.3.7
PKA error management
When PKA is used some errors can occur:
•
The access to PKA RAM falls outside the expected range. In this case the Address
Error flag (ADDRERRF) is set in the PKA_SR register.
•
An AHB access to the PKA RAM occurred while the PKA core was using it. In this case
the RAM Error Flag (RAMERRF) is set in the PKA_SR register, reads to PKA RAM
return zero, while writes are ignored.
For each error flag above PKA generates an interrupt if the application sets the
corresponding bit in PKA_CR register (see
ADDRERRF and RAMERRF errors are cleared by setting the corresponding bit in
PKA_CLRFR.
The PKA can be re-initialized at any moment by resetting the EN bit in the PKA_CR register.
24.4
PKA operating modes
24.4.1
Introduction
The various operations supported by PKA are described in the following subsections,
clarifying the associated format of the input data and of the results, both stored in the PKA
RAM.
The following information applies to all PKA operations.
•
PKA core processes 32-bit words
•
Supported operand "Size" are:
–
–
Section
24.3.4, when computing many operations with the same modulus it
Section
Section
24.5.1.
ROS (RSA Operand Size): data size is (rsa_size/32+1) words, with rsa_size equal
to the chosen modulus length. For example, when computing RSA with an
operand size of 1024 bits, ROS is equal to 33 words, or 1056 bits.
EOS (ECC Operand Size): data size is (ecc_size/32+1) words, with ecc_size
equal to the chosen prime modulus length. For example, when computing ECC
with an operand size of 192 bits, EOS is equal to 7 words, or 224 bits.
24.4.5). This is know as "fast mode".
Montgomery parameter computation
Section 24.6
RM0453 Rev 1
Public key accelerator (PKA)
Section
for details).
mode
24.4.
705/1461
728
Need help?
Do you have a question about the STM32WL5 Series and is the answer not in the manual?
Questions and answers