diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2019-12-05 10:54:08 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-12-11 09:46:23 +0100 |
commit | 7db15aade87f9fbe38e2157cd6be0a61e2f3a314 (patch) | |
tree | 27e7ca298cc09dcaf51015178aedc443cdf53e14 /drivers/crypto/atmel-aes.c | |
parent | crypto: atmel-sha - Void return type for atmel_sha_update_dma_stop() (diff) | |
download | linux-7db15aade87f9fbe38e2157cd6be0a61e2f3a314.tar.xz linux-7db15aade87f9fbe38e2157cd6be0a61e2f3a314.zip |
crypto: atmel-aes - Use gcm helper to check authsize
Use core helper functions.
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/atmel-aes.c')
-rw-r--r-- | drivers/crypto/atmel-aes.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index e1b6b82cc5b0..173a30b7661b 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -1789,21 +1789,7 @@ static int atmel_aes_gcm_setkey(struct crypto_aead *tfm, const u8 *key, static int atmel_aes_gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) { - /* Same as crypto_gcm_authsize() from crypto/gcm.c */ - switch (authsize) { - case 4: - case 8: - case 12: - case 13: - case 14: - case 15: - case 16: - break; - default: - return -EINVAL; - } - - return 0; + return crypto_gcm_check_authsize(authsize); } static int atmel_aes_gcm_encrypt(struct aead_request *req) |