switch (EVP_PKEY_base_id(pk)) {
case NID_id_GostR3410_2001:
+ case NID_id_GostR3410_2001DH:
case NID_id_GostR3410_2012_256:
return 256;
case NID_id_GostR3410_2012_512:
}
break;
case NID_id_GostR3410_2001:
+ case NID_id_GostR3410_2001DH:
pkey_param_nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(key_ptr));
gkp->hash_params = OBJ_nid2obj(NID_id_GostR3411_94_CryptoProParamSet);
break;
case NID_id_GostR3410_2012_256:
case NID_id_GostR3410_2012_512:
case NID_id_GostR3410_2001:
+ case NID_id_GostR3410_2001DH:
if (!key_ptr) {
key_ptr = EC_KEY_new();
if (!EVP_PKEY_assign(pkey, pkey_nid, key_ptr)) {
case NID_id_GostR3410_2012_512:
case NID_id_GostR3410_2012_256:
case NID_id_GostR3410_2001:
+ case NID_id_GostR3410_2001DH:
{
EC_KEY *ec = EVP_PKEY_get0(pkey);
if (!ec) {
case NID_id_GostR3410_2012_512:
case NID_id_GostR3410_2012_256:
case NID_id_GostR3410_2001:
+ case NID_id_GostR3410_2001DH:
{
EC_KEY *ec = EVP_PKEY_get0((EVP_PKEY *)pkey);
if (ec)
md_nid = NID_id_GostR3411_2012_256;
break;
case NID_id_GostR3410_2001:
+ case NID_id_GostR3410_2001DH:
case NID_id_GostR3410_94:
md_nid = NID_id_GostR3411_94;
break;
switch (EVP_PKEY_base_id(pk)) {
case NID_id_GostR3410_94:
case NID_id_GostR3410_2001:
+ case NID_id_GostR3410_2001DH:
case NID_id_GostR3410_2012_256:
return 64;
case NID_id_GostR3410_2012_512:
return 0;
switch (nid) {
case NID_id_GostR3410_2001:
+ case NID_id_GostR3410_2001DH:
EVP_PKEY_asn1_set_free(*ameth, pkey_free_gost_ec);
EVP_PKEY_asn1_set_private(*ameth,
priv_decode_gost, priv_encode_gost,
EVP_PKEY *pubk = EVP_PKEY_CTX_get0_pkey(pctx);
struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(pctx);
int pkey_nid = EVP_PKEY_base_id(pubk);
- ASN1_OBJECT *crypt_params_obj = (pkey_nid == NID_id_GostR3410_2001) ?
+ ASN1_OBJECT *crypt_params_obj = (pkey_nid == NID_id_GostR3410_2001 || pkey_nid == NID_id_GostR3410_2001DH) ?
OBJ_nid2obj(NID_id_Gost28147_89_CryptoPro_A_ParamSet) :
OBJ_nid2obj(NID_id_tc26_gost_28147_param_Z);
const struct gost_cipher_info *param =
const int** nids, int nid);
static EVP_PKEY_METHOD* pmeth_GostR3410_2001 = NULL,
+ * pmeth_GostR3410_2001DH = NULL,
* pmeth_GostR3410_2012_256 = NULL,
* pmeth_GostR3410_2012_512 = NULL,
* pmeth_Gost28147_MAC = NULL, * pmeth_Gost28147_MAC_12 = NULL,
* pmeth_magma_mac_acpkm = NULL, * pmeth_grasshopper_mac_acpkm = NULL;
static EVP_PKEY_ASN1_METHOD* ameth_GostR3410_2001 = NULL,
+ * ameth_GostR3410_2001DH = NULL,
* ameth_GostR3410_2012_256 = NULL,
* ameth_GostR3410_2012_512 = NULL,
* ameth_Gost28147_MAC = NULL, * ameth_Gost28147_MAC_12 = NULL,
"GOST2001",
"GOST R 34.10-2001",
},
+ {
+ NID_id_GostR3410_2001DH,
+ &pmeth_GostR3410_2001DH,
+ &ameth_GostR3410_2001DH,
+ "GOST2001 DH",
+ "GOST R 34.10-2001 DH",
+ },
{
NID_id_Gost28147_89_MAC,
&pmeth_Gost28147_MAC,
if (pkey && EVP_PKEY_get0(pkey)) {
switch (EVP_PKEY_base_id(pkey)) {
case NID_id_GostR3410_2001:
+ case NID_id_GostR3410_2001DH:
case NID_id_GostR3410_2012_256:
case NID_id_GostR3410_2012_512:
{
switch (EVP_MD_type((const EVP_MD *)p2)) {
case NID_id_GostR3411_94:
if (pkey_nid == NID_id_GostR3410_2001
+ || pkey_nid == NID_id_GostR3410_2001DH
|| pkey_nid == NID_id_GostR3410_94) {
pctx->md = (EVP_MD *)p2;
return 1;
switch (EVP_PKEY_base_id(pkey)) {
case NID_id_GostR3410_2001:
+ case NID_id_GostR3410_2001DH:
case NID_id_GostR3410_2012_256:
order = 64;
break;
switch (id) {
case NID_id_GostR3410_2001:
+ case NID_id_GostR3410_2001DH:
EVP_PKEY_meth_set_ctrl(*pmeth,
pkey_gost_ctrl, pkey_gost_ec_ctrl_str_256);
EVP_PKEY_meth_set_sign(*pmeth, NULL, pkey_gost_ec_cp_sign);