1*b077aed3SPierre Pronchery /* 2*b077aed3SPierre Pronchery * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. 3*b077aed3SPierre Pronchery * 4*b077aed3SPierre Pronchery * Licensed under the Apache License 2.0 (the "License"). You may not use 5*b077aed3SPierre Pronchery * this file except in compliance with the License. You can obtain a copy 6*b077aed3SPierre Pronchery * in the file LICENSE in the source distribution or at 7*b077aed3SPierre Pronchery * https://www.openssl.org/source/license.html 8*b077aed3SPierre Pronchery */ 9*b077aed3SPierre Pronchery 10*b077aed3SPierre Pronchery #include <stdlib.h> 11*b077aed3SPierre Pronchery #include <openssl/crypto.h> 12*b077aed3SPierre Pronchery #include "internal/refcount.h" 13*b077aed3SPierre Pronchery #include "prov/provider_util.h" 14*b077aed3SPierre Pronchery 15*b077aed3SPierre Pronchery struct mac_key_st { 16*b077aed3SPierre Pronchery CRYPTO_RWLOCK *lock; 17*b077aed3SPierre Pronchery OSSL_LIB_CTX *libctx; 18*b077aed3SPierre Pronchery CRYPTO_REF_COUNT refcnt; 19*b077aed3SPierre Pronchery unsigned char *priv_key; 20*b077aed3SPierre Pronchery size_t priv_key_len; 21*b077aed3SPierre Pronchery PROV_CIPHER cipher; 22*b077aed3SPierre Pronchery char *properties; 23*b077aed3SPierre Pronchery int cmac; 24*b077aed3SPierre Pronchery }; 25*b077aed3SPierre Pronchery 26*b077aed3SPierre Pronchery typedef struct mac_key_st MAC_KEY; 27*b077aed3SPierre Pronchery 28*b077aed3SPierre Pronchery MAC_KEY *ossl_mac_key_new(OSSL_LIB_CTX *libctx, int cmac); 29*b077aed3SPierre Pronchery void ossl_mac_key_free(MAC_KEY *mackey); 30*b077aed3SPierre Pronchery int ossl_mac_key_up_ref(MAC_KEY *mackey); 31