AM64x MCU+ SDK  12.01.00

Introduction

This file contains the prototype of crypto_util driver APIs.

Go to the source code of this file.

Data Structures

struct  Crypto_PSSSaltInfo
 Message hash and salt inputs to Crypto_PSSPaddingForSign, bundled to keep the function's parameter count down. More...
 

Macros

crypto Algo Types

#define HASH_ALG_SHA1   (0x0U)
 Hash Algo SHA-1. More...
 
#define HASH_ALG_SHA2_256   (0x1U)
 Hash Algo SHA-256. More...
 
#define HASH_ALG_SHA2_512   (0x2U)
 Hash Algo SHA-512. More...
 
#define HASH_ALG_SHA2_384   (0x3U)
 Hash Algo SHA-384. More...
 

Typedefs

typedef uint32_t(* Crypto_ShaCallback) (uint8_t *inputBuf, uint32_t inputLenBytes, uint8_t *digestBuf)
 Callback used by Crypto_MGF1/Crypto_PSSPaddingForSign/Crypto_PSSVerify to compute a hash digest. Same parameter shape as AsymCrypt_ExecuteShaCallback (asym_crypt.h) so existing SHA wrapper functions can be passed in directly without an adapter. More...
 

Functions

void Crypto_Uint8ToUint32 (const uint8_t *source, uint32_t sourceLengthInBytes, uint32_t *dest)
 Function to convert uint8_t to uint32_t format. More...
 
void Crypto_Uint32ToUint8 (const uint32_t *src, uint32_t sourceLengthInBytes, uint8_t *dest)
 Function to convert uint32_t to uint8_t format. More...
 
void Crypto_Uint32ToBigInt (uint32_t *source, uint32_t sourceLengthInWords, uint32_t *dest)
 Function to convert uint32_t to Bigint format. More...
 
void Crypto_bigIntToUint32 (uint32_t *source, uint32_t sourceLengthInWords, uint32_t *dest)
 Function to convert Bigint to uint32_t format. More...
 
void Crypto_PKCSPaddingForSign (const uint8_t *shaHash, uint32_t keyLengthInBytes, uint32_t typeOfAlgo, uint8_t *output)
 Padding function for sign. More...
 
uint32_t Crypto_MGF1 (Crypto_ShaCallback shaCbFxn, uint32_t hashLenInBytes, uint8_t *seedBuf, uint32_t seedLenInBytes, uint8_t *mask, uint32_t maskLenInBytes)
 MGF1 mask generation function, refer to RFC 8017 Appendix B.2.1 https://www.rfc-editor.org/rfc/rfc8017#appendix-B.2.1. More...
 
uint32_t Crypto_PSSPaddingForSign (Crypto_ShaCallback shaCbFxn, uint32_t typeOfAlgo, const struct Crypto_PSSSaltInfo *saltInfo, uint32_t modBits, uint32_t emLenInBytes, uint8_t *output)
 Builds the EMSA-PSS encoding for RSA signing, refer to RFC 8017 Section 9.1.1 https://www.rfc-editor.org/rfc/rfc8017#section-9.1.1. More...
 
uint32_t Crypto_PSSVerify (Crypto_ShaCallback shaCbFxn, uint32_t typeOfAlgo, const uint8_t *msgHash, uint32_t saltLenInBytes, uint32_t modBits, const uint8_t *EM, uint32_t emLenInBytes)
 Verifies an EMSA-PSS encoding for RSA signature verification, refer to RFC 8017 Section 9.1.2 https://www.rfc-editor.org/rfc/rfc8017#section-9.1.2. More...