Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

fsl_shw_return_t shw_hash_init ( shw_hash_state_t state,
fsl_shw_hash_alg_t  alg 
)

Initialize the hash state structure

Parameters:
state Address of hash state structure.
algorithm Which hash algorithm to use (must be FSL_HASH_ALG_SHA256)
Returns:
FSL_RETURN_OK_S if all went well, otherwise an error code.
Initialize the hash state structure

Parameters:
state Address of hash state structure.
alg Which hash algorithm to use (must be FSL_HASH_ALG_SHA1)
Returns:
FSL_RETURN_OK_S if all went well, otherwise an error code.

Definition at line 206 of file shw_hash.c.

References FSL_HASH_ALG_SHA256, FSL_RETURN_BAD_ALGORITHM_S, FSL_RETURN_OK_S, and sha256_init().

Referenced by shw_hmac_init().

{
      if (alg != FSL_HASH_ALG_SHA256) {
            return FSL_RETURN_BAD_ALGORITHM_S;
      }

      sha256_init(state);

      return FSL_RETURN_OK_S;
}


Generated by  Doxygen 1.6.0   Back to index