Datasheet

Table Of Contents
Note:  When using this service be sure to follow the directives given for the RNG on the chip you use
(particularly initialization, seeding) and compulsorily start the RNG.
This service processes one of the following operations: CheckProbablePrimality(N)
or
N = GenerateProbablePrimeFromSeed (NSeed)
In this computation, the following parameters need to be provided:
N the input number (pointed by {nu1NBase,u2NLength +4})
If the requested operation is a test, it is untouched after the operation.
If the requested operation is a generation and a probable prime number was found before
reaching the Maximum Increment, it contains the resulting probable prime after the operation.
If the requested operation was a generation and Maximum Increment was reached before a
probable prime number was found, it contains no relevant information.
Cns as a workspace (pointed by {nu1CnsBase,u2NLength +12})
Rnd as a workspace (pointed by {nu1RndBase,u2NLength +16})
Precomp the precomputation workspace (pointed by{nu1PrecompBase,PrecompLen})
Exp as a workspace (pointed by {pfu1ExpBase,u2ExpLength +4})
u1MillerRabinIterations the number of Miller Rabin Iterations requested
u2MaxIncrement, maximum increment of the number in case of probable prime generation
The length PrecompLen depends on the lengths and options chosen; its calculus is detailed in Options
below.
The service name for this operation is PrimeGen.
43.3.5.3.5 Parameters Definition
Table 43-56. PrimeGen Service Parameters
Parameter
Typ
e
Direction Location Data Length Before Executing the
Service
After Executing the
Service
nu1NBase (see Note 1) nu1 I Crypto
RAM
u2NLength + 4 Base of N
Number to test or Seed
for the generation
Base of N unchanged if
test or generation result
( see Note 1)
nu1CnsBase nu1 I Crypto
RAM
u2NLength + 12 Base of Cns as a
workspace
Base of Cns workspace
corrupted
u2NLength u2 I Length of N Length of N
nu1RndBase nu1 I Crypto
RAM
Max (u2NLength
+ 16,64)
Internal Workspace Internal Workspace
corrupted
nu1PrecompBase nu1 I Crypto
RAM
See Options
below
Base of Precomp
workspace
Base of Precomp
workspace corrupted
nu1RBase (see Note 2) nu1 Crypto
RAM
nu1ExpBase (see Note
3)
nu1 I Crypto
RAM
u2NLength + 4 Base of Exponent (R) Base of Exponent (R)
u1MillerRabin-Iterations u1 I Miller Rabin’s T
parameter
Miller Rabin’s T
parameter
SAM D5x/E5x Family Data Sheet
Public Key Cryptography Controller (PUKCC)
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1497