diff options
author | Eric Biggers <ebiggers@google.com> | 2018-01-03 14:16:28 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-01-12 07:03:38 -0500 |
commit | 4e1d14bcd10a33537918a9a747ab90fc5c2e6d7f (patch) | |
tree | 236e3e7e2f8ace468cddc8a53e4083de11393027 | |
parent | 9fa68f620041be04720d0cbfb1bd3ddfc6310b24 (diff) |
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>
-rw-r--r-- | crypto/ghash-generic.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/crypto/ghash-generic.c b/crypto/ghash-generic.c index 12ad3e3a84e3..1bffb3f712dd 100644 --- a/crypto/ghash-generic.c +++ b/crypto/ghash-generic.c | |||
@@ -56,9 +56,6 @@ static int ghash_update(struct shash_desc *desc, | |||
56 | struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); | 56 | struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); |
57 | u8 *dst = dctx->buffer; | 57 | u8 *dst = dctx->buffer; |
58 | 58 | ||
59 | if (!ctx->gf128) | ||
60 | return -ENOKEY; | ||
61 | |||
62 | if (dctx->bytes) { | 59 | if (dctx->bytes) { |
63 | int n = min(srclen, dctx->bytes); | 60 | int n = min(srclen, dctx->bytes); |
64 | u8 *pos = dst + (GHASH_BLOCK_SIZE - dctx->bytes); | 61 | u8 *pos = dst + (GHASH_BLOCK_SIZE - dctx->bytes); |
@@ -111,9 +108,6 @@ static int ghash_final(struct shash_desc *desc, u8 *dst) | |||
111 | struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); | 108 | struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); |
112 | u8 *buf = dctx->buffer; | 109 | u8 *buf = dctx->buffer; |
113 | 110 | ||
114 | if (!ctx->gf128) | ||
115 | return -ENOKEY; | ||
116 | |||
117 | ghash_flush(ctx, dctx); | 111 | ghash_flush(ctx, dctx); |
118 | memcpy(dst, buf, GHASH_BLOCK_SIZE); | 112 | memcpy(dst, buf, GHASH_BLOCK_SIZE); |
119 | 113 | ||