Datasheet

Table Of Contents
Operation is a Modular Reduction.
Operation is a Normalization.
43.3.5.1.2 How to Use the Service
43.3.5.1.3 Description
This service performs one of the following operations:
Setup of the Fast or Normalize functions: generation of the reduction constant
Fast Modular Reduction
Big Modular Reduction (using Euclide’s division)
Normalization
The service name for this operation is RedMod.
43.3.5.1.4 Modular Reduction Setup
This service calculates the constant Cns, computed from the modulus and used to speed up the modular
reduction:
Cns = SetupConstant(N)
This service must be processed before the use of the Fast or Normalize functions. In the Setup
computations, the following data must be provided:
N the modulus (pointed by {nu1ModBase,u2ModLength +4}).
Cns the Setup Constant Result (pointed by {nu1CnsBase,u2ModLength +12}).
X used as a workspace (pointed by {nu1XBase,2 * u2ModLength + 8}) (include the supplementary
bytes; see Note 2 in Table 43-44
R used as a workspace (pointed by {nu1RBase,64 or 68bytes}).
u2ModLength is the Aligned Significant Length of the modulus and is not the byte Significant Length
(see 43.3.3.4 Aligned Significant Length).
43.3.5.1.5 Fast Reductions and Normalization
These commands calculate an approximated or exact Modular Reduction, that is, the result may be
greater than the modulus, but is always congruent to the true result.
Important:  Before using these functions, ensure that the constant Cns has been calculated
with the setup for the Modular Reduction service.
Input and Result significant values verify:
For the Fast Modular Reduction:
0 <
2
× 2
32
=  + ×  0 4
For the Normalize:
 <  + 4 
= 
In these Fast Modular Reduction and Normalize computations, the following data have to be provided:
X (pointed by {nu1XBase,2 * u2ModLength +8})
SAM D5x/E5x Family Data Sheet
Public Key Cryptography Controller (PUKCC)
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1485