Home
last modified time | relevance | path

Searched refs:macctx (Results 1 – 8 of 8) sorted by relevance

/freebsd/crypto/openssl/providers/implementations/macs/
H A Dhmac_prov.c75 struct hmac_data_st *macctx; in hmac_new() local
80 if ((macctx = OPENSSL_zalloc(sizeof(*macctx))) == NULL in hmac_new()
81 || (macctx->ctx = HMAC_CTX_new()) == NULL) { in hmac_new()
82 OPENSSL_free(macctx); in hmac_new()
85 macctx->provctx = provctx; in hmac_new()
87 return macctx; in hmac_new()
92 struct hmac_data_st *macctx = vmacctx; in hmac_free() local
94 if (macctx != NULL) { in hmac_free()
95 HMAC_CTX_free(macctx->ctx); in hmac_free()
96 ossl_prov_digest_reset(&macctx->digest); in hmac_free()
[all …]
H A Dblake2_mac_impl.c44 struct blake2_mac_data_st *macctx; in blake2_mac_new() local
49 macctx = OPENSSL_zalloc(sizeof(*macctx)); in blake2_mac_new()
50 if (macctx != NULL) { in blake2_mac_new()
51 BLAKE2_PARAM_INIT(&macctx->params); in blake2_mac_new()
54 return macctx; in blake2_mac_new()
75 struct blake2_mac_data_st *macctx = vmacctx; in blake2_mac_free() local
77 if (macctx != NULL) { in blake2_mac_free()
78 OPENSSL_cleanse(macctx->key, sizeof(macctx->key)); in blake2_mac_free()
79 OPENSSL_free(macctx); in blake2_mac_free()
85 struct blake2_mac_data_st *macctx = vmacctx; in blake2_mac_size() local
[all …]
H A Dcmac_prov.c53 struct cmac_data_st *macctx; in cmac_new() local
58 if ((macctx = OPENSSL_zalloc(sizeof(*macctx))) == NULL in cmac_new()
59 || (macctx->ctx = CMAC_CTX_new()) == NULL) { in cmac_new()
60 OPENSSL_free(macctx); in cmac_new()
61 macctx = NULL; in cmac_new()
63 macctx->provctx = provctx; in cmac_new()
66 return macctx; in cmac_new()
71 struct cmac_data_st *macctx = vmacctx; in cmac_free() local
73 if (macctx != NULL) { in cmac_free()
74 CMAC_CTX_free(macctx->ctx); in cmac_free()
[all …]
H A Dgmac_prov.c49 struct gmac_data_st *macctx = vmacctx; in gmac_free() local
51 if (macctx != NULL) { in gmac_free()
52 EVP_CIPHER_CTX_free(macctx->ctx); in gmac_free()
53 ossl_prov_cipher_reset(&macctx->cipher); in gmac_free()
54 OPENSSL_free(macctx); in gmac_free()
60 struct gmac_data_st *macctx; in gmac_new() local
65 if ((macctx = OPENSSL_zalloc(sizeof(*macctx))) == NULL in gmac_new()
66 || (macctx->ctx = EVP_CIPHER_CTX_new()) == NULL) { in gmac_new()
67 gmac_free(macctx); in gmac_new()
70 macctx->provctx = provctx; in gmac_new()
[all …]
/freebsd/crypto/openssl/providers/implementations/signature/
H A Dmac_legacy_sig.c47 EVP_MAC_CTX *macctx; member
72 pmacctx->macctx = EVP_MAC_CTX_new(mac); in mac_newctx()
73 if (pmacctx->macctx == NULL) in mac_newctx()
127 if (!ossl_prov_set_macctx(pmacctx->macctx, NULL, in mac_digest_sign_init()
135 if (!EVP_MAC_init(pmacctx->macctx, pmacctx->key->priv_key, in mac_digest_sign_init()
147 if (pmacctx == NULL || pmacctx->macctx == NULL) in mac_digest_sign_update()
150 return EVP_MAC_update(pmacctx->macctx, data, datalen); in mac_digest_sign_update()
158 if (!ossl_prov_is_running() || pmacctx == NULL || pmacctx->macctx == NULL) in mac_digest_sign_final()
161 return EVP_MAC_final(pmacctx->macctx, mac, maclen, macsize); in mac_digest_sign_final()
169 EVP_MAC_CTX_free(ctx->macctx); in mac_freectx()
[all …]
/freebsd/crypto/openssl/providers/common/
H A Dprovider_util.c224 int ossl_prov_set_macctx(EVP_MAC_CTX *macctx, in ossl_prov_set_macctx() argument
286 return EVP_MAC_CTX_set_params(macctx, mac_params); in ossl_prov_set_macctx()
290 int ossl_prov_macctx_load_from_params(EVP_MAC_CTX **macctx, in ossl_prov_macctx_load_from_params() argument
317 EVP_MAC_CTX_free(*macctx); in ossl_prov_macctx_load_from_params()
318 *macctx = mac == NULL ? NULL : EVP_MAC_CTX_new(mac); in ossl_prov_macctx_load_from_params()
321 if (*macctx == NULL) in ossl_prov_macctx_load_from_params()
329 if (*macctx == NULL) in ossl_prov_macctx_load_from_params()
332 if (ossl_prov_set_macctx(*macctx, params, ciphername, mdname, NULL, in ossl_prov_macctx_load_from_params()
336 EVP_MAC_CTX_free(*macctx); in ossl_prov_macctx_load_from_params()
337 *macctx = NULL; in ossl_prov_macctx_load_from_params()
/freebsd/crypto/openssl/providers/implementations/kdfs/
H A Dsskdf.c56 EVP_MAC_CTX *macctx; /* H(x) = HMAC_hash OR H(x) = KMAC */ member
304 EVP_MAC_CTX_free(ctx->macctx); in sskdf_reset()
364 if (ctx->macctx != NULL) { in sskdf_derive()
370 EVP_MAC *mac = EVP_MAC_CTX_get0_mac(ctx->macctx); in sskdf_derive()
402 ret = SSKDF_mac_kdm(ctx->macctx, in sskdf_derive()
433 if (ctx->macctx != NULL) { in x963kdf_derive()
459 if (!ossl_prov_macctx_load_from_params(&ctx->macctx, params, in sskdf_set_ctx_params()
462 if (ctx->macctx != NULL) { in sskdf_set_ctx_params()
463 if (EVP_MAC_is_a(EVP_MAC_CTX_get0_mac(ctx->macctx), in sskdf_set_ctx_params()
465 || EVP_MAC_is_a(EVP_MAC_CTX_get0_mac(ctx->macctx), in sskdf_set_ctx_params()
/freebsd/crypto/openssl/providers/common/include/prov/
H A Dprovider_util.h95 int ossl_prov_set_macctx(EVP_MAC_CTX *macctx,
121 int ossl_prov_macctx_load_from_params(EVP_MAC_CTX **macctx,