Datasheet

Table Of Contents
43.3.7.8.5 Code Example
PUKCL_PARAM PUKCLParam;
PPUKCL_PARAM pvPUKCLParam = &PUKCLParam;
// ! The Random Number Generator must be initialized and started
// ! following the directives given for the RNG on the chip
PUKCL (u2Option) = 0;
// Depending on the option specified, not all fields should be filled
PUKCL _GF2NEcPointIsOnCurve(nu1ModBase) = <Base of the ram location of P>;
PUKCL _GF2NEcPointIsOnCurve(u2ModLength) = <Byte length of P>;
PUKCL _GF2NEcPointIsOnCurve(nu1CnsBase) = <Base of the ram location of Cns>;
PUKCL _GF2NEcPointIsOnCurve(nu1PointABase) = <Base of the A point>;
PUKCL _GF2NEcPointIsOnCurve(nu1AParam) = <Base of the ram location of the parameter a>;
PUKCL _GF2NEcPointIsOnCurve(nu1BParam) = <Base of the ram location of the parameter b>;
PUKCL _GF2NEcPointIsOnCurve(nu1PointBase) = <Base of the ram location of the point>;
PUKCL _GF2NEcPointIsOnCurve(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...
vPUKC L_Process(GF2NEcPointIsOnCurve,
pvPUKCLParam);
if (PUKCL (u2Status) == PUKCL_OK)
{
...
}
else // Manage the error
43.3.7.8.6 Constraints
No overlapping between either input and output are allowed. The following conditions must be avoided to
ensure that the service works correctly:
nu1ModBase, nu1CnsBase, nu1PointABase, nu1AParam, nu1BParam and nu1Workspace are not
aligned on 32-bit boundaries
{nu1ModBase, u2ModLength + 4}, {nu1CnsBase, u2ModLength + 8}, {nu1PointABase,
3*u2ModLength + 12}, {nu1AParam, u2ModLength + 4}, {nu1BParam, u2ModLength + 4},
{nu1Workspace, 4*u2ModLength + 28} 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}, {nu1AParam, u2ModLength + 4}, {nu1BParam,
u2ModLength + 4} and {nu1Workspace, 4*u2ModLength + 28}
43.3.7.8.7 Status Returned Values
Table 43-107. GF2NEcPointIsOnCurve Service Return Codes
Returned Status Importance Meaning
PUKCL_OK The point is on the curve.
PUKCL_POINT_IS_NOT_ON_CURVE Warning The point is not on the curve.
PUKCL_POINT_AT_INFINITY Warning The input point has its Z equal to zero, so it’s a
representation of the infinite point.
43.3.7.9 Generating an ECDSA Signature (Compliant with FIPS 186-2)
43.3.7.9.1 Purpose
This service is used to generate an ECDSA signature following the FIPS 186-2. It performs the second
step of the Signature Generation. A hash value (HashVal) must be provided as input, it has to be
previously computed from the message to be signed using a secure hash algorithm.
SAM D5x/E5x Family Data Sheet
Public Key Cryptography Controller (PUKCC)
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1559