Datasheet

Table Of Contents
Important:  This service works only with integers.
43.3.4.8.2 How to Use the Service
43.3.4.8.3 Description
This service accepts two numbers in classical arithmetic in input and performs a comparison, virtually
subtracting (X + CarryIn) from Y:
CompareGetFlags (Y - (X + CarryIn))
The numbers X and Y are untouched but the resulting flags CarryOut and the Zero Bit are filled. If the
lengths of Y and X are equal, a comparison is processed.
If the length of Y is strictly greater than the length of X, X is first virtually padded with zeros on the Most
Significant Bytes side, then a comparison is processed.
Note:  The length of Y must be greater or equal to the length of X.
In this computation, the following data need to be provided:
X (pointed by{nu1XBase,u2XLength})
Y (pointed by{nu1YBase,u2YLength})
The service name for this operation is Comp.
43.3.4.8.4 Parameters Definition
Table 43-23. Comp Service Parameters
Parameter Type Direction Location Data Length Before Executing
the Service
After Executing the
Service
Specific/Gf2n
CarryIn
Bits I GF(2n) Bit and
Carry In
Specific/
CarryOut Zero
Violation
Bits I Carry Out, Zero Bit
and Violation Bit
filled according to
the result
nu1XBase nu1 I Crypto RAM u2XLength Base of X Base of X
u2XLength u2 I Length of X Length of X
nu1YBase nu1 I Crypto RAM u2YLength Base of Y Base of Y
u2YLength u2 I Length of Y Length of Y
43.3.4.8.5 Code Example
PUKCL_PARAM PUKCLParam;
PPUKCL_PARAM pvPUKCLParam = &PUKCLParam;
// CarryIn shall be beforehand filled (with zero or one) PUKCL(Specific).CarryIn = ...;
// Initializing parameters
PUKCL_Comp(nu1XBase) = <Base of the ram location of X>;
PUKCL_Comp(u2XLength) = <Length of X>;
PUKCL_Comp(nu1YBase) = <Base of the ram location of Y>;
PUKCL_Comp(u2YLength) = <Length of Y>;
SAM D5x/E5x Family Data Sheet
Public Key Cryptography Controller (PUKCC)
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1463