+GOST_cipher *gost_cipher_array[] = {
+ &Gost28147_89_cipher,
+ &Gost28147_89_cnt_cipher,
+ &Gost28147_89_cnt_12_cipher,
+ &Gost28147_89_cbc_cipher,
+ &grasshopper_ecb_cipher,
+ &grasshopper_cbc_cipher,
+ &grasshopper_cfb_cipher,
+ &grasshopper_ofb_cipher,
+ &grasshopper_ctr_cipher,
+ &magma_cbc_cipher,
+ &magma_ctr_cipher,
+ &magma_ctr_acpkm_cipher,
+ &magma_ctr_acpkm_omac_cipher,
+ &grasshopper_ctr_acpkm_cipher,
+ &grasshopper_ctr_acpkm_omac_cipher,
+ &magma_kexp15_cipher,
+ &kuznyechik_kexp15_cipher,
+};
+
+static struct gost_meth_minfo {
+ int nid;
+ EVP_PKEY_METHOD **pmeth;
+ EVP_PKEY_ASN1_METHOD **ameth;
+ const char *pemstr;
+ const char *info;
+} gost_meth_array[] = {
+ {
+ NID_id_GostR3410_2001,
+ &pmeth_GostR3410_2001,
+ &ameth_GostR3410_2001,
+ "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,
+ &ameth_Gost28147_MAC,
+ "GOST-MAC",
+ "GOST 28147-89 MAC",
+ },
+ {
+ NID_id_GostR3410_2012_256,
+ &pmeth_GostR3410_2012_256,
+ &ameth_GostR3410_2012_256,
+ "GOST2012_256",
+ "GOST R 34.10-2012 with 256 bit key",
+ },
+ {
+ NID_id_GostR3410_2012_512,
+ &pmeth_GostR3410_2012_512,
+ &ameth_GostR3410_2012_512,
+ "GOST2012_512",
+ "GOST R 34.10-2012 with 512 bit key",
+ },
+ {
+ NID_gost_mac_12,
+ &pmeth_Gost28147_MAC_12,
+ &ameth_Gost28147_MAC_12,
+ "GOST-MAC-12",
+ "GOST 28147-89 MAC with 2012 params",
+ },
+ {
+ NID_magma_mac,
+ &pmeth_magma_mac,
+ &ameth_magma_mac,
+ "MAGMA-MAC",
+ "GOST R 34.13-2015 Magma MAC",
+ },
+ {
+ NID_grasshopper_mac,
+ &pmeth_grasshopper_mac,
+ &ameth_grasshopper_mac,
+ "KUZNYECHIK-MAC",
+ "GOST R 34.13-2015 Grasshopper MAC",
+ },
+ {
+ NID_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac,
+ &pmeth_magma_mac_acpkm,
+ &ameth_magma_mac_acpkm,
+ "ID-TC26-CIPHER-GOSTR3412-2015-MAGMA-CTRACPKM-OMAC",
+ "GOST R 34.13-2015 Magma MAC ACPKM",
+ },
+ {
+ NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac,
+ &pmeth_grasshopper_mac_acpkm,
+ &ameth_grasshopper_mac_acpkm,
+ "ID-TC26-CIPHER-GOSTR3412-2015-KUZNYECHIK-CTRACPKM-OMAC",
+ "GOST R 34.13-2015 Grasshopper MAC ACPKM",
+ },
+ { 0 },
+};
+
+#ifndef OSSL_NELEM
+# define OSSL_NELEM(x) (sizeof(x)/sizeof((x)[0]))
+#endif
+
+static int known_digest_nids[OSSL_NELEM(gost_digest_array)];
+static int known_cipher_nids[OSSL_NELEM(gost_cipher_array)];
+/* `- 1' because of terminating zero element */
+static int known_meths_nids[OSSL_NELEM(gost_meth_array) - 1];
+
+/* ENGINE_DIGESTS_PTR callback installed by ENGINE_set_digests */