crypto: atmel-aes - fix the counter overflow in CTR mode
authorCyrille Pitchen <cyrille.pitchen@atmel.com>
Thu, 17 Dec 2015 17:13:05 +0000 (18:13 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 23 Dec 2015 10:19:57 +0000 (18:19 +0800)
commitfcac83656a3e3b15e7a16b4a64ee5067eecec446
treed6cb08952fd2f4199960f22350f7b34969048504
parentda7b850edb68ab6e3e3cc8593c6ce2c577b6b61c
crypto: atmel-aes - fix the counter overflow in CTR mode

Depending on its hardware version, the AES IP provides either a 16 or a
32 bit counter. However the CTR mode expects the size of the counter to be
the same as the size of the cipher block, ie 128 bits for AES.
This patch detects and handles counter overflows.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/atmel-aes.c