/* gcm128.c */
/*
This file is part of the AVR-Crypto-Lib.
- Copyright (C) 2006-2015 Daniel Otte (daniel.otte@rub.de)
+ Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
uint8_t tmp[BLOCK_BYTES];
ghash128_block(&ctx->ghash_ctx, src);
- inc32(&ctx->ctr[11]);
+ inc32(&ctx->ctr[BLOCK_BYTES - COUNT_BYTES]);
memcpy(tmp, ctx->ctr, BLOCK_BYTES);
bcal_cipher_enc(tmp, &ctx->cipher_ctx);
memxor(tmp, src, BLOCK_BYTES);
tmp[length_b / 8] &= 0xff << (8 - (length_b & 7));
}
ghash128_block(&ctx->ghash_ctx, tmp);
- inc32(&ctx->ctr[11]);
+ inc32(&ctx->ctr[BLOCK_BYTES - COUNT_BYTES]);
memcpy(tmp, ctx->ctr, BLOCK_BYTES);
bcal_cipher_enc(tmp, &ctx->cipher_ctx);
memxor(tmp, src, BLOCK_BYTES);