Chapter 7. Public Key Execution Unit
7-35
PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE
Embedded Routine Performance
7.6 Embedded Routine Performance
The formulas listed in Table 7-26 show the run times for the PKHA embedded routines.
Many of these are data dependent, which result in variable length run times. For these cases,
the average run-time is noted.
NOTE:
When t
mult1
without references to wcs or bcs is encountered,
assume that for 75% of the time, bcs will occur and for the
other 25%, wcs (i.e. t
mult1
↔
0.75*t
mult1
(bcs) +
0.25*t
mult1
(wcs)).
The formulas given for t
mulfp
and t
mulf2m
are for XYZ bit of the
Control Register set to one. If set to zero, the run-time would
be nearly identical but additional support from the host
processor would be required to fully complete the operation.
See the point multiply descriptions in Embedded Routine
Reference section for more details.
Table 7-26. Run Time Formulas
Operation
Symbol
Run-Time Formula
1
1
For these formulas, the following definitions apply:
F = operating frequency
MS = number of 16-bit blocks in the modulus (that is, the value assigned to the Modsize reg. plus one)
Ne = number of bits in the exponent or multiplier (k)
avg = average run time (applied to a nominal case which assumes 50% 1’s = in Ne
wcs = worst-case run time
bcs = best-case run time
multPtoQ
t
mulfp
(avg)
Ne* t
dblfp
+ 0.5*Ne* t
addfp
+ 8*(t
mult1
) + 6*(MS)
move
FpaddPtoQ
t
addfp
16*(t
mult1
) + 4*(t
add
) + 5*(t
sub
) + 19*(MS)
move
FpdoubleQ
t
dblfp
10*(t
mult1
) + 11*(t
add
)+2*(t
sub
) + 10*(MS)
move
multPtoQ
t
mulf2m
(avg)
Ne* t
dblf2m
+ 0.5*Ne* t
addf2m
+ 8*(t
mult1
) + 6*(MS)
move
F2maddPtoQ
t
addf2m
20*(t
mult1
) + 7*(t
add
) + 15*(MS)
move
F2mdoubleQ
t
dblf2m
10*(t
mult1
) + 4*(t
add
) + 9*(MS)
move
expA
t
exp
(avg)
1.5*Ne*[t
mult1
] + t
mult1
(wcs)
modularmultiply
t
mult1
(wcs)
t
mult1
(bcs)
(1/F) * [(MS)
2
+ 10*(MS)+ 27]
(1/F) * [(MS)
2
+ 9*(MS)+ 22]
modularmultiply2
t
mult2
(wcs)
t
mult2
(bcs)
(1/F) *2* [(MS)
2
+ 10*(MS)+ 27]
(1/F) *2* [(MS)
2
+ 9*(MS)+ 22]
modularadd
t
add
(wcs)
t
add
(bcs)
(1/F) * [4*(MS)+ 11]
(1/F) * [3*(MS)+ 6]
modularsub
t
sub
(wcs)
t
sub
(bcs)
(1/F) * [3*(MS)+ 11]
(1/F) * [2*(MS)+ 6]
r2
t
r2
<tbd>
clearmemory
t
clr_ram
(1/F) * 4 * (MS+ 5)
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
.
..