Datasheet

Table Of Contents
43.3.6.12 Verifying an ECDSA Signature (Compliant with FIPS186-2)
43.3.6.12.1 Purpose
This service is used to verify an ECDSA signature following the FIPS 186-2. It performs the second step
of the Signature Verification.
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.
As second significant input, the Signature is provided to be checked. This service checks the signature
and fills the status accordingly.
43.3.6.12.2 How to Use the Service
43.3.6.12.3 Description
The operation performed is:
Verify = EcDsaVerifySignature(Pt
A
, HashVal, Signature, CurveParameters, PublicKey)
The points used for this operation are represented in different coordinate systems. In this computation,
the following parameters need to be provided:
A the input point is filled with the affine values (X,Y) and Z = 1 (pointed by{nu1PointABase,
3*u2ModLength + 12})
Cns the working space for the Fast Modular Constant not initialized (pointed by
{nu1CnsBase,u2ScalarLength + 8})
P the modulus filled (pointed by {nu1ModBase,u2ModLength + 4})
The workspace not initialized (pointed by {nu1WorkSpace, 8*u2ModLength + 44}
The a parameter relative to the elliptic curve (pointed by {nu1ABase,u2ModLength + 4})
The order of the Point A on the elliptic curve (pointed by {nu1OrderPointBase,u2ScalarLength + 4})
HashVal the hash value is generated prior and filled (pointed by {nu1HashBase,u2ScalarLength + 4})
The Public Key point is filled in “mixed” coordinates (X,Y) with the affine values and Z = 1 (pointed by
{nu1PointPublicKeyGen, 3*u2ModLength + 12})
The input signature (R,S), even if it is not a Point, is represented in memory like a point in affine
coordinates (X,Y) (pointed by {nu1PointSignature, 2*u2ScalarLength + 8})
Note:  For the ECDSA signature verification be sure to follow the directives given for the RNG on the
chip you use (particularly initialization, seeding) and compulsorily start the RNG.
The operation consists in obtaining a V value with all these input parameters and checking that V
equals the provided R. If all is correct and the signature is the good one, the status is set to
PUKCL_OK. If all is correct and the signature is wrong, the status is set to
PUKCL_WRONG_SIGNATURE. If an error occurs, the status is set to the corresponding error value
(see Status Returned Values below).
43.3.6.12.4 Parameters Definition
Table 43-87. ZpEcDsaVerifyFast Service Parameters
Parameter Type Direction Location Data Length Before
Executing
the Service
After
Executing
the Service
nu1ModBase nu1 I Crypto
RAM
u2ModLength + 4 Base of
modulus P
Base of
modulus P
SAM D5x/E5x Family Data Sheet
Public Key Cryptography Controller (PUKCC)
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1535