d[7 - i] = in_ptr[i];
}
gostdecrypt(&(c->cctx), d, b);
+ memcpy(d, in_ptr, 8);
for (i = 0; i < 8; i++) {
out_ptr[i] = iv[i] ^ b[7 - i];
}
- memcpy(iv, in_ptr, 8);
+ memcpy(iv, d, 8);
out_ptr += 8;
in_ptr += 8;
inl -= 8;
if (in == NULL && inl == 0) /* Final call */
return gost2015_final_call(ctx, c->omac_ctx, MAGMA_MAC_MAX_SIZE, c->tag, magma_cipher_do_ctr);
+ if (in == NULL)
+ return -1;
+
/* As in and out can be the same pointer, process unencrypted here */
if (EVP_CIPHER_CTX_encrypting(ctx))
EVP_DigestSignUpdate(c->omac_ctx, in, inl);