CAT2 Peripheral Driver Library

Functions

ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_WaitForComplete (CRYPTOLITE_Type *base)
 This function waits for the Vector Unit operation complete. More...
 
ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_XMul_Hw (CRYPTOLITE_Type *base, uint8_t *val1Ptr, uint32_t val1Size, uint8_t *val2Ptr, uint32_t val2Size, uint8_t *result, uint32_t resultSize)
 This function performs long integer multiplication operation. More...
 
ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Mul_Hw (CRYPTOLITE_Type *base, uint8_t *val1Ptr, uint32_t val1Size, uint8_t *val2Ptr, uint32_t val2Size, uint8_t *result, uint32_t resultSize)
 This function performs multiplication operation. More...
 
ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Add_Hw (CRYPTOLITE_Type *base, uint8_t *val1Ptr, uint32_t val1Size, uint8_t *val2Ptr, uint32_t val2Size, uint8_t *result, uint32_t resultSize)
 This function performs addition operation. More...
 
ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Sub_Hw (CRYPTOLITE_Type *base, uint8_t *val1Ptr, uint32_t val1Size, uint8_t *val2Ptr, uint32_t val2Size, uint8_t *result, uint32_t resultSize)
 This function performs subtraction operation. More...
 
ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Cond_Sub_Hw (CRYPTOLITE_Type *base, uint8_t *val1Ptr, uint32_t val1Size, uint8_t *val2Ptr, uint32_t val2Size, uint8_t *result, uint32_t resultSize)
 This function performs conditional subtraction operation. More...
 
ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Xor_Hw (CRYPTOLITE_Type *base, uint8_t *val1Ptr, uint32_t val1Size, uint8_t *val2Ptr, uint32_t val2Size, uint8_t *result, uint32_t resultSize)
 This function performs XOR operation. More...
 
ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Mov_Hw (CRYPTOLITE_Type *base, uint8_t *srcPtr, uint32_t srcSize, uint8_t *dstPtr, uint32_t dstSize)
 This function performs copy/move operation. More...
 
ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Lsl1_Hw (CRYPTOLITE_Type *base, uint8_t *dataPtr, uint32_t dataSize, uint8_t *dstPtr, uint32_t dstSize)
 This function performs one bit left shift operation. More...
 
ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Lsr1_Hw (CRYPTOLITE_Type *base, uint8_t *dataPtr, uint32_t dataSize, uint8_t *dstPtr, uint32_t dstSize)
 This function performs one bit right shift operation. More...
 
ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Lsr_Hw (CRYPTOLITE_Type *base, uint8_t *dataPtr, uint32_t dataSize, uint32_t bitShift, uint8_t *dstPtr, uint32_t dstSize)
 This function performs left shift by specific given number. More...
 

Detailed Description

Function Documentation

◆ Cy_Cryptolite_Vu_WaitForComplete()

ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_WaitForComplete ( CRYPTOLITE_Type *  base)

This function waits for the Vector Unit operation complete.

Parameters
baseThe pointer to the Cryptolite instance.
Returns
None

◆ Cy_Cryptolite_Vu_XMul_Hw()

ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_XMul_Hw ( CRYPTOLITE_Type *  base,
uint8_t *  val1Ptr,
uint32_t  val1Size,
uint8_t *  val2Ptr,
uint32_t  val2Size,
uint8_t *  result,
uint32_t  resultSize 
)

This function performs long integer multiplication operation.

This operation is a carry-less long integer multiplication operation.

Parameters
baseThe pointer to the Cryptolite instance.
val1PtrThe pointer to the 1st operand.
val1SizeLength of the first operand in word size.
val2PtrThe pointer to the 2nd operand.
val2SizeLength of the second operand in word size.
resultThe pointer to the output result
resultSizeLength of the output result in word size.
Returns
None
Function Usage
uint8_t operand1[VU_BITS_TO_BYTES(64)] = {0xa0, 0xca, 0xb0, 0x1e, 0xe2, 0xc0, 0x4a, 0xf8};
uint8_t operand2[VU_BITS_TO_BYTES(64)] = {0x96, 0x4e, 0x77, 0x7f, 0x69, 0x7f, 0xcf, 0x18};
uint8_t result[VU_BITS_TO_BYTES(64)];
/* Wait for cryptolite operation to complete */
/* Compute long integer multiplication using VU HW block */
CRYPTOLITE, /* Base address of the Crypto block registers */
operand1, /* First operand pointer */
VU_BITS_TO_WORDS(64), /* First operand size in word */
operand2, /* Second operand pointer */
VU_BITS_TO_WORDS(64), /* Second operand size in word */
result, /* Pointer of result buffer*/
VU_BITS_TO_WORDS(64)); /* Result size in word*/
/* ... check for operation completion and data... */

