X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fcrypto%2Fgeode-aes.c;h=711e246e1ef021ee66fd297105482328580b0cd8;hb=aa7f00741da5e2adeca3e03103d14b9141040e49;hp=6d3840e629de550c0b3de37a2090788cb6180351;hpb=5efee174f8a101cafb1607d2b629bed353701457;p=linux-2.6-omap-h63xx.git diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c index 6d3840e629d..711e246e1ef 100644 --- a/drivers/crypto/geode-aes.c +++ b/drivers/crypto/geode-aes.c @@ -102,11 +102,15 @@ geode_aes_crypt(struct geode_aes_op *op) u32 flags = 0; unsigned long iflags; - if (op->len == 0 || op->src == op->dst) + if (op->len == 0) return 0; - if (op->flags & AES_FLAGS_COHERENT) - flags |= (AES_CTRL_DCA | AES_CTRL_SCA); + /* If the source and destination is the same, then + * we need to turn on the coherent flags, otherwise + * we don't need to worry + */ + + flags |= (AES_CTRL_DCA | AES_CTRL_SCA); if (op->dir == AES_DIR_ENCRYPT) flags |= AES_CTRL_ENCRYPT; @@ -120,7 +124,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); } @@ -289,6 +293,7 @@ static struct crypto_alg geode_cbc_alg = { .setkey = geode_setkey, .encrypt = geode_cbc_encrypt, .decrypt = geode_cbc_decrypt, + .ivsize = AES_IV_LENGTH, } } }; @@ -467,6 +472,7 @@ geode_aes_exit(void) MODULE_AUTHOR("Advanced Micro Devices, Inc."); MODULE_DESCRIPTION("Geode LX Hardware AES driver"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("aes"); module_init(geode_aes_init); module_exit(geode_aes_exit);