Data Structures | |
struct | Crypto_ShaParams |
Parameters passed during Crypto_shaOpen() More... | |
struct | Crypto_ShaFxns |
Driver implementation callbacks. More... | |
struct | Crypto_ShaContext |
CRYPTO SHA driver context. More... | |
struct | Crypto_ShaConfig |
CRYPTO SHA global configuration array. More... | |
Functions | |
void | Crypto_ShaParams_init (Crypto_ShaParams *params) |
Set default parameters in the Crypto_ShaParams structure. More... | |
Crypto_ShaHandle | Crypto_shaOpen (Crypto_ShaContext *ctx, const Crypto_ShaParams *params) |
This function gives the configuration based on type. More... | |
int32_t | Crypto_shaClose (Crypto_ShaHandle handle) |
This function clears a Secure Hash Algorithm (SHA ) context. More... | |
int32_t | Crypto_shaStarts (Crypto_ShaHandle handle) |
This function starts a Secure Hash Algorithm (SHA ) checksum calculation. More... | |
int32_t | Crypto_shaUpdate (Crypto_ShaHandle handle, const uint8_t *input, uint32_t ilen) |
This function feeds an input buffer into an ongoing Secure Hash Algorithm (SHA ) checksum calculation. More... | |
int32_t | Crypto_shaFinish (Crypto_ShaHandle handle, uint8_t *output) |
This function finishes the Secure Hash Algorithm (SHA ) operation, and writes the result to the output buffer. More... | |
int32_t | Crypto_shaSingleShot (Crypto_ShaHandle handle, const uint8_t *input, uint32_t ilen, uint8_t *output) |
This function calculates the Secure Hash Algorithm (SHA) checksum of a buffer. More... | |
int32_t | Crypto_hmacSha (Crypto_ShaHandle handle, const uint8_t *input, uint32_t ilen, uint8_t *output) |
This function calculates the Keyed-Hash Message Authentication Code Secure Hash Algorithm (HMAC-SHA) checksum of a buffer. More... | |
Typedefs | |
typedef void * | Crypto_ShaHandle |
Handle to the Crypto SHA driver returned by Crypto_shaOpen() More... | |
typedef int32_t(* | Crypto_ShaOpenFxn) (Crypto_ShaContext *ctx, const Crypto_ShaParams *params) |
callback functions declarations More... | |
typedef int32_t(* | Crypto_ShaCloseFxn) (Crypto_ShaContext *ctx) |
typedef int32_t(* | Crypto_ShaStartFxn) (Crypto_ShaContext *ctx) |
typedef int32_t(* | Crypto_ShaUpdateFxn) (Crypto_ShaContext *ctx, const uint8_t *input, uint32_t ilen) |
typedef int32_t(* | Crypto_ShaFinishFxn) (Crypto_ShaContext *ctx, uint8_t *output) |
typedef int32_t(* | Crypto_ShaSingleShotFxn) (Crypto_ShaContext *ctx, const uint8_t *input, uint32_t ilen, uint8_t *output) |
typedef int32_t(* | Crypto_hmacShaFxn) (Crypto_ShaContext *ctx, const uint8_t *input, uint32_t ilen, uint8_t *output) |
SHA authentication mode | |
#define | CRYPTO_SHA_AUTHMODE_NULL (0U) |
No individual Authentication. More... | |
#define | CRYPTO_SHA_AUTHMODE_SHA1 (1U) |
SHA1 mode. More... | |
#define | CRYPTO_SHA_AUTHMODE_SHA2_224 (2U) |
224-bit SHA2 mode More... | |
#define | CRYPTO_SHA_AUTHMODE_SHA2_256 (3U) |
256-bit SHA2 mode More... | |
#define | CRYPTO_SHA_AUTHMODE_SHA2_384 (4U) |
384-bit SHA2 mode. Note: This mode is used at Data Mode only for SA2_UL More... | |
#define | CRYPTO_SHA_AUTHMODE_SHA2_512 (5U) |
512-bit SHA2 mode. Note: This mode is used at Data Mode only for SA2_UL More... | |
#define | CRYPTO_SHA_AUTHMODE_HMAC_SHA1 (6U) |
HMAC with SHA1 mode. More... | |
#define | CRYPTO_SHA_AUTHMODE_HMAC_SHA2_224 (7U) |
HMAC with 224-bit SHA2 mode. More... | |
#define | CRYPTO_SHA_AUTHMODE_HMAC_SHA2_256 (8U) |
HMAC with 256-bit SHA2 mode. More... | |
#define | CRYPTO_SHA_AUTHMODE_HMAC_SHA2_384 (9U) |
HMAC with 224-bit SHA mode. Note: This mode is used at Data Mode only for SA2_UL. More... | |
#define | CRYPTO_SHA_AUTHMODE_HMAC_SHA2_512 (10U) |
HMAC with 256-bit SHA mode. Note: This mode is used at Data Mode only for SA2_UL. More... | |
HMAC SHA Max key lenght | |
#define | CRYPTO_HMAC_SHA_SW_MAX_KEYLEN_BYTES (128U) |
#define CRYPTO_SHA_AUTHMODE_NULL (0U) |
No individual Authentication.
#define CRYPTO_SHA_AUTHMODE_SHA1 (1U) |
SHA1 mode.
#define CRYPTO_SHA_AUTHMODE_SHA2_224 (2U) |
224-bit SHA2 mode
#define CRYPTO_SHA_AUTHMODE_SHA2_256 (3U) |
256-bit SHA2 mode
#define CRYPTO_SHA_AUTHMODE_SHA2_384 (4U) |
384-bit SHA2 mode. Note: This mode is used at Data Mode only for SA2_UL
#define CRYPTO_SHA_AUTHMODE_SHA2_512 (5U) |
512-bit SHA2 mode. Note: This mode is used at Data Mode only for SA2_UL
#define CRYPTO_SHA_AUTHMODE_HMAC_SHA1 (6U) |
HMAC with SHA1 mode.
#define CRYPTO_SHA_AUTHMODE_HMAC_SHA2_224 (7U) |
HMAC with 224-bit SHA2 mode.
#define CRYPTO_SHA_AUTHMODE_HMAC_SHA2_256 (8U) |
HMAC with 256-bit SHA2 mode.
#define CRYPTO_SHA_AUTHMODE_HMAC_SHA2_384 (9U) |
HMAC with 224-bit SHA mode. Note: This mode is used at Data Mode only for SA2_UL.
#define CRYPTO_SHA_AUTHMODE_HMAC_SHA2_512 (10U) |
HMAC with 256-bit SHA mode. Note: This mode is used at Data Mode only for SA2_UL.
#define CRYPTO_HMAC_SHA_SW_MAX_KEYLEN_BYTES (128U) |
typedef void* Crypto_ShaHandle |
Handle to the Crypto SHA driver returned by Crypto_shaOpen()
typedef int32_t(* Crypto_ShaOpenFxn) (Crypto_ShaContext *ctx, const Crypto_ShaParams *params) |
callback functions declarations
typedef int32_t(* Crypto_ShaCloseFxn) (Crypto_ShaContext *ctx) |
typedef int32_t(* Crypto_ShaStartFxn) (Crypto_ShaContext *ctx) |
typedef int32_t(* Crypto_ShaUpdateFxn) (Crypto_ShaContext *ctx, const uint8_t *input, uint32_t ilen) |
typedef int32_t(* Crypto_ShaFinishFxn) (Crypto_ShaContext *ctx, uint8_t *output) |
typedef int32_t(* Crypto_ShaSingleShotFxn) (Crypto_ShaContext *ctx, const uint8_t *input, uint32_t ilen, uint8_t *output) |
typedef int32_t(* Crypto_hmacShaFxn) (Crypto_ShaContext *ctx, const uint8_t *input, uint32_t ilen, uint8_t *output) |
void Crypto_ShaParams_init | ( | Crypto_ShaParams * | params | ) |
Set default parameters in the Crypto_ShaParams structure.
Call this API to set defaults and then override the fields as needed before calling Crypto_shaOpen.
params | [OUT] Initialized parameters |
Crypto_ShaHandle Crypto_shaOpen | ( | Crypto_ShaContext * | ctx, |
const Crypto_ShaParams * | params | ||
) |
This function gives the configuration based on type.
ctx | The SHA context to initialize. This must not be NULL . |
params | Type to which to assign the context |
int32_t Crypto_shaClose | ( | Crypto_ShaHandle | handle | ) |
This function clears a Secure Hash Algorithm (SHA ) context.
handle | The SHA context to clear. This may be NULL , in which case this function does nothing. If it is not NULL , it must point to an initialized SHA context. |
int32_t Crypto_shaStarts | ( | Crypto_ShaHandle | handle | ) |
This function starts a Secure Hash Algorithm (SHA ) checksum calculation.
handle | SHA driver handle from Crypto_shaOpen |
0
on success. A negative error code on failure. int32_t Crypto_shaUpdate | ( | Crypto_ShaHandle | handle, |
const uint8_t * | input, | ||
uint32_t | ilen | ||
) |
This function feeds an input buffer into an ongoing Secure Hash Algorithm (SHA ) checksum calculation.
handle | SHA driver handle from Crypto_shaOpen |
input | The buffer holding the input data. This must be a readable buffer of length ilen Bytes. |
ilen | The length of the input data in Bytes. |
0
on success. A negative error code on failure. int32_t Crypto_shaFinish | ( | Crypto_ShaHandle | handle, |
uint8_t * | output | ||
) |
This function finishes the Secure Hash Algorithm (SHA ) operation, and writes the result to the output buffer.
handle | SHA driver handle from Crypto_shaOpen |
output | The SHA checksum result. |
0
on success. A negative error code on failure. int32_t Crypto_shaSingleShot | ( | Crypto_ShaHandle | handle, |
const uint8_t * | input, | ||
uint32_t | ilen, | ||
uint8_t * | output | ||
) |
This function calculates the Secure Hash Algorithm (SHA) checksum of a buffer.
The function allocates the context, performs the calculation, and frees the context.
The SHA result is calculated as output = SHA(input buffer).
handle | SHA driver handle from Crypto_shaOpen |
input | The buffer holding the input data. This must be a readable buffer of length ilen Bytes. |
ilen | The length of the input data in Bytes. |
output | The SHA checksum result. |
0
on success. A negative error code on failure. int32_t Crypto_hmacSha | ( | Crypto_ShaHandle | handle, |
const uint8_t * | input, | ||
uint32_t | ilen, | ||
uint8_t * | output | ||
) |
This function calculates the Keyed-Hash Message Authentication Code Secure Hash Algorithm (HMAC-SHA) checksum of a buffer.
The function allocates the context, performs the calculation, and frees the context.
handle | SHA driver handle from Crypto_shaOpen |
input | The buffer holding the input data. This must be a readable buffer of length ilen Bytes. |
ilen | The length of the input data in Bytes. |
output | The SHA checksum result. |
0
on success. A negative error code on failure.
|
extern |
Externally defined SHA driver configuration array.