123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #ifndef NRF_CRYPTO_HASH_SHARED_H__
- #define NRF_CRYPTO_HASH_SHARED_H__
- #include "stdint.h"
- #include "stddef.h"
- #include "sdk_errors.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define NRF_CRYPTO_HASH_INIT_VALUE (0x4846526E)
- typedef enum
- {
- NRF_CRYPTO_HASH_MODE_SHA256,
- NRF_CRYPTO_HASH_MODE_SHA512
- } nrf_crypto_hash_mode_t;
- typedef ret_code_t (*nrf_crypto_hash_init_fn_t)(void * const p_context);
- typedef ret_code_t (*nrf_crypto_hash_update_fn_t)(void * const p_context,
- uint8_t const * p_data,
- size_t size);
- typedef ret_code_t (*nrf_crypto_hash_finalize_fn_t)(void * const p_context,
- uint8_t * p_digest,
- size_t * const p_digest_size);
- typedef struct
- {
- nrf_crypto_hash_init_fn_t const init_fn;
- nrf_crypto_hash_update_fn_t const update_fn;
- nrf_crypto_hash_finalize_fn_t const finalize_fn;
- size_t const digest_size;
- size_t const context_size;
- nrf_crypto_hash_mode_t const hash_mode;
- } nrf_crypto_hash_info_t;
- typedef struct
- {
- uint32_t init_val;
- nrf_crypto_hash_info_t const * p_info;
- } nrf_crypto_hash_internal_context_t;
- #ifdef __cplusplus
- }
- #endif
- #endif
|