hmac.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #ifndef HEADER_HMAC_H
  10. # define HEADER_HMAC_H
  11. # include <openssl/opensslconf.h>
  12. # include <openssl/evp.h>
  13. # if !OPENSSL_API_3
  14. # define HMAC_MAX_MD_CBLOCK 128 /* Deprecated */
  15. # endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. size_t HMAC_size(const HMAC_CTX *e);
  20. HMAC_CTX *HMAC_CTX_new(void);
  21. int HMAC_CTX_reset(HMAC_CTX *ctx);
  22. void HMAC_CTX_free(HMAC_CTX *ctx);
  23. DEPRECATEDIN_1_1_0(__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
  24. const EVP_MD *md))
  25. /*__owur*/ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
  26. const EVP_MD *md, ENGINE *impl);
  27. /*__owur*/ int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
  28. size_t len);
  29. /*__owur*/ int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
  30. unsigned int *len);
  31. unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
  32. const unsigned char *d, size_t n, unsigned char *md,
  33. unsigned int *md_len);
  34. __owur int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
  35. void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
  36. const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx);
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif