summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/hmac/hmac.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/hmac/hmac.h')
-rw-r--r--src/lib/libcrypto/hmac/hmac.h28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/lib/libcrypto/hmac/hmac.h b/src/lib/libcrypto/hmac/hmac.h
index e6b43f52c4..f928975fcd 100644
--- a/src/lib/libcrypto/hmac/hmac.h
+++ b/src/lib/libcrypto/hmac/hmac.h
@@ -62,13 +62,17 @@
62extern "C" { 62extern "C" {
63#endif 63#endif
64 64
65#include "evp.h" 65#ifdef NO_HMAC
66#error HMAC is disabled.
67#endif
68
69#include <openssl/evp.h>
66 70
67#define HMAC_MAX_MD_CBLOCK 64 71#define HMAC_MAX_MD_CBLOCK 64
68 72
69typedef struct hmac_ctx_st 73typedef struct hmac_ctx_st
70 { 74 {
71 EVP_MD *md; 75 const EVP_MD *md;
72 EVP_MD_CTX md_ctx; 76 EVP_MD_CTX md_ctx;
73 EVP_MD_CTX i_ctx; 77 EVP_MD_CTX i_ctx;
74 EVP_MD_CTX o_ctx; 78 EVP_MD_CTX o_ctx;
@@ -78,26 +82,16 @@ typedef struct hmac_ctx_st
78 82
79#define HMAC_size(e) (EVP_MD_size((e)->md)) 83#define HMAC_size(e) (EVP_MD_size((e)->md))
80 84
81#ifndef NOPROTO
82 85
83void HMAC_Init(HMAC_CTX *ctx, unsigned char *key, int len, 86void HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
84 EVP_MD *md); 87 const EVP_MD *md);
85void HMAC_Update(HMAC_CTX *ctx,unsigned char *key, int len); 88void HMAC_Update(HMAC_CTX *ctx,unsigned char *key, int len);
86void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); 89void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
87void HMAC_cleanup(HMAC_CTX *ctx); 90void HMAC_cleanup(HMAC_CTX *ctx);
88unsigned char *HMAC(EVP_MD *evp_md, unsigned char *key, int key_len, 91unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
89 unsigned char *d, int n, unsigned char *md, unsigned int *md_len); 92 unsigned char *d, int n, unsigned char *md,
90 93 unsigned int *md_len);
91 94
92#else
93
94void HMAC_Init();
95void HMAC_Update();
96void HMAC_Final();
97void HMAC_cleanup();
98unsigned char *HMAC();
99
100#endif
101 95
102#ifdef __cplusplus 96#ifdef __cplusplus
103} 97}