summaryrefslogtreecommitdiff
path: root/include/openssl/hmac.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/openssl/hmac.h')
-rw-r--r--include/openssl/hmac.h47
1 files changed, 23 insertions, 24 deletions
diff --git a/include/openssl/hmac.h b/include/openssl/hmac.h
index 5f14a85baa..cbfae0ac9a 100644
--- a/include/openssl/hmac.h
+++ b/include/openssl/hmac.h
@@ -56,49 +56,48 @@
* [including the GNU Public Licence.]
*/
#ifndef HEADER_HMAC_H
-#define HEADER_HMAC_H
+# define HEADER_HMAC_H
-#include <openssl/opensslconf.h>
+# include <openssl/opensslconf.h>
-#ifdef OPENSSL_NO_HMAC
-#error HMAC is disabled.
-#endif
+# ifdef OPENSSL_NO_HMAC
+# error HMAC is disabled.
+# endif
-#include <openssl/evp.h>
+# include <openssl/evp.h>
-#define HMAC_MAX_MD_CBLOCK 128 /* largest known is SHA512 */
+# define HMAC_MAX_MD_CBLOCK 128/* largest known is SHA512 */
#ifdef __cplusplus
extern "C" {
#endif
-typedef struct hmac_ctx_st
- {
- const EVP_MD *md;
- EVP_MD_CTX md_ctx;
- EVP_MD_CTX i_ctx;
- EVP_MD_CTX o_ctx;
- unsigned int key_length;
- unsigned char key[HMAC_MAX_MD_CBLOCK];
- } HMAC_CTX;
-
-#define HMAC_size(e) (EVP_MD_size((e)->md))
+typedef struct hmac_ctx_st {
+ const EVP_MD *md;
+ EVP_MD_CTX md_ctx;
+ EVP_MD_CTX i_ctx;
+ EVP_MD_CTX o_ctx;
+ unsigned int key_length;
+ unsigned char key[HMAC_MAX_MD_CBLOCK];
+} HMAC_CTX;
+# define HMAC_size(e) (EVP_MD_size((e)->md))
void HMAC_CTX_init(HMAC_CTX *ctx);
void HMAC_CTX_cleanup(HMAC_CTX *ctx);
-#define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */
+/* deprecated */
+# define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx)
-int HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
- const EVP_MD *md); /* deprecated */
+/* deprecated */
+int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md);
int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
- const EVP_MD *md, ENGINE *impl);
+ 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);
+ 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);