Datasheet

Table Of Contents
43.3.4.12.5 Code Example
PUKCL_PARAM PUKCLParam;
PPUKCL_PARAM pvPUKCLParam = &PUKCLParam;
// Fill all the fields
PUKCL(u2Option) = 0;
PUKCL_GCD(nu1XBase) = <Base of the ram location of X>;
PUKCL_GCD(nu1YBase) = <Base of the ram location of Y>;
PUKCL_GCD(nu1ABase) = <Base of the ram location of A>;
PUKCL_GCD(nu1ZBase) = <Base of the ram location of Z>;
PUKCL_GCD(nu1WorkSpace) = <Base of the workspace>;
PUKCL_GCD(u2Length) = <Length of X, Y, A and Z>;
// vPUKCL_Process() is a macro command, which populates the service name
// and then calls the library...
vPUKCL_Process(GCD, pvPUKCLParam);
if (PUKCL_Param.Status == PUKCL_OK)
{
// The GCD has been executed correctly
...
}
else // Manage the error
43.3.4.12.6 Constraints
The following conditions must be avoided to ensure that the service works correctly:
nu1XBase, nu1YBase, nu1ABase or nu1ZBase are not aligned on 32-bit boundaries
{nu1XBase, u2Length}, {nu1YBase, u2Length}, {nu1ABase, u2Length} or {nu1ZBase, u2Length} are
not in Crypto RAM
u2Length is either: < 4, > 0xffc or not a 32-bit length
{nu1XBase, u2Length} overlaps {nu1YBase, u2Length} or {nu1XBase, u2Length} overlaps
{nu1ABase, u2Length} or {nu1XBase, u2Length} overlaps {nu1ZBase, u2Length} or {nu1YBase,
u2Length}overlaps
{nu1ABase, u2Length} or {nu1YBase, u2Length} overlaps {nu1ZBase, u2Length} or {nu1ABase,
u2Length} overlaps {nu1ZBase, u2Length}
43.3.4.12.7 Status Returned Values
Table 43-38. GCD Service Return Codes
Returned Status Importance Meaning
PUKCL_OK Service functioned correctly
43.3.4.13 Get Random Number
43.3.4.13.1 Purpose
The purpose of this command is to provide the user with a source of entropy. The options available for
this service are:
Generation of random numbers from a Hardware Random Number Generator (TRNG).
Generation of random numbers from a Deterministic Random Number Generator (DRNG).
SAM D5x/E5x Family Data Sheet
Public Key Cryptography Controller (PUKCC)
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1479