56 cx_ripemd160_t hash_ctx;
77WARN_UNUSED_RESULT cx_err_t cx_hmac_ripemd160_init_no_throw(cx_hmac_ripemd160_t *hmac,
85DEPRECATED
static inline int cx_hmac_ripemd160_init(cx_hmac_ripemd160_t *hmac,
86 const unsigned char *key,
89 CX_THROW(cx_hmac_ripemd160_init_no_throw(hmac, key, key_len));
94#if defined(HAVE_SHA224) || defined(HAVE_SHA256)
100 cx_sha256_t hash_ctx;
124WARN_UNUSED_RESULT cx_err_t cx_hmac_sha224_init(cx_hmac_sha256_t *hmac,
126 unsigned int key_len);
149WARN_UNUSED_RESULT cx_err_t cx_hmac_sha256_init_no_throw(cx_hmac_sha256_t *hmac,
157DEPRECATED
static inline int cx_hmac_sha256_init(cx_hmac_sha256_t *hmac,
158 const unsigned char *key,
159 unsigned int key_len)
161 CX_THROW(cx_hmac_sha256_init_no_throw(hmac, key, key_len));
184size_t cx_hmac_sha256(
const uint8_t *key,
193#if defined(HAVE_SHA384) || defined(HAVE_SHA512)
199 cx_sha512_t hash_ctx;
223WARN_UNUSED_RESULT cx_err_t cx_hmac_sha384_init(cx_hmac_sha512_t *hmac,
225 unsigned int key_len);
248WARN_UNUSED_RESULT cx_err_t cx_hmac_sha512_init_no_throw(cx_hmac_sha512_t *hmac,
256DEPRECATED
static inline int cx_hmac_sha512_init(cx_hmac_sha512_t *hmac,
257 const unsigned char *key,
258 unsigned int key_len)
260 CX_THROW(cx_hmac_sha512_init_no_throw(hmac, key, key_len));
283size_t cx_hmac_sha512(
const uint8_t *key,
323WARN_UNUSED_RESULT cx_err_t cx_hmac_no_throw(cx_hmac_t *hmac,
334DEPRECATED
static inline int cx_hmac(cx_hmac_t *hmac,
336 const unsigned char *in,
339 unsigned int mac_len)
341 CX_THROW(cx_hmac_no_throw(hmac, mode, in, len, mac, mac_len));
343 switch (hmac->hash_ctx.info->md_type) {
346 return CX_SHA224_SIZE;
350 return CX_SHA256_SIZE;
354 return CX_SHA384_SIZE;
358 return CX_SHA512_SIZE;
362 return CX_RIPEMD160_SIZE;
390WARN_UNUSED_RESULT cx_err_t cx_hmac_init(cx_hmac_t *hmac,
412WARN_UNUSED_RESULT cx_err_t cx_hmac_update(cx_hmac_t *hmac,
const uint8_t *in,
size_t in_len);
429WARN_UNUSED_RESULT cx_err_t cx_hmac_final(cx_hmac_t *ctx,
uint8_t *out,
size_t *out_len);
RIPEMD-160 hash function.
SHA-2 (Secure Hash Algorithm 2)
SHA-2 (Secure Hash Algorithm 2)