xilsecure
Vitis Drivers API Documentation
XilSecure SHA3 ZynqMP APIs

Functions

s32 XSecure_Sha3Initialize (XSecure_Sha3 *InstancePtr, XCsuDma *CsuDmaPtr)
 SHA3 Initialization Function. More...
 
void XSecure_Sha3Start (XSecure_Sha3 *InstancePtr)
 SHA3 Start Function. More...
 
u32 XSecure_Sha3Update (XSecure_Sha3 *InstancePtr, const u8 *Data, const u32 Size)
 SHA3 Data Transfer Function. More...
 
u32 XSecure_Sha3Finish (XSecure_Sha3 *InstancePtr, u8 *Hash)
 SHA3 Finish Function. More...
 
u32 XSecure_Sha3Digest (XSecure_Sha3 *InstancePtr, const u8 *In, const u32 Size, u8 *Out)
 SHA3 Complete Digest Calculation Function. More...
 
void XSecure_Sha3_ReadHash (XSecure_Sha3 *InstancePtr, u8 *Hash)
 SHA3 Read Hash Function. More...
 
s32 XSecure_Sha3PadSelection (XSecure_Sha3 *InstancePtr, XSecure_Sha3PadType Sha3PadType)
 SHA3 Padding Selection Function. More...
 
s32 XSecure_Sha3LastUpdate (XSecure_Sha3 *InstancePtr)
 SHA3 Last Update Call Function. More...
 
u32 XSecure_Sha3WaitForDone (XSecure_Sha3 *InstancePtr)
 SHA3 Wait To Complete Function. More...
 

Function Documentation

void XSecure_Sha3_ReadHash ( XSecure_Sha3 *  InstancePtr,
u8 *  Hash 
)

SHA3 Read Hash Function.

SHA3 Read Hash Function.

Parameters
InstancePtrPointer to the XSecure_Sha3 instance.
HashPointer to a buffer in which read hash will be stored.
Returns
None
u32 XSecure_Sha3Digest ( XSecure_Sha3 *  InstancePtr,
const u8 *  In,
const u32  Size,
u8 *  Out 
)

SHA3 Complete Digest Calculation Function.

SHA3 Complete Digest Calculation Function.

Parameters
InstancePtrPointer to the XSecure_Sha3 instance.
InPointer to the input data for hashing
SizeSize of the input data
OutPointer to location where resulting hash will be written.
Returns
XST_SUCCESS if digest calculation done successfully XST_FAILURE if any error from Sha3Update or Sha3Finish.

References XSecure_Sha3Finish(), XSecure_Sha3Start(), and XSecure_Sha3Update().

u32 XSecure_Sha3Finish ( XSecure_Sha3 *  InstancePtr,
u8 *  Hash 
)

SHA3 Finish Function.

SHA3 Finish Function.

Parameters
InstancePtrPointer to the XSecure_Sha3 instance.
HashPointer to location where resulting hash will be written
Returns
XST_SUCCESS if finished without any errors XST_FAILURE if Sha3PadType is other than KECCAK or NIST
s32 XSecure_Sha3Initialize ( XSecure_Sha3 *  InstancePtr,
XCsuDma *  CsuDmaPtr 
)

SHA3 Initialization Function.

SHA3 Initialization Function.

Parameters
InstancePtrPointer to the XSecure_Sha3 instance.
CsuDmaPtrPointer to the XCsuDma instance.
Returns
XST_SUCCESS if initialization was successful
Note
The base address is initialized directly with value from xsecure_hw.h The default is NIST SHA3 padding, to change to KECCAK padding call XSecure_Sha3PadSelection() after XSecure_Sha3Initialize().
s32 XSecure_Sha3LastUpdate ( XSecure_Sha3 *  InstancePtr)

SHA3 Last Update Call Function.

SHA3 Last Update Call Function.

Parameters
InstancePtrPointer to the XSecure_Sha3 instance.
Returns
XST_SUCCESS if last update can be accepted
s32 XSecure_Sha3PadSelection ( XSecure_Sha3 *  InstancePtr,
XSecure_Sha3PadType  Sha3PadType 
)

SHA3 Padding Selection Function.

SHA3 Padding Selection Function.

Parameters
InstancePtrPointer to the XSecure_Sha3 instance.
Sha3PadTypeType of SHA3 padding to be used.
  • For NIST SHA-3 padding - XSECURE_CSU_NIST_SHA3
  • For KECCAK SHA-3 padding - XSECURE_CSU_KECCAK_SHA3
Returns
XST_SUCCESS if pad selection is successful. XST_FAILURE if pad selecction is failed.
Note
The default provides support for NIST SHA-3. If a user wants to change the padding to Keccak SHA-3, this function should be called after XSecure_Sha3Initialize()

Referenced by XSecure_PpkVerify(), and XSecure_SpkAuthentication().

void XSecure_Sha3Start ( XSecure_Sha3 *  InstancePtr)

SHA3 Start Function.

SHA3 Start Function.

Parameters
InstancePtrPointer to the XSecure_Sha3 instance.
Returns
None

Referenced by XSecure_Sha3Digest(), XSecure_Sha3Hash(), and XSecure_SpkAuthentication().

u32 XSecure_Sha3Update ( XSecure_Sha3 *  InstancePtr,
const u8 *  Data,
const u32  Size 
)

SHA3 Data Transfer Function.

SHA3 Data Transfer Function.

Parameters
InstancePtrPointer to the XSecure_Sha3 instance.
DataPointer to the input data for hashing.
SizeSize of the input data in bytes.
Returns
XST_SUCCESS if the update is successful XST_FAILURE if there is a failure in SSS config

References XSecure_SetReset().

u32 XSecure_Sha3WaitForDone ( XSecure_Sha3 *  InstancePtr)

SHA3 Wait To Complete Function.

SHA3 Wait To Complete Function.

Parameters
InstancePtrPointer to the XSecure_Sha3 instance.
Returns
XST_SUCCESS if the SHA3 completes its operation. XST_FAILURE if a timeout has occurred.