Datasheet

Table Of Contents
The service name for this operation is Square.
In these computations, the following data has to be provided:
R the result (pointed by {nu1RBase,2 *u2Xlength})
X one input number or GF(2n) polynomial (pointed by{nu1XBase,u2XLength})
Z one optional input number or GF(2n) polynomial (pointed by {nu1ZBase,2 *u2Xlength})
CarryOperand (provided through the CarryOptions and Carry values)
Important:  Even if neither accumulation nor subtraction is specified, the nu1ZBase must
always be filled and point to a Crypto RAM space. It this case, nu1ZBase can point to the same
space as the nu1RBase.
If using the big modular reduction option, the Multiply operation is followed by a reduction (see 43.3.5.1
Modular Reduction). In this case, the length of Cns is 64 bytes.
If using the modular reduction option the Square operation is followed by a reduction (see 43.3.5.1
Modular Reduction). In this case the following parameters must be additionally provided:
N—the modulus (pointed by {nu1ModBase,u2Modlength +4}).
Cns—the reduction constant (pointed by {nu1CnsBase,u2Modlength +8})
In case of big reduction option, the length of Cns is 64bytes.
Note: 
The result buffer R must first be padded with zero bytes until its length is sufficient to perform the
reduction (2*u2ModLength + 8) to be used by the Modular Reduction service as an input parameter.
The result of the reduction is written in the area X pointed by {nu1XBase, u2ModLength + 4}.
For example, if u2ModLength, u2XLength is 0x80 bytes, the length of the R space is 2*(u2ModLength
+ 4) = 0x108 bytes because of the constraints of modular reduction.
In case of Fast or Normalized Reduction, the length of the result is u2ModLength + 4 so 0x84 bytes.
Thus, the zoneX has a length of 0x84 bytes (at least). The square of X provides a result of length 0x100
bytes in the zone R so the 8 MSB bytes previously must be previously padded with zero bytes (in offsets
0x100 to 0x107).
43.3.4.10.4 Parameters Definition
Table 43-30. Square Service Parameters
Parameter Type Direction Location Data Length Before
Executing the
Service
After Executing
the Service
u2Options u2 I Options (see
below)
Options (see
below)
Specific/Gf2n
CarryIn
Bits I GF(2n) Bit and
Carry In
SAM D5x/E5x Family Data Sheet
Public Key Cryptography Controller (PUKCC)
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1470