59 # define HEADER_HMAC_H
61 # include <openssl/opensslconf.h>
63 # ifdef OPENSSL_NO_HMAC
64 # error HMAC is disabled.
67 # include <openssl/evp.h>
69 # define HMAC_MAX_MD_CBLOCK 128
75 typedef struct hmac_ctx_st {
80 unsigned int key_length;
81 unsigned char key[HMAC_MAX_MD_CBLOCK];
84 # define HMAC_size(e) (EVP_MD_size((e)->md))
86 void HMAC_CTX_init(HMAC_CTX *ctx);
87 void HMAC_CTX_cleanup(HMAC_CTX *ctx);
90 # define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx)
93 int HMAC_Init(HMAC_CTX *ctx,
const void *key,
int len,
const EVP_MD *md);
94 int HMAC_Init_ex(HMAC_CTX *ctx,
const void *key,
int len,
95 const EVP_MD *md, ENGINE *impl);
96 int HMAC_Update(HMAC_CTX *ctx,
const unsigned char *data,
size_t len);
97 int HMAC_Final(HMAC_CTX *ctx,
unsigned char *md,
unsigned int *len);
98 unsigned char *HMAC(
const EVP_MD *evp_md,
const void *key,
int key_len,
99 const unsigned char *d,
size_t n,
unsigned char *md,
100 unsigned int *md_len);
101 int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
103 void HMAC_CTX_set_flags(HMAC_CTX *ctx,
unsigned long flags);