X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fhmac%2Fhmac.h;h=1be00221908d1211572b54950730b35947fd49dd;hb=1f59eb5f111149eb0cf5cdc2b378cfa0fbdfa9c3;hp=91b2f8d663f7e122395eb875cd80ba39b1600e36;hpb=f5d7a031a3c3e7b1700a67d6dc19daf3718ce6ee;p=oweals%2Fopenssl.git diff --git a/crypto/hmac/hmac.h b/crypto/hmac/hmac.h index 91b2f8d663..1be0022190 100644 --- a/crypto/hmac/hmac.h +++ b/crypto/hmac/hmac.h @@ -58,17 +58,19 @@ #ifndef HEADER_HMAC_H #define HEADER_HMAC_H -#ifdef __cplusplus -extern "C" { -#endif +#include -#ifdef NO_HMAC -#error No HMAC support. +#ifdef OPENSSL_NO_HMAC +#error HMAC is disabled. #endif #include -#define HMAC_MAX_MD_CBLOCK 64 +#define HMAC_MAX_MD_CBLOCK 128 /* largest known is SHA512 */ + +#ifdef __cplusplus +extern "C" { +#endif typedef struct hmac_ctx_st { @@ -83,14 +85,23 @@ typedef struct hmac_ctx_st #define HMAC_size(e) (EVP_MD_size((e)->md)) -void HMAC_Init(HMAC_CTX *ctx, const unsigned char *key, int len, - const EVP_MD *md); -void HMAC_Update(HMAC_CTX *ctx,unsigned char *key, int len); -void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); -void HMAC_cleanup(HMAC_CTX *ctx); -unsigned char *HMAC(EVP_MD *evp_md, unsigned char *key, int key_len, - unsigned char *d, int n, unsigned char *md, unsigned int *md_len); +void HMAC_CTX_init(HMAC_CTX *ctx); +void HMAC_CTX_cleanup(HMAC_CTX *ctx); + +#define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */ + +int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, + const EVP_MD *md); /* deprecated */ +int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, + const EVP_MD *md, ENGINE *impl); +int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); +int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); +unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, + const unsigned char *d, size_t n, unsigned char *md, + unsigned int *md_len); +int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); +void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); #ifdef __cplusplus }