|| !EVP_MD_meth_set_input_blocksize(md, 8)
|| !EVP_MD_meth_set_app_datasize(md,
sizeof(struct ossl_gost_imit_ctx))
- || !EVP_MD_meth_set_flags(md, 0)
+ || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_XOF)
|| !EVP_MD_meth_set_init(md, gost_imit_init_cpa)
|| !EVP_MD_meth_set_update(md, gost_imit_update)
|| !EVP_MD_meth_set_final(md, gost_imit_final)
|| !EVP_MD_meth_set_input_blocksize(md, 8)
|| !EVP_MD_meth_set_app_datasize(md,
sizeof(struct ossl_gost_imit_ctx))
- || !EVP_MD_meth_set_flags(md, 0)
+ || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_XOF)
|| !EVP_MD_meth_set_init(md, gost_imit_init_cp_12)
|| !EVP_MD_meth_set_update(md, gost_imit_update)
|| !EVP_MD_meth_set_final(md, gost_imit_final)
GOSTerr(GOST_F_GOST_IMIT_CTRL, GOST_R_INVALID_MAC_KEY_SIZE);
return 0;
}
- case EVP_MD_CTRL_MAC_LEN:
+ case EVP_MD_CTRL_XOF_LEN:
{
struct ossl_gost_imit_ctx *c = EVP_MD_CTX_md_data(ctx);
if (arg < 1 || arg > 8) {
if (EVP_DigestInit_ex(mac, EVP_get_digestbynid(mac_nid), NULL) <= 0
|| omac_imit_ctrl(mac, EVP_MD_CTRL_SET_KEY, 32, mac_key) <= 0
- || omac_imit_ctrl(mac, EVP_MD_CTRL_MAC_LEN, mac_len, NULL) <= 0
+ || omac_imit_ctrl(mac, EVP_MD_CTRL_XOF_LEN, mac_len, NULL) <= 0
|| EVP_DigestUpdate(mac, iv, ivlen) <= 0
|| EVP_DigestUpdate(mac, shared_key, shared_len) <= 0
/* As we set MAC length directly, we should not allow overwriting it */
- || EVP_DigestFinal_ex(mac, mac_buf, NULL) <= 0) {
+ || EVP_DigestFinalXOF(mac, mac_buf, mac_len) <= 0) {
GOSTerr(GOST_F_GOST_KEXP15, ERR_R_INTERNAL_ERROR);
goto err;
}
if (EVP_DigestInit_ex(mac, EVP_get_digestbynid(mac_nid), NULL) <= 0
|| omac_imit_ctrl(mac, EVP_MD_CTRL_SET_KEY, 32, mac_key) <= 0
- || omac_imit_ctrl(mac, EVP_MD_CTRL_MAC_LEN, mac_len, NULL) <= 0
+ || omac_imit_ctrl(mac, EVP_MD_CTRL_XOF_LEN, mac_len, NULL) <= 0
|| EVP_DigestUpdate(mac, iv, ivlen) <= 0
|| EVP_DigestUpdate(mac, out, shared_len) <= 0
/* As we set MAC length directly, we should not allow overwriting it */
- || EVP_DigestFinal_ex(mac, mac_buf, NULL) <= 0) {
+ || EVP_DigestFinalXOF(mac, mac_buf, mac_len) <= 0) {
GOSTerr(GOST_F_GOST_KIMP15, ERR_R_INTERNAL_ERROR);
goto err;
}
# define EVP_MD_CTRL_KEY_LEN (EVP_MD_CTRL_ALG_CTRL+3)
# define EVP_MD_CTRL_SET_KEY (EVP_MD_CTRL_ALG_CTRL+4)
-# define EVP_MD_CTRL_MAC_LEN (EVP_MD_CTRL_ALG_CTRL+5)
/* EVP_PKEY_METHOD key encryption callbacks */
/* From gost_ec_keyx.c */
int pkey_gost_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out,
GOSTerr(GOST_F_OMAC_IMIT_CTRL, GOST_R_INVALID_MAC_KEY_SIZE);
return 0;
}
- case EVP_MD_CTRL_MAC_LEN:
case EVP_MD_CTRL_XOF_LEN: /* Supported in OpenSSL */
{
OMAC_CTX *c = EVP_MD_CTX_md_data(ctx);
}
return 1;
}
- case EVP_MD_CTRL_MAC_LEN:
case EVP_MD_CTRL_XOF_LEN: /* Supported in OpenSSL */
{
OMAC_ACPKM_CTX *c = EVP_MD_CTX_md_data(ctx);
}
EVP_MD_meth_get_ctrl(EVP_MD_CTX_md(mctx))
- (mctx, EVP_MD_CTRL_MAC_LEN, data->mac_size, NULL);
+ (mctx, EVP_MD_CTRL_XOF_LEN, data->mac_size, NULL);
ret = EVP_DigestFinal_ex(mctx, sig, &tmpsiglen);
*siglen = data->mac_size;
return ret;