◆ Cy_Cryptolite_Vu_Mul_Hw()

ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Mul_Hw ( CRYPTOLITE_Type *  base,
uint8_t *  val1Ptr,
uint32_t  val1Size,
uint8_t *  val2Ptr,
uint32_t  val2Size,
uint8_t *  result,
uint32_t  resultSize 
)

This function performs multiplication operation.

Parameters
baseThe pointer to the Cryptolite instance.
val1PtrThe pointer to the 1st operand.
val1SizeLength of the first operand in word size.
val2PtrThe pointer to the 2nd operand.
val2SizeLength of the second operand in word size.
resultThe pointer to the output result
resultSizeLength of the output result in word size.
Returns
None
Function Usage
uint8_t operand1[VU_BITS_TO_BYTES(64)] = {0xa0, 0xca, 0xb0, 0x1e, 0xe2, 0xc0, 0x4a, 0xf8};
uint8_t operand2[VU_BITS_TO_BYTES(64)] = {0x96, 0x4e, 0x77, 0x7f, 0x69, 0x7f, 0xcf, 0x18};
uint8_t result[VU_BITS_TO_BYTES(64)];
/* Wait for cryptolite operation to complete */
/* Compute integer multiplication using VU HW block */
CRYPTOLITE, /* Base address of the Crypto block registers */
operand1, /* First operand pointer */
VU_BITS_TO_WORDS(64), /* First operand size in word */
operand2, /* Second operand pointer */
VU_BITS_TO_WORDS(64), /* Second operand size in word */
result, /* Pointer of result buffer*/
VU_BITS_TO_WORDS(64)); /* Result size in word*/
/* ... check for operation completion and data... */

◆ Cy_Cryptolite_Vu_Add_Hw()

ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Add_Hw ( CRYPTOLITE_Type *  base,
uint8_t *  val1Ptr,
uint32_t  val1Size,
uint8_t *  val2Ptr,
uint32_t  val2Size,
uint8_t *  result,
uint32_t  resultSize 
)

This function performs addition operation.

Parameters
baseThe pointer to the Cryptolite instance.
val1PtrThe pointer to the 1st operand.
val1SizeLength of the first operand in word size.
val2PtrThe pointer to the 2nd operand.
val2SizeLength of the second operand in word size.
resultThe pointer to the output result
resultSizeLength of the output result in word size.
Returns
None
Function Usage
uint8_t operand1[VU_BITS_TO_BYTES(64)] = {0xa0, 0xca, 0xb0, 0x1e, 0xe2, 0xc0, 0x4a, 0xf8};
uint8_t operand2[VU_BITS_TO_BYTES(64)] = {0x96, 0x4e, 0x77, 0x7f, 0x69, 0x7f, 0xcf, 0x18};
uint8_t result[VU_BITS_TO_BYTES(64)];
/* Wait for cryptolite operation to complete */
/* Compute addition using VU HW block */
CRYPTOLITE, /* Base address of the Crypto block registers */
operand1, /* First operand pointer */
VU_BITS_TO_WORDS(64), /* First operand size in word */
operand2, /* Second operand pointer */
VU_BITS_TO_WORDS(64), /* Second operand size in word */
result, /* Pointer of result buffer*/
VU_BITS_TO_WORDS(64)); /* Result size in word*/
/* ... check for operation completion and data... */

◆ Cy_Cryptolite_Vu_Sub_Hw()

ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Sub_Hw ( CRYPTOLITE_Type *  base,
uint8_t *  val1Ptr,
uint32_t  val1Size,
uint8_t *  val2Ptr,
uint32_t  val2Size,
uint8_t *  result,
uint32_t  resultSize 
)

This function performs subtraction operation.

Parameters
baseThe pointer to the Cryptolite instance.
val1PtrThe pointer to the 1st operand.
val1SizeLength of the first operand.
val2PtrThe pointer to the 2nd operand.
val2SizeLength of the second operand in word size.
resultThe pointer to the output result
resultSizeLength of the output result in word size.
Returns
None
Function Usage
uint8_t operand1[VU_BITS_TO_BYTES(64)] = {0xa0, 0xca, 0xb0, 0x1e, 0xe2, 0xc0, 0x4a, 0xf8};
uint8_t operand2[VU_BITS_TO_BYTES(64)] = {0x96, 0x4e, 0x77, 0x7f, 0x69, 0x7f, 0xcf, 0x18};
uint8_t result[VU_BITS_TO_BYTES(64)];
/* Wait for cryptolite operation to complete */
/* Compute subtraction using VU HW block */
CRYPTOLITE, /* Base address of the Crypto block registers */
operand1, /* First operand pointer */
VU_BITS_TO_WORDS(64), /* First operand size in word */
operand2, /* Second operand pointer */
VU_BITS_TO_WORDS(64), /* Second operand size in word */
result, /* Pointer of result buffer*/
VU_BITS_TO_WORDS(64)); /* Result size in word*/
/* ... check for operation completion and data... */

