Data Structures | Macros | Typedefs | Functions
ti_psa_crypto_hash.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <third_party/mbedtls/include/psa/crypto.h>
#include <ti/devices/DeviceFamily.h>
#include <ti/drivers/SHA2.h>
#include <ti/drivers/sha2/SHA2XXF3HSM.h>
#include <ti/drivers/sha2/SHA2CC26X2.h>
Include dependency graph for ti_psa_crypto_hash.h:

Go to the source code of this file.

Data Structures

struct  ti_psa_hash_operation_s
 

Macros

#define PSA_HASH_SUSPEND_INPUT_LENGTH_FIELD_LENGTH(alg)
 
#define PSA_HASH_SUSPEND_HASH_STATE_FIELD_LENGTH(alg)
 
#define TI_PSA_HASH_OPERATION_INIT
 

Typedefs

typedef struct ti_psa_hash_operation_s ti_psa_hash_operation_t
 

Functions

static struct ti_psa_hash_operation_s ti_psa_hash_operation_init (void)
 
psa_status_t ti_psa_hash_abort (psa_hash_operation_t *psa_operation)
 
psa_status_t ti_psa_hash_resume (psa_hash_operation_t *psa_operation, const uint8_t *hash_state, size_t hash_state_length)
 
psa_status_t ti_psa_hash_setup (psa_hash_operation_t *psa_operation, psa_algorithm_t alg)
 
psa_status_t ti_psa_hash_suspend (psa_hash_operation_t *psa_operation, uint8_t *hash_state, size_t hash_state_size, size_t *hash_state_length)
 
psa_status_t ti_psa_hash_update (psa_hash_operation_t *psa_operation, const uint8_t *input, size_t input_length)
 
psa_status_t ti_psa_hash_finish (psa_hash_operation_t *psa_operation, uint8_t *hash, size_t hash_size, size_t *hash_length)
 
psa_status_t ti_psa_hash_clone (const psa_hash_operation_t *source_operation, psa_hash_operation_t *target_operation)
 
psa_status_t ti_psa_hash_compare (psa_algorithm_t alg, const uint8_t *input, size_t input_length, const uint8_t *hash, size_t hash_length)
 
psa_status_t ti_psa_hash_compute (psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *hash, size_t hash_size, size_t *hash_length)
 
psa_status_t ti_psa_hash_verify (psa_hash_operation_t *psa_operation, const uint8_t *hash, size_t hash_length)
 

Macro Definition Documentation

§ PSA_HASH_SUSPEND_INPUT_LENGTH_FIELD_LENGTH

#define PSA_HASH_SUSPEND_INPUT_LENGTH_FIELD_LENGTH (   alg)
Value:
(((alg == PSA_ALG_SHA_224) || (alg == PSA_ALG_SHA_256)) ? 8u \
: ((alg == PSA_ALG_SHA_384) || (alg == PSA_ALG_SHA_512)) ? 16u \
: 0u)
psa_algorithm_t alg
Definition: ti_psa_crypto_mac.h:87

Returns the number of bytes of the input length field for a SHA2 alg. Returns zero if the alg is not SHA2.

§ PSA_HASH_SUSPEND_HASH_STATE_FIELD_LENGTH

#define PSA_HASH_SUSPEND_HASH_STATE_FIELD_LENGTH (   alg)
Value:
(((alg == PSA_ALG_SHA_224) || (alg == PSA_ALG_SHA_256)) ? 32u \
: ((alg == PSA_ALG_SHA_384) || (alg == PSA_ALG_SHA_512)) ? 64u \
: 0u)
psa_algorithm_t alg
Definition: ti_psa_crypto_mac.h:87

Returns the number of bytes of the hash suspend state field for a SHA2 alg. Returns zero if the alg is not SHA2.

§ TI_PSA_HASH_OPERATION_INIT

#define TI_PSA_HASH_OPERATION_INIT
Value:
{ \
0 \
}
struct ti_psa_hash_operation_s ti_psa_hash_operation_t
Definition: ti_psa_crypto_hash.h:76

Referenced by ti_psa_hash_operation_init().

Typedef Documentation

§ ti_psa_hash_operation_t

Function Documentation

§ ti_psa_hash_operation_init()

static struct ti_psa_hash_operation_s ti_psa_hash_operation_init ( void  )
static

§ ti_psa_hash_abort()

psa_status_t ti_psa_hash_abort ( psa_hash_operation_t *  psa_operation)

§ ti_psa_hash_resume()

psa_status_t ti_psa_hash_resume ( psa_hash_operation_t *  psa_operation,
const uint8_t *  hash_state,
size_t  hash_state_length 
)

§ ti_psa_hash_setup()

psa_status_t ti_psa_hash_setup ( psa_hash_operation_t *  psa_operation,
psa_algorithm_t  alg 
)

§ ti_psa_hash_suspend()

psa_status_t ti_psa_hash_suspend ( psa_hash_operation_t *  psa_operation,
uint8_t *  hash_state,
size_t  hash_state_size,
size_t *  hash_state_length 
)

§ ti_psa_hash_update()

psa_status_t ti_psa_hash_update ( psa_hash_operation_t *  psa_operation,
const uint8_t *  input,
size_t  input_length 
)

§ ti_psa_hash_finish()

psa_status_t ti_psa_hash_finish ( psa_hash_operation_t *  psa_operation,
uint8_t *  hash,
size_t  hash_size,
size_t *  hash_length 
)

§ ti_psa_hash_clone()

psa_status_t ti_psa_hash_clone ( const psa_hash_operation_t *  source_operation,
psa_hash_operation_t *  target_operation 
)

§ ti_psa_hash_compare()

psa_status_t ti_psa_hash_compare ( psa_algorithm_t  alg,
const uint8_t *  input,
size_t  input_length,
const uint8_t *  hash,
size_t  hash_length 
)

§ ti_psa_hash_compute()

psa_status_t ti_psa_hash_compute ( psa_algorithm_t  alg,
const uint8_t *  input,
size_t  input_length,
uint8_t *  hash,
size_t  hash_size,
size_t *  hash_length 
)

§ ti_psa_hash_verify()

psa_status_t ti_psa_hash_verify ( psa_hash_operation_t *  psa_operation,
const uint8_t *  hash,
size_t  hash_length 
)
© Copyright 1995-2026, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale