1 #ifndef CCAN_CRYPTO_HMAC_SHA256_H
2 #define CCAN_CRYPTO_HMAC_SHA256_H
3 /* BSD-MIT - see LICENSE file for details */
7 #include <ccan/crypto/sha256/sha256.h>
9 /* Uncomment this to use openssl's HMAC routines (and link with -lcrypto) */
10 /*#define CCAN_CRYPTO_HMAC_USE_OPENSSL 1*/
12 #ifdef CCAN_CRYPTO_HMAC_USE_OPENSSL
13 #include <openssl/hmac.h>
17 * struct hmac_sha256 - structure representing a completed HMAC.
24 * hmac_sha256 - return hmac of an object with a key.
25 * @hmac: the hmac to fill in
26 * @k: pointer to the key,
27 * @ksize: the number of bytes pointed to by @k
28 * @d: pointer to memory,
29 * @dsize: the number of bytes pointed to by @d
31 void hmac_sha256(struct hmac_sha256 *hmac,
32 const void *k, size_t ksize,
33 const void *d, size_t dsize);
34 #endif /* CCAN_CRYPTO_HMAC_SHA256_H */