281 #ifndef ti_drivers_SHA2__include 282 #define ti_drivers_SHA2__include 306 #define SHA2_STATUS_RESERVED (-32) 314 #define SHA2_STATUS_SUCCESS ((int_fast16_t)0) 322 #define SHA2_STATUS_ERROR ((int_fast16_t)-1) 332 #define SHA2_STATUS_RESOURCE_UNAVAILABLE ((int_fast16_t)-2) 337 #define SHA2_STATUS_CANCELED ((int_fast16_t)-3) 343 #define SHA2_STATUS_UNSUPPORTED ((int_fast16_t)-4) 351 #define SHA2_STATUS_KEYSTORE_ERROR ((int_fast16_t)-5) 630 int_fast16_t
SHA2_addData(SHA2_Handle handle,
const void *data,
size_t length);
656 int_fast16_t
SHA2_finalize(SHA2_Handle handle,
void *digest);
718 int_fast16_t
SHA2_hashData(SHA2_Handle handle,
const void *data,
size_t dataLength,
void *digest);
756 int_fast16_t
SHA2_hmac(SHA2_Handle handle,
CryptoKey *key,
const void *data,
size_t dataLength,
void *hmac);
int_fast16_t SHA2_finalizeHmac(SHA2_Handle handle, void *hmac)
Finishes an HMAC operation and writes the result to hmac.
SHA2_Config * SHA2_Handle
A handle that is returned from an SHA2_open() call.
Definition: SHA2.h:458
ADC_Params params
Definition: Driver_Init.h:11
The CryptoKey type is an opaque representation of a cryptographic key.
SHA2_Handle SHA2_construct(SHA2_Config *config, const SHA2_Params *params)
Constructs a new SHA2 object.
int_fast16_t SHA2_hmac(SHA2_Handle handle, CryptoKey *key, const void *data, size_t dataLength, void *hmac)
Creates a keyed hash of data with key.
SHA2_HashType hashType
Definition: SHA2.h:482
const SHA2_Config SHA2_config[]
Global SHA2 configuration struct.
void SHA2_reset(SHA2_Handle handle)
Clears internal buffers and aborts an ongoing SHA2 operation.
const uint_least8_t SHA2_count
Global SHA2 configuration count.
const SHA2_Params SHA2_defaultParams
Default SHA2_Params structure.
SHA2 Global configuration.
Definition: SHA2.h:446
SHA2_ReturnBehavior returnBehavior
Definition: SHA2.h:485
CryptoKey datastructure.
Definition: CryptoKey.h:192
void SHA2_init(void)
Initializes the SHA2 driver module.
int_fast16_t SHA2_addData(SHA2_Handle handle, const void *data, size_t length)
Adds a segment of data with a length in bytes to the cryptographic hash or HMAC.
int_fast16_t SHA2_setHashType(SHA2_Handle handle, SHA2_HashType type)
Selects a new hash algorithm type.
void SHA2_close(SHA2_Handle handle)
Closes a SHA2 peripheral specified by handle.
uint32_t timeout
Definition: SHA2.h:487
SHA2_Handle SHA2_open(uint_least8_t index, const SHA2_Params *params)
Initializes a SHA2 driver instance and returns a handle.
SHA2_ReturnBehavior
The way in which SHA2 function calls return after performing an operation.
Definition: SHA2.h:374
SHA2_HashType
Enum for the hash types supported by the driver.
Definition: SHA2.h:395
SHA2_DigestLengthBytes
Enum for the hash digest lengths in bytes supported by the driver.
Definition: SHA2.h:406
int_fast16_t SHA2_setupHmac(SHA2_Handle handle, CryptoKey *key)
Starts an HMAC operation on segmented data.
int_fast16_t SHA2_finalize(SHA2_Handle handle, void *digest)
Finishes a hash operation and writes the result to digest.
void * object
Definition: SHA2.h:449
int_fast16_t SHA2_hashData(SHA2_Handle handle, const void *data, size_t dataLength, void *digest)
Hashes a segment of data with a size in bytes and writes the resulting hash to digest.
int_fast16_t SHA2_cancelOperation(SHA2_Handle handle)
Aborts an ongoing SHA2 operation and clears internal buffers.
void const * hwAttrs
Definition: SHA2.h:452
SHA2_CallbackFxn callbackFxn
Definition: SHA2.h:486
SHA2 Parameters.
Definition: SHA2.h:480
void(* SHA2_CallbackFxn)(SHA2_Handle handle, int_fast16_t returnStatus)
The definition of a callback function used by the SHA2 driver when used in SHA2_RETURN_BEHAVIOR_CALLB...
Definition: SHA2.h:470
void SHA2_Params_init(SHA2_Params *params)
Initializes params with default values.
SHA2_BlockSizeBytes
Enum for the block sizes of the algorithms.
Definition: SHA2.h:427