Datasheet

Table Of Contents
In GF(2
n
): The modulus is P[X] with length NLength in bytes
For the exact calculus of NLength see below.
Table 43-43. Modular Reduction Modes
Modular
Reduction
Form
Input Dynamic Result Dynamic Comments
Fast GF(p): 0 ≤ Input < (N
2
) *
(2
32
)
GF(2n): Input < ((P[x])
2
) *
(X
32
)
GF(p): 0 ≤ Res < N * 4
GF(2
n
): Res < P[X] * (X
2
)
The fastest reduction available,
needs a precomputed constant.
Normalized InputLength < NLength
+ 4 bytes
GF(p): 0 ≤ Res < N
GF(2
n
): Res < P[X]
The correction step does not
runs in constant time. Needs a
precomputed constant.
The Normalize function cannot
be applied to the product of two
numbers of length u2NLength.
Using
Euclidean
division
InputLength < 2 *
NLength + 4 bytes
GF(p): 0 ≤ Res < N
GF(2
n
): Res < P[X]
Does not need any
precomputed constant.
To be able to use these modular reduction services (except the Euclidean division), first the implementer
shall call the setup service, providing the modulus as well as one free memory space for the constant
(this constant is used to speed up the modular reduction). In most commands (except the modular
exponentiation), the quotient is stored in the high order bytes of the number to be reduced, using only
eight bytes more than the maximum size of the number to be reduced.
The following rules must be respected to ensure the modular reduction services function correctly:
The numbers to be reduced can have any significant length, given the fact it CANNOT BE GREATER
than 2*u2ModLength + 4 bytes.
The modulus SHALL ALWAYS HAVE a significant length of <u2ModLength> bytes. The modulus
must be provided as a <u2ModLength + 4> bytes long number, padded on the most significant side
with a 32-bit word cleared to zero. Not respecting this rule leads to unexpected and wrong results
from the modular reduction.
The normalization operation ALWAYS performs a modular reduction step, and will therefore have the
same memory usage as this one.
The very first operation before any modular operation SHALL BE a modular setup.
43.3.5.1 Modular Reduction
43.3.5.1.1 Purpose
This service is used to perform the various steps necessary to perform a modular reduction and accepts
as input numbers in GF(p) or polynomials in GF(2
n
) .
The available options for this service are:
Work in the GF(2
n
) or in the standard integer arithmetic field GF(p)
Operation is the generation of the reduction constant.
SAM D5x/E5x Family Data Sheet
Public Key Cryptography Controller (PUKCC)
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1484