]> Git Repo - linux.git/commitdiff
crypto: omap-aes - Fix CTR mode counter length
authorJoel Fernandes <[email protected]>
Tue, 29 Oct 2013 22:37:38 +0000 (17:37 -0500)
committerHerbert Xu <[email protected]>
Wed, 30 Oct 2013 04:02:59 +0000 (12:02 +0800)
NIST vectors for CTR mode in testmgr.h assume the entire IV as the counter. To
get correct results that match the output of these vectors, we need to set the
counter length correctly.

Signed-off-by: Joel Fernandes <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
drivers/crypto/omap-aes.c

index e1e58d0ed5504c5999267d6b317f6637d5397aee..a9ccbf14096e3c03a9c193042baddc6d5b0e4925 100644 (file)
@@ -275,7 +275,7 @@ static int omap_aes_write_ctrl(struct omap_aes_dev *dd)
        if (dd->flags & FLAGS_CBC)
                val |= AES_REG_CTRL_CBC;
        if (dd->flags & FLAGS_CTR) {
-               val |= AES_REG_CTRL_CTR | AES_REG_CTRL_CTR_WIDTH_32;
+               val |= AES_REG_CTRL_CTR | AES_REG_CTRL_CTR_WIDTH_128;
                mask = AES_REG_CTRL_CTR | AES_REG_CTRL_CTR_WIDTH_MASK;
        }
        if (dd->flags & FLAGS_ENCRYPT)
This page took 0.056845 seconds and 4 git commands to generate.