Datasheet

Table Of Contents
...........continued
Parameter Type Direction Location Data Length Before
Executing the
Service
After
Executing the
Service
nu1ABBase nu1 I Crypto
RAM
u2ModLength + 4 Parameter a of
the elliptic curve
Unchanged
nu1Workspace nu1 I Crypto
RAM
7*u2ModLength
+ 40
Corrupted
workspace
43.3.7.2.5 Code Example
PUKCL_PARAM PUKCLParam;
PPUKCL_PARAM pvPUKCLParam = &PUKCLParam;
//Depending on the function the Random Number Generator
//must be initialized and started
//following the directives given for the RNG on the chip
PUKCL(u2Option) = 0;
PUKCL_GF2NEccAdd(nu1ModBase) = <Base of the ram location of P>;
PUKCL_GF2NEccAdd(nu1CnsBase) = <Base of the ram location of Cns>;
PUKCL_GF2NEccAdd(u2ModLength) = <Byte length of P>;
PUKCL_GF2NEccAdd(nu1PointABase) = <Base of the ram location of the A point>;
PUKCL_GF2NEccAdd(nu1PointBBase) = <Base of the ram location of the B point>;
PUKCL_GF2NEccAdd(nu1ABBase) = <Base of the ram location of the a Parameter>;
PUKCL_GF2NEccAdd(nu1Workspace) = <Base of the ram location of the workspace>;
. . .
// vPUKCL_Process() is a macro command, which populates the service name
// and then calls the library...
vPUKCL_Process(GF2NEccAddFast, pvPUKCLParam);
if (PUKCL(u2Status) == PUKCL_OK)
{
...
}
else // Manage the error
43.3.7.2.6 Constraints
No overlapping between either input and output are allowed The following conditions must be avoided to
ensure the service works correctly:
nu1ModBase,nu1CnsBase, nu1PointABase, nu1PointBBase, nu1ABBase, nu1Workspace are not
aligned on 32-bit boundaries
{nu1ModBase, u2ModLength + 4}, {nu1CnsBase, u2ModLength + 8}, {nu1PointABase,
3*u2ModLength+ 12}, {nu1PointBBase, 3*u2ModLength + 12}, {nu1ABase,u2ModLength + 4},
{nu1Workspace, <WorkspaceLength>} are not in Crypto RAM
u2ModLength is either: < 12, > 0xffc or not a 32-bit length
All overlapping between {nu1ModBase, u2ModLength + 4}, {nu1CnsBase, u2ModLength +8},
{nu1PointABase, 3*u2ModLength + 12}, {nu1PointBBase, 3*u2ModLength + 12},
{nu1ABase,u2ModLength + 4} and {nu1Workspace, 5*u2ModLength + 32}
43.3.7.2.7 Status Returned Values
Table 43-95. GF2NEccAddFast Service Return Codes
Returned Status Importance Meaning
PUKCL_OK The computation passed without errors.
43.3.7.3 Point Doubling
43.3.7.3.1 Purpose
This service is used to perform a Point Doubling, based on a given elliptic curve over GF(2
n
).
SAM D5x/E5x Family Data Sheet
Public Key Cryptography Controller (PUKCC)
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1548