I am working on a SAMA5D36-EK boar, I try to understand and measure the performance of AES hw acceleration.
But I have a question, if I analyze the atmel-aes.c file, in the atmel_aes_crypt function, there are special modification for CF8 or CF16... but not for CTR mode.
My question is where the incrementation is done (when the atmel-aes.ko module is loaded of course) ?
As a recall, if we use the linux kernel crypto, the incrementation is inside the encrypt function in ctr.c :
static int crypto_ctr_crypt_segment(struct blkcipher_walk *walk,
struct crypto_cipher *tfm)
void (*fn)(struct crypto_tfm *, u8 *, const u8 *) =
unsigned int bsize = crypto_cipher_blocksize(tfm);
u8 *ctrblk = walk->iv;
u8 *src = walk->src.virt.addr;
u8 *dst = walk->dst.virt.addr;
unsigned int nbytes = walk->nbytes;
/* create keystream */
fn(crypto_cipher_tfm(tfm), dst, ctrblk);
crypto_xor(dst, src, bsize);
/*HERE HERE !!!!*/
/* increment counter in counterblock */
src += bsize;
dst += bsize;
} while ((nbytes -= bsize) >= bsize);