xilsecure
Vitis Drivers API Documentation
XilSecure MGF Server APIs

Data Structures

struct  XSecure_HashAlgInfo
 Structure for Hash Algorithm Info. More...
 
struct  XSecure_MgfInput
 Structure has input and output parameters used for MGF. More...
 

Macros

#define XSECURE_I2OSP_LIMIT   (256U)
 Integer to octet stream primitive limit. More...
 
#define XSECURE_SHA3_HASH_LENGTH_IN_BYTES   (48U)
 SHA3 Hash length in bytes. More...
 

Functions

XSecure_HashAlgInfoXSecure_GetHashInstance (XSecure_ShaMode Shatype)
 This function returns hash function list of user specified hash algorithm. More...
 
int XSecure_MaskGenFunc (XSecure_ShaMode ShaType, void *InstancePtr, XSecure_MgfInput *MgfInput)
 This function takes an input of variable length and a desired output length as input, and provides fixed output mask using cryptographic hash function. More...
 

Macro Definition Documentation

#define XSECURE_I2OSP_LIMIT   (256U)

Integer to octet stream primitive limit.

#define XSECURE_SHA3_HASH_LENGTH_IN_BYTES   (48U)

SHA3 Hash length in bytes.

Referenced by XSecure_MaskGenFunc().

Function Documentation

XSecure_HashAlgInfo * XSecure_GetHashInstance ( XSecure_ShaMode  Shatype)

This function returns hash function list of user specified hash algorithm.

Get Hash Instance function.

Parameters
Shatypeholds the XSecure_ShaMode value of chosen sha algo.
Returns

Referenced by XSecure_MaskGenFunc().

int XSecure_MaskGenFunc ( XSecure_ShaMode  ShaType,
void *  InstancePtr,
XSecure_MgfInput MgfInput 
)

This function takes an input of variable length and a desired output length as input, and provides fixed output mask using cryptographic hash function.

Mask Generation function.

i.e. Mask Generation Function(MGF).

Parameters
ShaTypeis of type XSecure_ShaMode.
InstancePtris pointer to the sha instance.
MgfInputis pointer to XSecure_MgfInput instance.
Returns
  • XST_SUCCESS On success.
  • XST_INVALID_PARAM If any input parameter is invalid
  • XST_FAILURE On failure.

References XSecure_HashAlgInfo::HashLen, XSecure_MgfInput::Output, XSecure_MgfInput::OutputLen, XSecure_MgfInput::Seed, XSecure_MgfInput::SeedLen, XSecure_HashAlgInfo::ShaFinish, XSecure_HashAlgInfo::ShaStart, XSecure_HashAlgInfo::Shatype, XSecure_HashAlgInfo::ShaUpdate, XSecure_GetHashInstance(), XSECURE_SHA3_HASH_LENGTH_IN_BYTES, and XSECURE_WORD_SIZE.