56 cx_ripemd160_t hash_ctx;
57 } cx_hmac_ripemd160_t;
77 WARN_UNUSED_RESULT cx_err_t cx_hmac_ripemd160_init_no_throw(cx_hmac_ripemd160_t *hmac,
85 DEPRECATED
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;
124 WARN_UNUSED_RESULT cx_err_t cx_hmac_sha224_init(cx_hmac_sha256_t *hmac,
126 unsigned int key_len);
149 WARN_UNUSED_RESULT cx_err_t cx_hmac_sha256_init_no_throw(cx_hmac_sha256_t *hmac,
157 DEPRECATED
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));
184 size_t cx_hmac_sha256(
const uint8_t *key,
193 #if defined(HAVE_SHA384) || defined(HAVE_SHA512)
199 cx_sha512_t hash_ctx;
223 WARN_UNUSED_RESULT cx_err_t cx_hmac_sha384_init(cx_hmac_sha512_t *hmac,
225 unsigned int key_len);
248 WARN_UNUSED_RESULT cx_err_t cx_hmac_sha512_init_no_throw(cx_hmac_sha512_t *hmac,
256 DEPRECATED
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));
283 size_t cx_hmac_sha512(
const uint8_t *key,
323 WARN_UNUSED_RESULT cx_err_t cx_hmac_no_throw(cx_hmac_t *hmac,
334 DEPRECATED
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;
360 #ifdef HAVE_RIPEMD160
362 return CX_RIPEMD160_SIZE;
390 WARN_UNUSED_RESULT cx_err_t cx_hmac_init(cx_hmac_t *hmac,
412 WARN_UNUSED_RESULT cx_err_t cx_hmac_update(cx_hmac_t *hmac,
const uint8_t *in,
size_t in_len);
429 WARN_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)