Chapter 7. Public Key Execution Unit
7-23
PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE
ECC Routines
7.3.12 ECC F
2
m Montgomery Modular Multiplication
(
(A
×
B
×
R
-1
) mod N
)
The (A
×
B
×
R
-1
) mod N calculation is the core function of the PKEU. This function is
used to assist the point add and double routines in completing their functions. For ECC
purposes, this function will rarely be used directly by the host processor. This function
operates with a minimum of 5 digits (Modsize = 4). The complete set of I/O conditions is
shown below:
Figure 7-15. F
2
m Modular Multiplication Register Usage
Table 7-16. F
2
m Modular Multiplication
F
2
m Modular Multiply
Computation
C = A * B * R
-1
mod N, where A, B, and C are integers less than N and R = 2
16D
where D is the
number of digits of the modulus vector
Entry name
modularmultiply (same for F
p
or F
2
m)
Entry address
0x00a(modularmultiply)
Pre-conditions
A0-3 = A (binary polynomial, exact A-location pre-selected in Control Register)
B0-3 = B (binary polynomial, exact B-location pre-selected in Control Register)
N0-3 = irreducible polynomial of the ECC system
Post-conditions
A0-3 = A operand is preserved
B0-3 = results of modular multiplication stored where the B operand was located
Unless explicitly noted, all other registers are not guaranteed to be any particular value.
Special
conditions
Typically, though it is not mandatory, the operands will be in the Montgomery residue system. The only
time this would not be the case is when manually placing a value into the Montgomery residue system.
N1
N2
N3
A0
A1
A2
A3
B0
B1
B2
B3
Initial Condition
Final Condition
?
?
?
N0
C (if B0 selected)
B (if B0 selected)
irred. poly. (if N0 selected)
irred. poly. (if N0 selected)
A (if A0 selected)
?
?
?
XYZ
F2M
EXP(k)
regAsel
regBsel
regNsel
‘1’ - F
2
m enabled
same
set (00, 01, 10, 11)
set (00, 01, 10, 11)
set (00, 01, 10, 11)
same
same
same
Modsize
EXP(k)_SIZE
set
same
A (if A0 selected)
ECC
same
‘1’ - ECC enabled
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
.
..
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
.
..