Skip to content

Commit 7db15aa

Browse files
ambarusherbertx
authored andcommitted
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>
1 parent 4c977e3 commit 7db15aa

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

‎drivers/crypto/atmel-aes.c‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,21 +1789,7 @@ static int atmel_aes_gcm_setkey(struct crypto_aead *tfm, const u8 *key,
17891789
static int atmel_aes_gcm_setauthsize(struct crypto_aead *tfm,
17901790
unsigned int authsize)
17911791
{
1792-
/* Same as crypto_gcm_authsize() from crypto/gcm.c */
1793-
switch (authsize) {
1794-
case 4:
1795-
case 8:
1796-
case 12:
1797-
case 13:
1798-
case 14:
1799-
case 15:
1800-
case 16:
1801-
break;
1802-
default:
1803-
return -EINVAL;
1804-
}
1805-
1806-
return 0;
1792+
return crypto_gcm_check_authsize(authsize);
18071793
}
18081794

18091795
static int atmel_aes_gcm_encrypt(struct aead_request *req)

0 commit comments

Comments
 (0)