◆ Cy_Cryptolite_Vu_Cond_Sub_Hw()

ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Cond_Sub_Hw ( CRYPTOLITE_Type *  base,
uint8_t *  val1Ptr,
uint32_t  val1Size,
uint8_t *  val2Ptr,
uint32_t  val2Size,
uint8_t *  result,
uint32_t  resultSize 
)

This function performs conditional subtraction operation.

Parameters
baseThe pointer to the Cryptolite instance.
val1PtrThe pointer to the 1st operand.
val1SizeLength of the first operand in word size.
val2PtrThe pointer to the 2nd operand.
val2SizeLength of the second operand in word size.
resultThe pointer to the output result
resultSizeLength of the output result in word size.
Returns
None
Function Usage
uint8_t operand1[VU_BITS_TO_BYTES(64)] = {0xa0, 0xca, 0xb0, 0x1e, 0xe2, 0xc0, 0x4a, 0xf8};
uint8_t operand2[VU_BITS_TO_BYTES(64)] = {0x96, 0x4e, 0x77, 0x7f, 0x69, 0x7f, 0xcf, 0x18};
uint8_t result[VU_BITS_TO_BYTES(64)];
/* Wait for cryptolite operation to complete */
/* Compute conditional subtraction using VU HW block */
CRYPTOLITE, /* Base address of the Crypto block registers */
operand1, /* First operand pointer */
VU_BITS_TO_WORDS(64), /* First operand size in word */
operand2, /* Second operand pointer */
VU_BITS_TO_WORDS(64), /* Second operand size in word */
result, /* Pointer of result buffer*/
VU_BITS_TO_WORDS(64)); /* Result size in word*/
/* ... check for operation completion and data... */

◆ Cy_Cryptolite_Vu_Xor_Hw()

ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Xor_Hw ( CRYPTOLITE_Type *  base,
uint8_t *  val1Ptr,
uint32_t  val1Size,
uint8_t *  val2Ptr,
uint32_t  val2Size,
uint8_t *  result,
uint32_t  resultSize 
)

This function performs XOR operation.

Parameters
baseThe pointer to the Cryptolite instance.
val1PtrThe pointer to the 1st operand.
val1SizeLength of the first operand in word size.
val2PtrThe pointer to the 2nd operand.
val2SizeLength of the second operand in word size.
resultThe pointer to the output result
resultSizeLength of the output result in word size.
Returns
None
Function Usage
uint8_t operand1[VU_BITS_TO_BYTES(64)] = {0xa0, 0xca, 0xb0, 0x1e, 0xe2, 0xc0, 0x4a, 0xf8};
uint8_t operand2[VU_BITS_TO_BYTES(64)] = {0x96, 0x4e, 0x77, 0x7f, 0x69, 0x7f, 0xcf, 0x18};
uint8_t result[VU_BITS_TO_BYTES(64)];
/* Wait for cryptolite operation to complete */
/* Compute XOR using VU HW block */
CRYPTOLITE, /* Base address of the Crypto block registers */
operand1, /* First operand pointer */
VU_BITS_TO_WORDS(64), /* First operand size in word */
operand2, /* Second operand pointer */
VU_BITS_TO_WORDS(64), /* Second operand size in word */
result, /* Pointer of result buffer*/
VU_BITS_TO_WORDS(64)); /* Result size in word*/
/* ... check for operation completion and data... */

◆ Cy_Cryptolite_Vu_Mov_Hw()

ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Mov_Hw ( CRYPTOLITE_Type *  base,
uint8_t *  srcPtr,
uint32_t  srcSize,
uint8_t *  dstPtr,
uint32_t  dstSize 
)

This function performs copy/move operation.

