Public key accelerator (PKA)
22.4.3
Modular addition
Modular addition operation consists in the computation of A + B mod n. Operation
instructions are summarized in
Parameters with direction
IN
OUT
22.4.4
Modular subtraction
Modular subtraction operation consists in the following computations:
•
If A ≥ B result equals A - B mod n
•
If A < B result equals A + n - B mod n
Operation instructions are summarized in
Parameters with direction
IN
OUT
22.4.5
Modular and Montgomery multiplication
To be more efficient when performing a sequence of multiplications the PKA accelerates
multiplication which has at least one input in the Montgomery domain. The two main uses of
this operation are:
•
Map a value from natural domain to Montgomery domain and vice-versa
•
Perform a modular multiplication A x B mod n
The method to perform above operations are described below. Note that "x" function is this
operation, and A, B, C operands are in the natural domain.
600/1306
Table
Table 135. Modular addition
MODE
0x0E
Operand length
(In bits, not null)
Operand A
(0 ≤ A < n)
Operand B
(0 ≤ B < n)
Modulus value n
(n < 2
Result: A+B mod n
(0 ≤ result < n)
Table 136. Modular subtraction
MODE
0x0F
Operand length
(In bits, not null)
Operand A
(0 ≤ A < n)
Operand B
(0 ≤ B < n)
Modulus value n
(n < 2
Result: A-B mod n
(0 ≤ result < n)
135.
Value (Note)
3136
)
Table
136.
Value (Note)
3136
)
RM0461 Rev 5
Storage
PKA_CR
6 bits
RAM@0x404
32 bits
RAM@0x8B4
RAM@0xA44
RAM@0xD5C
RAM@0xBD0
Storage
PKA_CR
6 bits
RAM@0x404
32 bits
RAM@0x8B4
RAM@0xA44
RAM@0xD5C
RAM@0xBD0
RM0461
Size
ROS
Size
ROS
Need help?
Do you have a question about the STM32WLEx and is the answer not in the manual?