Skip to content

Commit 4e1d14b

Browse files
ebiggersherbertx
authored andcommitted
crypto: ghash - remove checks for key being set
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>
1 parent 9fa68f6 commit 4e1d14b

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

‎crypto/ghash-generic.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ static int ghash_update(struct shash_desc *desc,
5656
struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
5757
u8 *dst = dctx->buffer;
5858

59-
if (!ctx->gf128)
60-
return -ENOKEY;
61-
6259
if (dctx->bytes) {
6360
int n = min(srclen, dctx->bytes);
6461
u8 *pos = dst + (GHASH_BLOCK_SIZE - dctx->bytes);
@@ -111,9 +108,6 @@ static int ghash_final(struct shash_desc *desc, u8 *dst)
111108
struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
112109
u8 *buf = dctx->buffer;
113110

114-
if (!ctx->gf128)
115-
return -ENOKEY;
116-
117111
ghash_flush(ctx, dctx);
118112
memcpy(dst, buf, GHASH_BLOCK_SIZE);
119113

0 commit comments

Comments
 (0)