Path: blob/master/libs/tomcrypt/src/mac/hmac/hmac_process.c
5972 views
/* LibTomCrypt, modular cryptographic library -- Tom St Denis1*2* LibTomCrypt is a library that provides various cryptographic3* algorithms in a highly modular and flexible manner.4*5* The library is free for all purposes without any express6* guarantee it works.7*/8#include "tomcrypt.h"910/**11@file hmac_process.c12HMAC support, process data, Tom St Denis/Dobes Vandermeer13*/1415#ifdef LTC_HMAC1617/**18Process data through HMAC19@param hmac The hmac state20@param in The data to send through HMAC21@param inlen The length of the data to HMAC (octets)22@return CRYPT_OK if successful23*/24int hmac_process(hmac_state *hmac, const unsigned char *in, unsigned long inlen)25{26int err;27LTC_ARGCHK(hmac != NULL);28LTC_ARGCHK(in != NULL);29if ((err = hash_is_valid(hmac->hash)) != CRYPT_OK) {30return err;31}32return hash_descriptor[hmac->hash].process(&hmac->md, in, inlen);33}3435#endif363738