Hash Context Object Operations
[Object-Manipulation Operations]

Functions

void fsl_shw_hco_init (fsl_shw_hco_t *hash_ctx, fsl_shw_hash_alg_t algorithm)
void fsl_shw_hco_get_digest (const fsl_shw_hco_t *hash_ctx, uint8_t *digest, uint8_t length, uint32_t *msg_length)
void fsl_shw_hco_get_info (const fsl_shw_hco_t *hash_ctx, fsl_shw_hash_alg_t *algorithm)
void fsl_shw_hco_set_digest (fsl_shw_hco_t *hash_ctx, const uint8_t *context, uint32_t msg_length)
void fsl_shw_hco_set_flags (fsl_shw_hco_t *hash_ctx, uint32_t flags)
void fsl_shw_hco_clear_flags (fsl_shw_hco_t *hash_ctx, uint32_t flags)

Detailed Description

These operations should be the only access to the fsl_shw_hco_t type/struct, as the internal members of that object are subject to change.


Function Documentation

void fsl_shw_hco_clear_flags ( fsl_shw_hco_t hash_ctx,
uint32_t  flags 
)

Clear flags in a Hash Context Object.

Turns off the flags specified in flags. Other flags are untouched.

Parameters:
hash_ctx The hash context to be operated on.
flags The flags to be reset in the context. These can be ORed members of fsl_shw_hash_ctx_flags_t.
void fsl_shw_hco_get_digest ( const fsl_shw_hco_t hash_ctx,
uint8_t *  digest,
uint8_t  length,
uint32_t *  msg_length 
)

Get the current hash value and message length from the hash context object.

The algorithm must have already been specified. See fsl_shw_hco_init().

Parameters:
hash_ctx The hash context to query.
[out] digest Pointer to the location of length octets where to store a copy of the current value of the digest.
length Number of octets of hash value to copy.
[out] msg_length Pointer to the location to store the number of octets already hashed.
void fsl_shw_hco_get_info ( const fsl_shw_hco_t hash_ctx,
fsl_shw_hash_alg_t algorithm 
)

Get the hash algorithm from the hash context object.

Parameters:
hash_ctx The hash context to query.
[out] algorithm Pointer to where the algorithm is to be stored.
void fsl_shw_hco_init ( fsl_shw_hco_t hash_ctx,
fsl_shw_hash_alg_t  algorithm 
)

Initialize a Hash Context Object.

This function must be called before performing any other operation with the Object. It sets the current message length and hash algorithm in the hash context object.

Parameters:
hash_ctx The hash context to operate upon.
algorithm The hash algorithm to be used (FSL_HASH_ALG_MD5, FSL_HASH_ALG_SHA256, etc).
void fsl_shw_hco_set_digest ( fsl_shw_hco_t hash_ctx,
const uint8_t *  context,
uint32_t  msg_length 
)

Set the current hash value and message length in the hash context object.

The algorithm must have already been specified. See fsl_shw_hco_init().

Parameters:
hash_ctx The hash context to operate upon.
context Pointer to buffer of appropriate length to copy into the hash context object.
msg_length The number of octets of the message which have already been hashed.
void fsl_shw_hco_set_flags ( fsl_shw_hco_t hash_ctx,
uint32_t  flags 
)

Set flags in a Hash Context Object.

Turns on the flags specified in flags. Other flags are untouched.

Parameters:
hash_ctx The hash context to be operated on.
flags The flags to be set in the context. These can be ORed members of fsl_shw_hash_ctx_flags_t.
footer
©  Freescale Semiconductor, Inc., 2007.  All rights reserved.
Freescale Confidential Proprietary
NDA Required
doxygen