Chapter 7. Public Key Execution Unit
7-33
PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE
Miscellaneous Routines
Figure 7-23. R
2
mod N Register Usage
7.5.3 R
p
R
N
mod P Calculation
The PKEU has the ability to calculate R
p
R
N
mod P, where R
p
= 2
16D
, and R
N
= 2
16E
; D is
the number of digits of the modulus P, and E is the number of digits of the modulus N, and
D + 4 < E. This constant is used in performing Chinese Remainder Theorem calculations
given modulus N = P
×
Q, where P and Q are prime numbers. Although labelled R
P
R
N
mod
P, this function can also compute R
Q
R
N
mod Q. The requirement D + 4 < E is not a
requirement of the command, but a system requirement, as for all subfunctions of Chinese
Remainder Theorem to be executable on the PKEU, the number of digits of P and Q must
each be at least five.
As with the standard R
2
mod N operation, this operation exists primarily to support RSA
and only works with the Control Register F
2
M bit set to zero.
To use this function, MOD_SIZE must be programmed with D-1, and EXP_SIZE must be
programmed with E-1, and the prime modulus (either P or Q) is written into memory N.
The complete set of I/O conditions is shown in Table 7-26.
N1
N2
N3
A0
A1
A2
A3
B0
B1
B2
B3
Initial Condition
Final Condition
N0
modulus N(
⇑
)
modulus N(
⇑
)
R
2
mod N(
⇑
)
XYZ
F2M
EXP(k)
regAsel
regBsel
regNsel
‘0’ - integer-modulo-n enabled
same
set (00)
Modsize
EXP(k)_SIZE
set
same
ECC
same
‘0’ - ECC disabled
set (00)
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
.
..