19 #ifndef CX_RNG_RFC6979_H
20 #define CX_RNG_RFC6979_H
22 #ifdef HAVE_RNG_RFC6979
29 #define CX_RFC6979_BUFFER_LENGTH 64
30 #define CX_RFC6979_MAX_RLEN 66
33 uint8_t v[CX_RFC6979_BUFFER_LENGTH + 1];
34 uint8_t k[CX_RFC6979_BUFFER_LENGTH];
38 uint8_t tmp[CX_RFC6979_MAX_RLEN];
43 #if (!defined(HAVE_SHA512) && !defined(HAVE_SHA384) && !defined(HAVE_SHA256) \
44 && !defined(HAVE_SHA224)) \
45 || !defined(HAVE_HMAC)
46 #error No hmac defined for rfc6979 support
51 #if defined(HAVE_SHA512) || defined(HAVE_SHA384)
52 cx_hmac_sha512_t hmac_sha512;
55 #if defined(HAVE_SHA256) || defined(HAVE_SHA224)
56 cx_hmac_sha256_t hmac_sha256;
59 } cx_rnd_rfc6979_ctx_t;
61 WARN_UNUSED_RESULT cx_err_t cx_rng_rfc6979_init(
62 cx_rnd_rfc6979_ctx_t *rfc_ctx,
72 WARN_UNUSED_RESULT cx_err_t cx_rng_rfc6979_next(cx_rnd_rfc6979_ctx_t *rfc_ctx,
Include cryptography files.