RM0461
1.
Inward (or outward) conversion into (or from) Montgomery domain
a)
b)
2.
Simple modular multiplication A x B mod n
a)
b)
c)
3.
Multiple modular multiplication A x B x C mod n
a)
b)
c)
d)
e)
f)
g)
h)
Operation instructions for Montgomery multiplication are summarized in
Parameters with direction
IN
OUT
1. Result in Montgomery domain or in natural domain, depending upon the inputs nature (see examples
and 3).
22.4.6
Modular exponentiation
Modular exponentiation operation is commonly used to perform a single-step RSA
operation. It consists in the computation of A
Operation instructions for modular exponentiation are summarized in
mode) and in
Let's assume A is an integer in the natural domain
Compute r2modn using
Result AR= A x r2modn mod n is A in the Montgomery domain
Let's assume BR is an integer in the Montgomery domain
Result B = BR x 1 mod n is B in the natural domain
Similarly, above value AR computed in a) can be converted into the natural
domain by computing A = AR x 1 mod n
Compute r2modn using
Compute AR = A x r2modn mod n. Output is in the Montgomery domain
Compute AB= AR x B mod n. Output is in natural domain
Compute r2modn using
Compute AR = A x r2modn mod n. Output is in the Montgomery domain
Compute BR = B x r2modn mod n. Output is in the Montgomery domain
Compute ABR= AR x BR mod n. Output is in the Montgomery domain
Compute CR = C x r2modn mod n. Output is in the Montgomery domain
Compute ABCR= ABR x CR mod n. Output is in the Montgomery domain
(optional) Repeat the two steps above if more operands need to be multiplied
Compute ABC= ABCR x 1 mod n to retrieve the result in natural domain
Table 137. Montgomery multiplication
MODE
0x10
Operand length
(In bits, not null)
Operand A
(0 ≤ A < n)
Operand B
(0 ≤ B < n)
Modulus value n
(Odd integer only, n < 2
(1)
Result: AxB mod n
Table 139
(fast mode). Fast mode usage is explained in
Montgomery parameter computation
Montgomery parameter computation
Montgomery parameter computation
Value (Note)
3136
-
e
mod n.
RM0461 Rev 5
Public key accelerator (PKA)
Table
Storage
PKA_CR
RAM@0x404
RAM@0x8B4
RAM@0xA44
)
RAM@0xD5C
RAM@0xBD0
Table 138
Section
137.
Size
6 bits
32 bits
ROS
2
(normal
22.3.6.
601/1306
617
Need help?
Do you have a question about the STM32WLEx and is the answer not in the manual?