+static GOST_cipher gost_template_cipher = {
+ .block_size = 8,
+ .key_len = 32,
+ .iv_len = 8,
+ .flags = EVP_CIPH_CUSTOM_IV |
+ EVP_CIPH_RAND_KEY |
+ EVP_CIPH_ALWAYS_CALL_INIT,
+ .cleanup = gost_cipher_cleanup,
+ .ctx_size = sizeof(struct ossl_gost_cipher_ctx),
+ .set_asn1_parameters = gost89_set_asn1_parameters,
+ .get_asn1_parameters = gost89_get_asn1_parameters,
+ .ctrl = gost_cipher_ctl,
+};
+
+GOST_cipher Gost28147_89_cipher = {
+ .nid = NID_id_Gost28147_89,
+ .template = &gost_template_cipher,
+ .block_size = 1,
+ .flags = EVP_CIPH_CFB_MODE |
+ EVP_CIPH_NO_PADDING,
+ .init = gost_cipher_init,
+ .do_cipher = gost_cipher_do_cfb,
+};
+
+GOST_cipher Gost28147_89_cbc_cipher = {
+ .nid = NID_gost89_cbc,
+ .template = &gost_template_cipher,
+ .flags = EVP_CIPH_CBC_MODE,
+ .init = gost_cipher_init_cbc,
+ .do_cipher = gost_cipher_do_cbc,
+};
+
+GOST_cipher Gost28147_89_cnt_cipher = {
+ .nid = NID_gost89_cnt,
+ .template = &gost_template_cipher,
+ .block_size = 1,
+ .flags = EVP_CIPH_OFB_MODE |
+ EVP_CIPH_NO_PADDING,
+ .init = gost_cipher_init_cpa,
+ .do_cipher = gost_cipher_do_cnt,
+};
+
+GOST_cipher Gost28147_89_cnt_12_cipher = {
+ .nid = NID_gost89_cnt_12,
+ .template = &gost_template_cipher,
+ .block_size = 1,
+ .flags = EVP_CIPH_OFB_MODE |
+ EVP_CIPH_NO_PADDING,
+ .init = gost_cipher_init_cp_12,
+ .do_cipher = gost_cipher_do_cnt,
+};
+
+static GOST_cipher magma_template_cipher = {
+ .block_size = 8,
+ .key_len = 32,
+ .flags =
+ EVP_CIPH_RAND_KEY |
+ EVP_CIPH_ALWAYS_CALL_INIT,
+ .cleanup = gost_cipher_cleanup,
+ .ctx_size = sizeof(struct ossl_gost_cipher_ctx),
+ .set_asn1_parameters = magma_set_asn1_parameters,
+ .get_asn1_parameters = magma_get_asn1_parameters,
+ .do_cipher = magma_cipher_do_ctr,
+ .ctrl = magma_cipher_ctl,
+};
+
+GOST_cipher magma_ctr_cipher = {
+ .nid = NID_magma_ctr,
+ .template = &magma_template_cipher,
+ .block_size = 1,
+ .iv_len = 4,
+ .flags = EVP_CIPH_CTR_MODE |
+ EVP_CIPH_CUSTOM_IV |
+ EVP_CIPH_NO_PADDING,
+ .init = magma_cipher_init,
+};
+
+GOST_cipher magma_ctr_acpkm_cipher = {
+ .nid = NID_magma_ctr_acpkm,
+ .template = &magma_template_cipher,
+ .block_size = 1,
+ .iv_len = 4,
+ .flags = EVP_CIPH_CTR_MODE |
+ EVP_CIPH_CUSTOM_IV |
+ EVP_CIPH_NO_PADDING,
+ .init = magma_cipher_init,
+};
+
+GOST_cipher magma_ctr_acpkm_omac_cipher = {
+ .nid = NID_magma_ctr_acpkm_omac,
+ .template = &magma_template_cipher,
+ .block_size = 1,
+ .iv_len = 4,
+ .flags = EVP_CIPH_CTR_MODE |
+ EVP_CIPH_CUSTOM_IV |
+ EVP_CIPH_NO_PADDING |
+ EVP_CIPH_CUSTOM_COPY |
+ EVP_CIPH_FLAG_CUSTOM_CIPHER |
+ EVP_CIPH_FLAG_CIPHER_WITH_MAC,
+ .init = magma_cipher_init_ctr_acpkm_omac,
+ .do_cipher = magma_cipher_do_ctr_acpkm_omac,
+ .ctrl = magma_cipher_ctl_acpkm_omac,
+};
+
+GOST_cipher magma_ecb_cipher = {
+ .nid = NID_magma_ecb,
+ .template = &magma_template_cipher,
+ .flags = EVP_CIPH_ECB_MODE,
+ .init = magma_cipher_init,
+ .do_cipher = magma_cipher_do_ecb,
+};
+
+GOST_cipher magma_cbc_cipher = {
+ .nid = NID_magma_cbc,
+ .template = &gost_template_cipher,
+ .iv_len = 8,
+ .flags = EVP_CIPH_CBC_MODE |
+ EVP_CIPH_CUSTOM_IV,
+ .init = magma_cipher_init,
+ .do_cipher = magma_cipher_do_cbc,
+};