-#ifndef OPENSSL_NO_DYNAMIC_ENGINE
-IMPLEMENT_DYNAMIC_BIND_FN(bind_gost)
- IMPLEMENT_DYNAMIC_CHECK_FN()
-#endif /* ndef OPENSSL_NO_DYNAMIC_ENGINE */
-
-static int gost_digests(ENGINE* e, const EVP_MD** digest,
- const int** nids, int nid) {
- int ok = 1;
- if (digest == NULL) {
- return gost_digest_nids(nids);
- }
- if (nid == NID_id_GostR3411_94) {
- *digest = digest_gost();
- } else if (nid == NID_id_Gost28147_89_MAC) {
- *digest = imit_gost_cpa();
- } else if (nid == NID_id_GostR3411_2012_256) {
- *digest = digest_gost2012_256();
- } else if (nid == NID_id_GostR3411_2012_512) {
- *digest = digest_gost2012_512();
- } else if (nid == NID_gost_mac_12) {
- *digest = imit_gost_cp_12();
- } else if (nid == NID_magma_mac) {
- *digest = magma_omac();
- } else if (nid == NID_grasshopper_mac) {
- *digest = grasshopper_omac();
- } else {
- ok = 0;
- *digest = NULL;
- }
- return ok;
-}
-
-static int gost_ciphers(ENGINE* e, const EVP_CIPHER** cipher,
- const int** nids, int nid) {
- int ok = 1;
- if (cipher == NULL) {
- *nids = gost_cipher_nids;
- return sizeof(gost_cipher_nids) / sizeof(gost_cipher_nids[0]) - 1;
- }
-
- if (nid == NID_id_Gost28147_89) {
- *cipher = cipher_gost();
- } else if (nid == NID_gost89_cnt) {
- *cipher = cipher_gost_cpacnt();
- } else if (nid == NID_gost89_cnt_12) {
- *cipher = cipher_gost_cpcnt_12();
- } else if (nid == NID_gost89_cbc) {
- *cipher = cipher_gost_cbc();
- } else if (nid == NID_grasshopper_ecb) {
- *cipher = cipher_gost_grasshopper_ecb();
- } else if (nid == NID_grasshopper_cbc) {
- *cipher = cipher_gost_grasshopper_cbc();
- } else if (nid == NID_grasshopper_cfb) {
- *cipher = cipher_gost_grasshopper_cfb();
- } else if (nid == NID_grasshopper_ofb) {
- *cipher = cipher_gost_grasshopper_ofb();
- } else if (nid == NID_grasshopper_ctr) {
- *cipher = cipher_gost_grasshopper_ctr();
- } else if (nid == NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm) {
- *cipher = cipher_gost_grasshopper_ctracpkm();
- } else if (nid == NID_magma_cbc) {
- *cipher = cipher_magma_cbc();
- } else if (nid == NID_magma_ctr) {
- *cipher = cipher_magma_ctr();
- } else {
- ok = 0;
- *cipher = NULL;