Hashing#
Provides cryptographic hash functions (SHA-1, SHA-224, SHA-256, SHA-384, SHA-512).
Provides API for one-way hashing functions.
Modules#
sl_se_sha1_multipart_context_t
sl_se_sha224_multipart_context_t
sl_se_sha256_multipart_context_t
sl_se_sha384_multipart_context_t
sl_se_sha512_multipart_context_t
Enumerations#
Hash algorithms.
Functions#
Produce a message digest (a hash block) using the input data.
Prepare a SHA1 hash streaming command context object.
Prepare a SHA224 hash streaming command context object.
Prepare a SHA256 hash streaming command context object.
Prepare a SHA384 streaming command context object.
Prepare a SHA512 streaming command context object.
Prepare a hash streaming command context object.
Feeds an input buffer into an ongoing hash computation.
Finish a hash streaming operation and return the resulting hash digest.
Macros#
Default streaming hash context.
SHA1 streaming hash context.
SHA224 streaming hash context.
SHA256 streaming hash context.
SHA384 streaming hash context.
SHA512 streaming hash context.
Enumeration Documentation#
sl_se_hash_type_t#
sl_se_hash_type_t
Hash algorithms.
Enumerator | |
---|---|
SL_SE_HASH_NONE | No hash. |
SL_SE_HASH_SHA1 | SHA-1. |
SL_SE_HASH_SHA224 | SHA-224. |
SL_SE_HASH_SHA256 | SHA-256. |
SL_SE_HASH_SHA384 | SHA-384. |
SL_SE_HASH_SHA512 | SHA-512. |
386
of file platform/security/sl_component/se_manager/inc/sl_se_manager_types.h
Function Documentation#
sl_se_hash#
sl_status_t sl_se_hash (sl_se_command_context_t * cmd_ctx, sl_se_hash_type_t hash_type, const uint8_t * message, unsigned int message_size, uint8_t * digest, size_t digest_len)
Produce a message digest (a hash block) using the input data.
[in] | cmd_ctx | Pointer to an SE command context object. |
[in] | hash_type | Which hashing algorithm to use. |
[in] | message | Pointer to the message buffer to compute the hash/digest from. |
[in] | message_size | Number of bytes in message. |
[out] | digest | Pointer to block of memory to store the final digest. |
[in] | digest_len | The length of the message digest (hash), must be at least the size of the corresponding hash type. |
This function generates a message digest adhering to the given inputs. For instance, if the algorithm is chosen to be SHA-256, it will generate a 32 bytes message digest computed based on the input message. This function supports SHA-1, SHA-256 and SHA-512 algorithms.
Returns
Status code, sl_status.h.
99
of file platform/security/sl_component/se_manager/inc/sl_se_manager_hash.h
sl_se_hash_sha1_multipart_starts#
sl_status_t sl_se_hash_sha1_multipart_starts (sl_se_sha1_multipart_context_t * sha1_ctx, sl_se_command_context_t * cmd_ctx)
Prepare a SHA1 hash streaming command context object.
[in] | sha1_ctx | Pointer to a SHA1 streaming context object. |
[in] | cmd_ctx | Pointer to an SE command context object. |
Prepare a SHA1 hash streaming command context object to be used in subsequent calls to hash streaming functions sl_se_hash_multipart_update() and sl_se_hash_multipart_finish().
Returns
Status code, sl_status.h.
124
of file platform/security/sl_component/se_manager/inc/sl_se_manager_hash.h
sl_se_hash_sha224_multipart_starts#
sl_status_t sl_se_hash_sha224_multipart_starts (sl_se_sha224_multipart_context_t * sha224_ctx, sl_se_command_context_t * cmd_ctx)
Prepare a SHA224 hash streaming command context object.
[in] | sha224_ctx | Pointer to a SHA224 streaming context object. |
[in] | cmd_ctx | Pointer to an SE command context object. |
Prepare a SHA224 hash streaming command context object to be used in subsequent calls to hash streaming functions sl_se_hash_multipart_update() and sl_se_hash_multipart_finish().
Returns
Status code, sl_status.h.
145
of file platform/security/sl_component/se_manager/inc/sl_se_manager_hash.h
sl_se_hash_sha256_multipart_starts#
sl_status_t sl_se_hash_sha256_multipart_starts (sl_se_sha256_multipart_context_t * sha256_ctx, sl_se_command_context_t * cmd_ctx)
Prepare a SHA256 hash streaming command context object.
[in] | sha256_ctx | Pointer to a SHA256 streaming context object. |
[in] | cmd_ctx | Pointer to an SE command context object. |
Prepare a SHA256 hash streaming command context object to be used in subsequent calls to hash streaming functions sl_se_hash_multipart_update() and sl_se_hash_multipart_finish().
Returns
Status code, sl_status.h.
166
of file platform/security/sl_component/se_manager/inc/sl_se_manager_hash.h
sl_se_hash_sha384_multipart_starts#
sl_status_t sl_se_hash_sha384_multipart_starts (sl_se_sha384_multipart_context_t * sha384_ctx, sl_se_command_context_t * cmd_ctx)
Prepare a SHA384 streaming command context object.
[in] | sha384_ctx | Pointer to a SHA384 streaming context object. |
[in] | cmd_ctx | Pointer to an SE command context object. |
Prepare a SHA384 hash streaming command context object to be used in subsequent calls to hash streaming functions sl_se_hash_multipart_update() and sl_se_hash_multipart_finish().
Returns
Status code, sl_status.h.
188
of file platform/security/sl_component/se_manager/inc/sl_se_manager_hash.h
sl_se_hash_sha512_multipart_starts#
sl_status_t sl_se_hash_sha512_multipart_starts (sl_se_sha512_multipart_context_t * sha512_ctx, sl_se_command_context_t * cmd_ctx)
Prepare a SHA512 streaming command context object.
[in] | sha512_ctx | Pointer to a SHA512 streaming context object. |
[in] | cmd_ctx | Pointer to an SE command context object. |
Prepare a SHA512 hash streaming command context object to be used in subsequent calls to hash streaming functions sl_se_hash_multipart_update() and sl_se_hash_multipart_finish().
Returns
Status code, sl_status.h.
209
of file platform/security/sl_component/se_manager/inc/sl_se_manager_hash.h
sl_se_hash_multipart_starts#
sl_status_t sl_se_hash_multipart_starts (void * hash_type_ctx, sl_se_command_context_t * cmd_ctx, sl_se_hash_type_t hash_type)
Prepare a hash streaming command context object.
[in] | hash_type_ctx | Pointer to a hash streaming context object specific to the hash type specified by |
[in] | cmd_ctx | Pointer to an SE command context object. |
[in] | hash_type | Type of hash algoritm |
Prepare a hash (message digest) streaming command context object to be used in subsequent calls to hash streaming functions sl_se_hash_multipart_update() and sl_se_hash_multipart_finish().
Returns
Status code, sl_status.h.
237
of file platform/security/sl_component/se_manager/inc/sl_se_manager_hash.h
sl_se_hash_multipart_update#
sl_status_t sl_se_hash_multipart_update (void * hash_type_ctx, sl_se_command_context_t * cmd_ctx, const uint8_t * input, size_t input_len)
Feeds an input buffer into an ongoing hash computation.
[in] | hash_type_ctx | Pointer to a hash streaming context object specific to the hash type specified by |
[in] | cmd_ctx | Pointer to an SE command context object. |
[in] | input | Buffer holding the input data, must be at least |
[in] | input_len | The length of the input data in bytes. |
This function is called between sl_se_hash_multipart_starts() and sl_se_hash_multipart_finish(). This function can be called repeatedly.
Returns
Status code, sl_status.h.
265
of file platform/security/sl_component/se_manager/inc/sl_se_manager_hash.h
sl_se_hash_multipart_finish#
sl_status_t sl_se_hash_multipart_finish (void * hash_type_ctx, sl_se_command_context_t * cmd_ctx, uint8_t * digest_out, size_t digest_len)
Finish a hash streaming operation and return the resulting hash digest.
[in] | hash_type_ctx | Pointer to a hash streaming context object specific to the hash type specified by |
[in] | cmd_ctx | Pointer to an SE command context object. |
[out] | digest_out | Buffer for holding the message digest (hash), must be at least the size of the corresponding message digest type. |
[in] | digest_len | The length of the message digest (hash), must be at least the size of the corresponding hash type. |
This function is called after sl_se_hash_multipart_update().
Returns
Status code, sl_status.h.
294
of file platform/security/sl_component/se_manager/inc/sl_se_manager_hash.h
Macro Definition Documentation#
SL_SE_HASH_STREAMING_INIT_DEFAULT#
#define SL_SE_HASH_STREAMING_INIT_DEFAULTValue:
{ NULL, 0, 0, NULL }
Default streaming hash context.
482
of file platform/security/sl_component/se_manager/inc/sl_se_manager_defines.h
SL_SE_SHA1_STREAMING_INIT_DEFAULT#
#define SL_SE_SHA1_STREAMING_INIT_DEFAULTValue:
{ { 0 }, { 0 }, { 0 } }
SHA1 streaming hash context.
483
of file platform/security/sl_component/se_manager/inc/sl_se_manager_defines.h
SL_SE_SHA224_STREAMING_INIT_DEFAULT#
#define SL_SE_SHA224_STREAMING_INIT_DEFAULTValue:
{ { 0 }, { 0 }, { 0 } }
SHA224 streaming hash context.
484
of file platform/security/sl_component/se_manager/inc/sl_se_manager_defines.h
SL_SE_SHA256_STREAMING_INIT_DEFAULT#
#define SL_SE_SHA256_STREAMING_INIT_DEFAULTValue:
{ { 0 }, { 0 }, { 0 } }
SHA256 streaming hash context.
485
of file platform/security/sl_component/se_manager/inc/sl_se_manager_defines.h
SL_SE_SHA384_STREAMING_INIT_DEFAULT#
#define SL_SE_SHA384_STREAMING_INIT_DEFAULTValue:
{ { 0 }, { 0 }, { 0 } }
SHA384 streaming hash context.
486
of file platform/security/sl_component/se_manager/inc/sl_se_manager_defines.h
SL_SE_SHA512_STREAMING_INIT_DEFAULT#
#define SL_SE_SHA512_STREAMING_INIT_DEFAULTValue:
{ { 0 }, { 0 }, { 0 } }
SHA512 streaming hash context.
487
of file platform/security/sl_component/se_manager/inc/sl_se_manager_defines.h