7-16
MPC180E Security Processor User’s Manual
PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE
ECC Routines
7.3.7 ECC F
p
Montgomery Modular Multiplication
(
(A
×
B
×
R
-2
) mod N
)
The (A
×
B
×
R
-2
) mod N calculation is similar to the standard ‘R
-1
’ Montgomery
multiplication except an additional R is divided out. This function is ideal for those ECC
applications which work in affine coordinates. In that case, the host may use this function
to exit projective coordinates. For example, the host could find x, for x = X/Z
2
, where X and
(Z
2
)
-1
are in the Montgomery residue system. Loading X and (Z
2
)
-1
into the appropriate
operand registers and initiating this function would yield x which is no longer in the
Montgomery residue system. This function operates with a minimum of 5 digits
(Modsize = 4). The complete set of I/O conditions is shown below:
Figure 7-10. Modular Multiplication (
with double reduction
) Register Usage
Table 7-11. Modular Multiplication (with double reduction)
Modular Multiply (with double reduction)
Computation
C = A * B * R
-2
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
modularmultiply2
Entry address
0x00b (modularmultiply2)
Pre-conditions
A0-3 = A (integer, exact A-location pre-selected in Control Register)
B0-3 = B (integer, exact B-location pre-selected in Control Register)
N0-3 = prime p (modulus) 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
—
N1
N2
N3
A0
A1
A2
A3
B0
B1
B2
B3
Initial Condition
Final Condition
?
?
?
N0
C (if B0 selected)
B (if B0 selected)
modulus N (if N0 selected)
modulus N (if N0 selected)
A (if A0 selected)
?
?
?
XYZ
F2M
EXP(k)
regAsel
regBsel
regNsel
‘0’ - F
p
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
.
..