Modular Subtract Register Usage - Motorola DigitalDNA MPC180E User Manual

Security processor
Table of Contents

Advertisement

RSA Routines
7.4.5 RSA F
Modular Subtract
p
Modular addition may be performed on any two vectors loaded into A (A0-A3) and B
(B0-B3), where both of these vectors are less than the value stored in the modulus register
N (N0-N3). This is accomplished by computing A-B if A > B or A-B+N if A < B. The
results are stored in the respective B register. This function is particularly helpful when
using the Chinese Remainder Theorem. This function operates with a minimum of 4 digits
(Modsize = 3).
Prior to initiating this function, the A and B register pointers must be set in the control
register which indicate which sub-registers (e.g A0, B0, A1, B1, etc.) are the targeted
operands. See Table 7-2 for a detailed description. Once this is performed, the host
processor may successfully initiate this function.
Computation
C = D - E mod N, where D, E, and C are integers and are less than N
Entry name
modularsubtract
Entry address
0x009(modularsubtract)
Pre-conditions
A0-3 = D
B0-3 = E
N0-3 = modulus
Post-conditions
B0-3 = results of modular subtraction stored where the B operand was located
Unless explicitly noted, all other registers are not guaranteed to be any particular value.
Special
The function operates the same regardless of whether or not the operands are in the Montgomery
conditions
residue system.
Initial Condition
'0' - integer-modulo-n enabled
Figure 7-21. Modular Subtract Register Usage
7-30
PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE
Table 7-22. Modular Subtract
Modular Subtract
B3
B2
B1
B0
E(⇑)
A3
A2
A1
D(⇑)
A0
N3
N2
N1
N0
modulus N(⇑)
'0' - ECC disabled
ECC
EXP(k)
XYZ
F2M
regAsel
set (00)
regBsel
set (00)
regNsel
set (00)
Modsize
set
EXP(k)_SIZE
MPC180E Security Processor User's Manual
Final Condition
C(⇑)
modulus N(⇑)
same
same
same
same
same
same

Advertisement

Table of Contents
loading

Table of Contents