[CRYPTO] Allow AES C/ASM implementations to coexist
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 5 Nov 2005 07:06:26 +0000 (18:06 +1100)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 9 Jan 2006 22:15:39 +0000 (14:15 -0800)
As the Crypto API now allows multiple implementations to be registered
for the same algorithm, we no longer have to play tricks with Kconfig
to select the right AES implementation.

This patch sets the driver name and priority for all the AES
implementations and removes the Kconfig conditions on the C implementation
for AES.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/i386/crypto/aes.c
arch/x86_64/crypto/aes.c
crypto/Kconfig
crypto/aes.c
drivers/crypto/padlock-aes.c

index 1deb9ff564be3b5995cf7a4fb5921fd1e2ac31b6..138652aafcbf24222dd9519881f5020577ca1c10 100644 (file)
@@ -486,6 +486,8 @@ static inline void aes_decrypt(void *ctx, u8 *dst, const u8 *src)
 
 static struct crypto_alg aes_alg = {
        .cra_name               =       "aes",
+       .cra_driver_name        =       "aes-i586",
+       .cra_priority           =       200,
        .cra_flags              =       CRYPTO_ALG_TYPE_CIPHER,
        .cra_blocksize          =       AES_BLOCK_SIZE,
        .cra_ctxsize            =       sizeof(struct aes_ctx),
index 19996854b490fc80a44792be6a33e3a024b5d377..fb1b961a2e2f185143fbbea09e2e6a43606b72fb 100644 (file)
@@ -289,6 +289,8 @@ extern void aes_decrypt(void *ctx_arg, u8 *out, const u8 *in);
 
 static struct crypto_alg aes_alg = {
        .cra_name               =       "aes",
+       .cra_driver_name        =       "aes-x86_64",
+       .cra_priority           =       200,
        .cra_flags              =       CRYPTO_ALG_TYPE_CIPHER,
        .cra_blocksize          =       AES_BLOCK_SIZE,
        .cra_ctxsize            =       sizeof(struct aes_ctx),
index 52e1d4108a99bef096d877d5ba5bd1512545a32d..c442f2e7ce463cc6c900ae298e3ae0203d7eebf1 100644 (file)
@@ -157,7 +157,7 @@ config CRYPTO_SERPENT
 
 config CRYPTO_AES
        tristate "AES cipher algorithms"
-       depends on CRYPTO && !(X86 || UML_X86)
+       depends on CRYPTO
        help
          AES cipher algorithms (FIPS-197). AES uses the Rijndael 
          algorithm.
index 35a11deef29b28a6f2ae75ccd2e7e8da96466edf..b9b2afb427928cc7c4ae8f0e513282e701568ecc 100644 (file)
@@ -418,6 +418,8 @@ static void aes_decrypt(void *ctx_arg, u8 *out, const u8 *in)
 
 static struct crypto_alg aes_alg = {
        .cra_name               =       "aes",
+       .cra_driver_name        =       "aes-generic",
+       .cra_priority           =       100,
        .cra_flags              =       CRYPTO_ALG_TYPE_CIPHER,
        .cra_blocksize          =       AES_BLOCK_SIZE,
        .cra_ctxsize            =       sizeof(struct aes_ctx),
index 963e03dcb1ba57565e114c4051320f43523169ba..64819aa7cac42a31f9e181809167ae92cf1ac5dc 100644 (file)
@@ -466,6 +466,8 @@ static unsigned int aes_decrypt_cbc(const struct cipher_desc *desc, u8 *out,
 
 static struct crypto_alg aes_alg = {
        .cra_name               =       "aes",
+       .cra_driver_name        =       "aes-padlock",
+       .cra_priority           =       300,
        .cra_flags              =       CRYPTO_ALG_TYPE_CIPHER,
        .cra_blocksize          =       AES_BLOCK_SIZE,
        .cra_ctxsize            =       sizeof(struct aes_ctx),