Datasheet

Table Of Contents
For this command three exclusive options can be specified. The following table lists the operations that
can be performed.
Table 43-47. RedMod Service Options
Option Purpose Required Parameters
PUKCL_REDMOD_SETUP Perform the Cns value computation nu1ModBase, u2ModLength,
nu1CnsBase, nu1XBase
PUKCL_REDMOD_REDUCTION Perform R ≡ X Mod N, see sub-
option for details
nu1ModBase, u2ModLength,
nu1CndBase, nu1XBase,
nu1RBase
PUKCL_REDMOD_NORMALIZE Perform R = X Mod N nu1ModBase, u2ModLength,
nu1CndBase, nu1XBase,
nu1RBase
When selecting the PUKCL_REDMOD_REDUCTION option, one of the two sub-options listed in the
following table must be selected.
Table 43-48. RedMode Service Options with PUKCL_RED_MOD_REDUCTION
Option Purpose Required Parameters
PUKCL_REDMOD
_USING_DIVISION
Perform R = X Mod N nu1ModBase, u2ModLength,
nu1CndBase, nu1XBase
PUKCL_REDMOD
_USING_FASTRED
Perform R ≡ X Mod N
The entropy is minimized (~2 bits)
nu1ModBase, u2ModLength,
nu1CndBase, nu1XBase,
nu1RBase
43.3.5.1.11 Code Example
PUKCL_PARAM PUKCLParam;
PPUKCL_PARAM pvPUKCLParam = &PUKCLParam;
PUKCL(Specific).CarryIn = 0;
PUKCL(Specific).GF2n = ...;
PUKCL(u2Option) =...;
// Depending on the option specified, not all fields should be filled
PUKCL_RedMod(nu1ModBase) = <Base of the ram location of N>;
PUKCL_RedMod(u2ModLength) = <Length of N>;
PUKCL_RedMod(nu1CnsBase) = <Base of the ram location of Cns>;
...
// vPUKCL_Process() is a macro command, which populates the service name
// and then calls the library...
vPUKCL_Process(RedMod,pvPUKCLParam);
if (PUKCL_Param.Status == PUKCL_OK)
{
// operation has correctly been performed
...
}
else // Manage the error
43.3.5.1.12 Constraints
Depending on the options chosen the lengths of the R area and Cns area differ:
For the Setup:
RLength = 64bytes
SAM D5x/E5x Family Data Sheet
Public Key Cryptography Controller (PUKCC)
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1490