+/* MAGMA encryption in ECB mode */
+static int magma_cipher_do_ecb(EVP_CIPHER_CTX *ctx, unsigned char *out,
+ const unsigned char *in, size_t inl)
+{
+ struct ossl_gost_cipher_ctx *c = EVP_CIPHER_CTX_get_cipher_data(ctx);
+ if (EVP_CIPHER_CTX_encrypting(ctx)) {
+ while (inl > 0) {
+ magmacrypt(&(c->cctx), in, out);
+ out += 8;
+ in += 8;
+ inl -= 8;
+ }
+ } else {
+ while (inl > 0) {
+ magmadecrypt(&(c->cctx), in, out);
+ out += 8;
+ in += 8;
+ inl -= 8;
+ }
+ }
+ return 1;
+}
+