macsignature.h 840 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright 2020 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. #include <stdlib.h>
  10. #include <openssl/crypto.h>
  11. #include "internal/refcount.h"
  12. #include "prov/provider_util.h"
  13. struct mac_key_st {
  14. CRYPTO_RWLOCK *lock;
  15. OSSL_LIB_CTX *libctx;
  16. CRYPTO_REF_COUNT refcnt;
  17. unsigned char *priv_key;
  18. size_t priv_key_len;
  19. PROV_CIPHER cipher;
  20. char *properties;
  21. int cmac;
  22. };
  23. typedef struct mac_key_st MAC_KEY;
  24. MAC_KEY *ossl_mac_key_new(OSSL_LIB_CTX *libctx, int cmac);
  25. void ossl_mac_key_free(MAC_KEY *mackey);
  26. int ossl_mac_key_up_ref(MAC_KEY *mackey);