Datasheet

Table Of Contents
}
else // Manage the error
43.3.4.2.6 Status Returned Values
Table 43-8. ClearFlags Service Return Codes
Returned Status Importance Meaning
PUKCL_OK Service functioned correctly.
43.3.4.3 Swap
43.3.4.3.1 Purpose
This service performs swapping of two buffers.
43.3.4.3.2 How to Use the Service
43.3.4.3.3 Description
This service swaps two buffers, X and Y, of the same size in memory.
The service name for this operation is Swap.
43.3.4.3.4 Parameters Definition
This service can easily be accessed through the use of the PUKCL_Swap() macro.
Table 43-9. Swap Service Parameters
Parameter Type Direction Location Data
Length
Before Executing
the Service
After Executing the
Service
nu1XBase nu1 I Crypto RAM u2Length Base of the number
X
Base of X filled with Y
nu1YBase nu1 I Crypto RAM u2Length Base of the number
Y
Base of Y filled with X
u2XLength u2 I Length of X and Y Length of X and Y
43.3.4.3.5 Code Example
_PARAM PUKCLParam;
PPUKCL_PARAM pvPUKCLParam = &PUKCLParam;
// Initialize parameters
PUKCL_Swap(nu1XBase) = <Base of the X number>;
PUKCL_Swap(nu1YBase) = <Base of the Y number>;
PUKCL_Swap(u2XLength) = <Length of the numbers>;
// vPUKCL_Process() is a macro command, which populates the service name
// and then calls the library...
vPUKCL_Process(Swap,pvPUKCLParam);
if (PUKCL(u2Status) == PUKCL_OK)
{
...
}
else // Manage the error
43.3.4.3.6 Constraints
The following conditions must be avoided to ensure that the service works correctly:
nu1XBase or nu1YBase are not aligned on 32-bit boundaries
u2XLength is either <4, > 0xffc, or not a 32-bit length
{nu1XBase, u2XLength} or {nu1YBase, u2XLength} do not entirely lie in PUKCCRAM
SAM D5x/E5x Family Data Sheet
Public Key Cryptography Controller (PUKCC)
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1452