int init_gost_hash_ctx(gost_hash_ctx * ctx,
const gost_subst_block * subst_block)
{
- memset(ctx, 0, sizeof(gost_hash_ctx));
+ memset(ctx, 0, sizeof(*ctx));
ctx->cipher_ctx = (gost_ctx *) MYALLOC(sizeof(gost_ctx));
if (!ctx->cipher_ctx) {
return 0;
fin_len += ctx->left;
}
memset(buf, 0, 32);
+ if (fin_len == 0)
+ hash_step(ctx->cipher_ctx, H, buf);
bptr = buf;
fin_len <<= 3; /* Hash length in BITS!! */
while (fin_len > 0) {