+static EVP_CIPHER *_hidden_gost89_cnt = NULL;
+const EVP_CIPHER *cipher_gost_cpacnt(void)
+{
+ if (_hidden_gost89_cnt == NULL
+ && ((_hidden_gost89_cnt =
+ EVP_CIPHER_meth_new(NID_gost89_cnt, 1 /* block_size */ ,
+ 32 /* key_size */ )) == NULL
+ || !EVP_CIPHER_meth_set_iv_length(_hidden_gost89_cnt, 8)
+ || !EVP_CIPHER_meth_set_flags(_hidden_gost89_cnt,
+ EVP_CIPH_OFB_MODE |
+ EVP_CIPH_NO_PADDING |
+ EVP_CIPH_CUSTOM_IV |
+ EVP_CIPH_RAND_KEY |
+ EVP_CIPH_ALWAYS_CALL_INIT)
+ || !EVP_CIPHER_meth_set_init(_hidden_gost89_cnt,
+ gost_cipher_init_cpa)
+ || !EVP_CIPHER_meth_set_do_cipher(_hidden_gost89_cnt,
+ gost_cipher_do_cnt)
+ || !EVP_CIPHER_meth_set_cleanup(_hidden_gost89_cnt,
+ gost_cipher_cleanup)
+ || !EVP_CIPHER_meth_set_impl_ctx_size(_hidden_gost89_cnt,
+ sizeof(struct
+ ossl_gost_cipher_ctx))
+ || !EVP_CIPHER_meth_set_set_asn1_params(_hidden_gost89_cnt,
+ gost89_set_asn1_parameters)
+ || !EVP_CIPHER_meth_set_get_asn1_params(_hidden_gost89_cnt,
+ gost89_get_asn1_parameters)
+ || !EVP_CIPHER_meth_set_ctrl(_hidden_gost89_cnt, gost_cipher_ctl))) {
+ EVP_CIPHER_meth_free(_hidden_gost89_cnt);
+ _hidden_gost89_cnt = NULL;
+ }
+ return _hidden_gost89_cnt;
+}
+
+static EVP_CIPHER *_hidden_gost89_cnt_12 = NULL;
+const EVP_CIPHER *cipher_gost_cpcnt_12(void)
+{
+ if (_hidden_gost89_cnt_12 == NULL
+ && ((_hidden_gost89_cnt_12 =
+ EVP_CIPHER_meth_new(NID_gost89_cnt_12, 1 /* block_size */ ,
+ 32 /* key_size */ )) == NULL
+ || !EVP_CIPHER_meth_set_iv_length(_hidden_gost89_cnt_12, 8)
+ || !EVP_CIPHER_meth_set_flags(_hidden_gost89_cnt_12,
+ EVP_CIPH_OFB_MODE |
+ EVP_CIPH_NO_PADDING |
+ EVP_CIPH_CUSTOM_IV |
+ EVP_CIPH_RAND_KEY |
+ EVP_CIPH_ALWAYS_CALL_INIT)
+ || !EVP_CIPHER_meth_set_init(_hidden_gost89_cnt_12,
+ gost_cipher_init_cp_12)
+ || !EVP_CIPHER_meth_set_do_cipher(_hidden_gost89_cnt_12,
+ gost_cipher_do_cnt)
+ || !EVP_CIPHER_meth_set_cleanup(_hidden_gost89_cnt_12,
+ gost_cipher_cleanup)
+ || !EVP_CIPHER_meth_set_impl_ctx_size(_hidden_gost89_cnt_12,
+ sizeof(struct
+ ossl_gost_cipher_ctx))
+ || !EVP_CIPHER_meth_set_set_asn1_params(_hidden_gost89_cnt_12,
+ gost89_set_asn1_parameters)
+ || !EVP_CIPHER_meth_set_get_asn1_params(_hidden_gost89_cnt_12,
+ gost89_get_asn1_parameters)
+ || !EVP_CIPHER_meth_set_ctrl(_hidden_gost89_cnt_12,
+ gost_cipher_ctl))) {
+ EVP_CIPHER_meth_free(_hidden_gost89_cnt_12);
+ _hidden_gost89_cnt_12 = NULL;
+ }
+ return _hidden_gost89_cnt_12;
+}
+
+static EVP_CIPHER *_hidden_magma_ctr = NULL;
+const EVP_CIPHER *cipher_magma_ctr(void)
+{
+ if (_hidden_magma_ctr == NULL
+ && ((_hidden_magma_ctr =
+ EVP_CIPHER_meth_new(NID_magma_ctr, 1 /* block_size */ ,
+ 32 /* key_size */ )) == NULL
+ || !EVP_CIPHER_meth_set_iv_length(_hidden_magma_ctr, 8)
+ || !EVP_CIPHER_meth_set_flags(_hidden_magma_ctr,
+ EVP_CIPH_CTR_MODE |
+ EVP_CIPH_NO_PADDING |
+ EVP_CIPH_CUSTOM_IV |
+ EVP_CIPH_RAND_KEY |
+ EVP_CIPH_ALWAYS_CALL_INIT)
+ || !EVP_CIPHER_meth_set_init(_hidden_magma_ctr, magma_cipher_init)
+ || !EVP_CIPHER_meth_set_do_cipher(_hidden_magma_ctr,
+ magma_cipher_do_ctr)
+ || !EVP_CIPHER_meth_set_cleanup(_hidden_magma_ctr,
+ gost_cipher_cleanup)
+ || !EVP_CIPHER_meth_set_impl_ctx_size(_hidden_magma_ctr,
+ sizeof(struct
+ ossl_gost_cipher_ctx))
+ || !EVP_CIPHER_meth_set_set_asn1_params(_hidden_magma_ctr,
+ gost89_set_asn1_parameters)
+ || !EVP_CIPHER_meth_set_get_asn1_params(_hidden_magma_ctr,
+ gost89_get_asn1_parameters)
+ || !EVP_CIPHER_meth_set_ctrl(_hidden_magma_ctr, gost_cipher_ctl))) {
+ EVP_CIPHER_meth_free(_hidden_magma_ctr);
+ _hidden_magma_ctr = NULL;
+ }
+ return _hidden_magma_ctr;
+}
+
+static EVP_CIPHER *_hidden_magma_cbc = NULL;
+const EVP_CIPHER *cipher_magma_cbc(void)
+{
+ if (_hidden_magma_cbc == NULL
+ && ((_hidden_magma_cbc =
+ EVP_CIPHER_meth_new(NID_magma_cbc, 8 /* block_size */ ,
+ 32 /* key_size */ )) == NULL
+ || !EVP_CIPHER_meth_set_iv_length(_hidden_magma_cbc, 8)
+ || !EVP_CIPHER_meth_set_flags(_hidden_magma_cbc,
+ EVP_CIPH_CBC_MODE |
+ EVP_CIPH_CUSTOM_IV |
+ EVP_CIPH_RAND_KEY |
+ EVP_CIPH_ALWAYS_CALL_INIT)
+ || !EVP_CIPHER_meth_set_init(_hidden_magma_cbc, magma_cipher_init)
+ || !EVP_CIPHER_meth_set_do_cipher(_hidden_magma_cbc,
+ magma_cipher_do_cbc)
+ || !EVP_CIPHER_meth_set_cleanup(_hidden_magma_cbc,
+ gost_cipher_cleanup)
+ || !EVP_CIPHER_meth_set_impl_ctx_size(_hidden_magma_cbc,
+ sizeof(struct
+ ossl_gost_cipher_ctx))
+ || !EVP_CIPHER_meth_set_set_asn1_params(_hidden_magma_cbc,
+ gost89_set_asn1_parameters)
+ || !EVP_CIPHER_meth_set_get_asn1_params(_hidden_magma_cbc,
+ gost89_get_asn1_parameters)
+ || !EVP_CIPHER_meth_set_ctrl(_hidden_magma_cbc, gost_cipher_ctl))) {
+ EVP_CIPHER_meth_free(_hidden_magma_cbc);
+ _hidden_magma_cbc = NULL;
+ }
+ return _hidden_magma_cbc;
+}
+
+void cipher_gost_destroy(void)
+{
+ EVP_CIPHER_meth_free(_hidden_Gost28147_89_cipher);
+ _hidden_Gost28147_89_cipher = NULL;
+ EVP_CIPHER_meth_free(_hidden_gost89_cnt);
+ _hidden_gost89_cnt = NULL;
+ EVP_CIPHER_meth_free(_hidden_Gost28147_89_cbc);
+ _hidden_Gost28147_89_cbc = NULL;
+ EVP_CIPHER_meth_free(_hidden_gost89_cnt_12);
+ _hidden_gost89_cnt_12 = NULL;
+ EVP_CIPHER_meth_free(_hidden_magma_cbc);
+ _hidden_magma_cbc = NULL;
+ EVP_CIPHER_meth_free(_hidden_magma_ctr);
+ _hidden_magma_ctr = NULL;
+}