X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fcrypto%2Fgeode-aes.c;h=6a86958b577f974bc423fbc22d48131c2ee79ecd;hb=641bdcd56c8bb2110a31da846b2752b11a644050;hp=31ea405f2eeb5fbe8d8fdb94b0f785f58729208f;hpb=9468482bd4c3b89abe04a770848d5eaa1ea830b0;p=linux-2.6-omap-h63xx.git diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c index 31ea405f2ee..6a86958b577 100644 --- a/drivers/crypto/geode-aes.c +++ b/drivers/crypto/geode-aes.c @@ -8,7 +8,6 @@ #include #include -#include #include #include #include @@ -100,14 +99,18 @@ do_crypt(void *src, void *dst, int len, u32 flags) static unsigned int geode_aes_crypt(struct geode_aes_op *op) { - u32 flags = 0; - int iflags; + unsigned long iflags; - if (op->len == 0 || op->src == op->dst) + if (op->len == 0) return 0; - if (op->flags & AES_FLAGS_COHERENT) + /* If the source and destination is the same, then + * we need to turn on the coherent flags, otherwise + * we don't need to worry + */ + + if (op->src == op->dst) flags |= (AES_CTRL_DCA | AES_CTRL_SCA); if (op->dir == AES_DIR_ENCRYPT) @@ -122,7 +125,7 @@ geode_aes_crypt(struct geode_aes_op *op) _writefield(AES_WRITEIV0_REG, op->iv); } - if (op->flags & AES_FLAGS_USRKEY) { + if (!(op->flags & AES_FLAGS_HIDDENKEY)) { flags |= AES_CTRL_WRKEY; _writefield(AES_WRITEKEY0_REG, op->key); } @@ -291,6 +294,7 @@ static struct crypto_alg geode_cbc_alg = { .setkey = geode_setkey, .encrypt = geode_cbc_encrypt, .decrypt = geode_cbc_decrypt, + .ivsize = AES_IV_LENGTH, } } };