X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcrypto%2Fhmac_sha256%2Fhmac_sha256.h;fp=ccan%2Fcrypto%2Fhmac_sha256%2Fhmac_sha256.h;h=2ddcbe32619a8248a7150f0eb930aa3e20a38c7d;hb=d32033ada4a4e5821baef20958ae6de0b54622b2;hp=0000000000000000000000000000000000000000;hpb=346058c002415e57c6ed36efcfacb6813150aaa7;p=ccan diff --git a/ccan/crypto/hmac_sha256/hmac_sha256.h b/ccan/crypto/hmac_sha256/hmac_sha256.h new file mode 100644 index 00000000..2ddcbe32 --- /dev/null +++ b/ccan/crypto/hmac_sha256/hmac_sha256.h @@ -0,0 +1,34 @@ +#ifndef CCAN_CRYPTO_HMAC_SHA256_H +#define CCAN_CRYPTO_HMAC_SHA256_H +/* BSD-MIT - see LICENSE file for details */ +#include "config.h" +#include +#include +#include + +/* Uncomment this to use openssl's HMAC routines (and link with -lcrypto) */ +/*#define CCAN_CRYPTO_HMAC_USE_OPENSSL 1*/ + +#ifdef CCAN_CRYPTO_HMAC_USE_OPENSSL +#include +#endif + +/** + * struct hmac_sha256 - structure representing a completed HMAC. + */ +struct hmac_sha256 { + struct sha256 sha; +}; + +/** + * hmac_sha256 - return hmac of an object with a key. + * @hmac: the hmac to fill in + * @k: pointer to the key, + * @ksize: the number of bytes pointed to by @k + * @d: pointer to memory, + * @dsize: the number of bytes pointed to by @d + */ +void hmac_sha256(struct hmac_sha256 *hmac, + const void *k, size_t ksize, + const void *d, size_t dsize); +#endif /* CCAN_CRYPTO_HMAC_SHA256_H */