Parameters
baseThe pointer to the Cryptolite instance.
srcPtrThe pointer to the source buffer.
srcSizeLength of the source buffer in word size.
dstPtrThe pointer to destination buffer
dstSizeLength of the destination buffer in word size.
Returns
None
Function Usage
uint8_t source[VU_BITS_TO_BYTES(64)] = {0xa0, 0xca, 0xb0, 0x1e, 0xe2, 0xc0, 0x4a, 0xf8};
uint8_t dest[VU_BITS_TO_BYTES(64)];
/* Wait for cryptolite operation to complete */
/* Move/Copy data using VU HW block */
CRYPTOLITE, /* Base address of the Crypto block registers */
source, /* Source buffer pointer */
VU_BITS_TO_WORDS(64), /* Source data size in word */
dest, /* Pointer of destination buffer*/
VU_BITS_TO_WORDS(64)); /* Destination data size in word*/
/* ... check for operation completion and data... */

◆ Cy_Cryptolite_Vu_Lsl1_Hw()

ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Lsl1_Hw ( CRYPTOLITE_Type *  base,
uint8_t *  dataPtr,
uint32_t  dataSize,
uint8_t *  dstPtr,
uint32_t  dstSize 
)

This function performs one bit left shift operation.

Parameters
baseThe pointer to the Cryptolite instance.
dataPtrThe pointer to the input data buffer.
dataSizeLength of the input data buffer in word size.
dstPtrThe pointer to destination buffer
dstSizeLength of the destination buffer in word size.
Returns
None
Function Usage
uint8_t source[VU_BITS_TO_BYTES(64)] = {0xa0, 0xca, 0xb0, 0x1e, 0xe2, 0xc0, 0x4a, 0xf8};
uint8_t dest[VU_BITS_TO_BYTES(64)];
/* Wait for cryptolite operation to complete */
/* One bit left shift operation using VU HW block */
CRYPTOLITE, /* Base address of the Crypto block registers */
source, /* Source buffer pointer */
VU_BITS_TO_WORDS(64), /* Source data size in word */
dest, /* Pointer of destination buffer*/
VU_BITS_TO_WORDS(64)); /* Destination data size in word*/
/* ... check for operation completion and data... */

◆ Cy_Cryptolite_Vu_Lsr1_Hw()

ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Lsr1_Hw ( CRYPTOLITE_Type *  base,
uint8_t *  dataPtr,
uint32_t  dataSize,
uint8_t *  dstPtr,
uint32_t  dstSize 
)

This function performs one bit right shift operation.

Parameters
baseThe pointer to the Cryptolite instance.
dataPtrThe pointer to the input data buffer.
dataSizeLength of the input data buffer in word size.
dstPtrThe pointer to destination buffer
dstSizeLength of the destination buffer in word size.
Returns
None
Function Usage
uint8_t source[VU_BITS_TO_BYTES(64)] = {0xa0, 0xca, 0xb0, 0x1e, 0xe2, 0xc0, 0x4a, 0xf8};
uint8_t dest[VU_BITS_TO_BYTES(64)];
/* Wait for cryptolite operation to complete */
/* One bit right shift operation using VU HW block */
CRYPTOLITE, /* Base address of the Crypto block registers */
source, /* Source buffer pointer */
VU_BITS_TO_WORDS(64), /* Source data size in word */
dest, /* Pointer of destination buffer*/
VU_BITS_TO_WORDS(64)); /* Destination data size in word*/
/* ... check for operation completion and data... */

◆ Cy_Cryptolite_Vu_Lsr_Hw()

ATTRIBUTES_CRYPTOLITE_RSA __STATIC_INLINE void Cy_Cryptolite_Vu_Lsr_Hw ( CRYPTOLITE_Type *  base,
uint8_t *  dataPtr,
uint32_t  dataSize,
uint32_t  bitShift,
uint8_t *  dstPtr,
uint32_t  dstSize 
)

This function performs left shift by specific given number.

Parameters
baseThe pointer to the Cryptolite instance.
dataPtrThe pointer to the input data buffer.
bitShiftNumber of bits to be shifted.
dataSizeLength of the input data buffer in word size.
dstPtrThe pointer to destination buffer
dstSizeLength of the destination buffer in word size.
Returns
None
Function Usage
uint8_t source[VU_BITS_TO_BYTES(64)] = {0xa0, 0xca, 0xb0, 0x1e, 0xe2, 0xc0, 0x4a, 0xf8};
uint8_t dest[VU_BITS_TO_BYTES(64)];
/* Wait for cryptolite operation to complete */
/* One bit right shift operation using VU HW block */
CRYPTOLITE, /* Base address of the Crypto block registers */
source, /* Source buffer pointer */
VU_BITS_TO_WORDS(64), /* Source data size in word */
16, /* Number of bits to be shifted */
dest, /* Pointer of destination buffer*/
VU_BITS_TO_WORDS(64)); /* Destination data size in word*/
/* ... check for operation completion and data... */