Skip to content

Commit

Permalink
crypto: ghash - remove checks for key being set
Browse files Browse the repository at this point in the history
Now that the crypto API prevents a keyed hash from being used without
setting the key, there's no need for GHASH to do this check itself.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Eric Biggers authored and Herbert Xu committed Jan 12, 2018
1 parent 9fa68f6 commit 4e1d14b
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions crypto/ghash-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ static int ghash_update(struct shash_desc *desc,
struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
u8 *dst = dctx->buffer;

if (!ctx->gf128)
return -ENOKEY;

if (dctx->bytes) {
int n = min(srclen, dctx->bytes);
u8 *pos = dst + (GHASH_BLOCK_SIZE - dctx->bytes);
Expand Down Expand Up @@ -111,9 +108,6 @@ static int ghash_final(struct shash_desc *desc, u8 *dst)
struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
u8 *buf = dctx->buffer;

if (!ctx->gf128)
return -ENOKEY;

ghash_flush(ctx, dctx);
memcpy(dst, buf, GHASH_BLOCK_SIZE);

Expand Down

0 comments on commit 4e1d14b

Please sign in to comment.