Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tudor Ambarus and committed by
Herbert Xu
7db15aad 4c977e37

+1 -15
+1 -15
drivers/crypto/atmel-aes.c
··· 1789 1789 static int atmel_aes_gcm_setauthsize(struct crypto_aead *tfm, 1790 1790 unsigned int authsize) 1791 1791 { 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); 1807 1793 } 1808 1794 1809 1795 static int atmel_aes_gcm_encrypt(struct aead_request *req)