MTB CAT1 Peripheral driver library
cy_stc_cryptolite_rsa_pub_key_t Struct Reference

Description

All fields for the context structure are internal.

Firmware never reads or writes these values. Firmware allocates the structure and provides the address of the structure to the driver in the function calls. Firmware must ensure that the defined instance of this structure remains in scope while the drive is in use.

The driver uses this structure to store and manipulate the RSA public key and additional coefficients to accelerate RSA calculation.

RSA key contained from two fields:

  • n - modulus part of the key
  • e - exponent part of the key.

Other fields are accelerating coefficients and can be calculated by Cy_Cryptolite_Rsa_Coef API.

Note
All the buffers must be 4 byte aligned in the cy_stc_cryptolite_rsa_pub_key_t and must also be in little-endian order.
Use Cy_Cryptolite_InvertEndianness function to convert to or from little-endian order.

Data Fields

uint8_t * moduloPtr
 The pointer to the modulus part of public key. More...
 
uint32_t moduloLength
 The modulus length, in bits, maximum supported size is 4096 Bits.
 
uint8_t * pubExpPtr
 The pointer to the exponent part of public key.
 
uint32_t pubExpLength
 The exponent length, in bits, maximum supported size is 256Bit.
 
uint8_t * barretCoefPtr
 The pointer to the Barrett coefficient. More...
 
uint8_t * inverseModuloPtr
 The pointer to the binary inverse of the modulo. More...
 
uint8_t * rBarPtr
 The pointer to the (2^moduloLength mod modulo). More...
 
bool preCalculatedCoeff
 when set to 'true', pre-calculated coefficients must be provided in 'barretCoefPtr, 'inverseModuloPtr' and 'rBarPtr', can be calculated by Cy_Cryptolite_Rsa_Coef API . More...
 

Field Documentation

◆ moduloPtr

uint8_t* cy_stc_cryptolite_rsa_pub_key_t::moduloPtr

The pointer to the modulus part of public key.

◆ barretCoefPtr

uint8_t* cy_stc_cryptolite_rsa_pub_key_t::barretCoefPtr

The pointer to the Barrett coefficient.

Memory for it should be allocated by user with size moduloLength + 1.

◆ inverseModuloPtr

uint8_t* cy_stc_cryptolite_rsa_pub_key_t::inverseModuloPtr

The pointer to the binary inverse of the modulo.

Memory for it should be allocated by user with size moduloLength.

◆ rBarPtr

uint8_t* cy_stc_cryptolite_rsa_pub_key_t::rBarPtr

The pointer to the (2^moduloLength mod modulo).

Memory for it should be allocated by user with size moduloLength

◆ preCalculatedCoeff

bool cy_stc_cryptolite_rsa_pub_key_t::preCalculatedCoeff

when set to 'true', pre-calculated coefficients must be provided in 'barretCoefPtr, 'inverseModuloPtr' and 'rBarPtr', can be calculated by Cy_Cryptolite_Rsa_Coef API .

When set to 'false', all the acceleration step coefficients will be calculated as part of Cy_Cryptolite_Rsa_Proc