Commit 724ecd3c authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Herbert Xu

crypto: aes - rename local routines to prevent future clashes

Rename some local AES encrypt/decrypt routines so they don't clash with
the names we are about to introduce for the routines exposed by the
generic AES library.
Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 20bb4ef0
...@@ -16,7 +16,7 @@ EXPORT_SYMBOL(__aes_arm_encrypt); ...@@ -16,7 +16,7 @@ EXPORT_SYMBOL(__aes_arm_encrypt);
asmlinkage void __aes_arm_decrypt(u32 *rk, int rounds, const u8 *in, u8 *out); asmlinkage void __aes_arm_decrypt(u32 *rk, int rounds, const u8 *in, u8 *out);
EXPORT_SYMBOL(__aes_arm_decrypt); EXPORT_SYMBOL(__aes_arm_decrypt);
static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) static void aes_arm_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
{ {
struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
int rounds = 6 + ctx->key_length / 4; int rounds = 6 + ctx->key_length / 4;
...@@ -24,7 +24,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) ...@@ -24,7 +24,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
__aes_arm_encrypt(ctx->key_enc, rounds, in, out); __aes_arm_encrypt(ctx->key_enc, rounds, in, out);
} }
static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) static void aes_arm_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
{ {
struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
int rounds = 6 + ctx->key_length / 4; int rounds = 6 + ctx->key_length / 4;
...@@ -44,8 +44,8 @@ static struct crypto_alg aes_alg = { ...@@ -44,8 +44,8 @@ static struct crypto_alg aes_alg = {
.cra_cipher.cia_min_keysize = AES_MIN_KEY_SIZE, .cra_cipher.cia_min_keysize = AES_MIN_KEY_SIZE,
.cra_cipher.cia_max_keysize = AES_MAX_KEY_SIZE, .cra_cipher.cia_max_keysize = AES_MAX_KEY_SIZE,
.cra_cipher.cia_setkey = crypto_aes_set_key, .cra_cipher.cia_setkey = crypto_aes_set_key,
.cra_cipher.cia_encrypt = aes_encrypt, .cra_cipher.cia_encrypt = aes_arm_encrypt,
.cra_cipher.cia_decrypt = aes_decrypt, .cra_cipher.cia_decrypt = aes_arm_decrypt,
#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
.cra_alignmask = 3, .cra_alignmask = 3,
......
...@@ -15,7 +15,7 @@ EXPORT_SYMBOL(__aes_arm64_encrypt); ...@@ -15,7 +15,7 @@ EXPORT_SYMBOL(__aes_arm64_encrypt);
asmlinkage void __aes_arm64_decrypt(u32 *rk, u8 *out, const u8 *in, int rounds); asmlinkage void __aes_arm64_decrypt(u32 *rk, u8 *out, const u8 *in, int rounds);
EXPORT_SYMBOL(__aes_arm64_decrypt); EXPORT_SYMBOL(__aes_arm64_decrypt);
static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) static void aes_arm64_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
{ {
struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
int rounds = 6 + ctx->key_length / 4; int rounds = 6 + ctx->key_length / 4;
...@@ -23,7 +23,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) ...@@ -23,7 +23,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
__aes_arm64_encrypt(ctx->key_enc, out, in, rounds); __aes_arm64_encrypt(ctx->key_enc, out, in, rounds);
} }
static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) static void aes_arm64_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
{ {
struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
int rounds = 6 + ctx->key_length / 4; int rounds = 6 + ctx->key_length / 4;
...@@ -43,8 +43,8 @@ static struct crypto_alg aes_alg = { ...@@ -43,8 +43,8 @@ static struct crypto_alg aes_alg = {
.cra_cipher.cia_min_keysize = AES_MIN_KEY_SIZE, .cra_cipher.cia_min_keysize = AES_MIN_KEY_SIZE,
.cra_cipher.cia_max_keysize = AES_MAX_KEY_SIZE, .cra_cipher.cia_max_keysize = AES_MAX_KEY_SIZE,
.cra_cipher.cia_setkey = crypto_aes_set_key, .cra_cipher.cia_setkey = crypto_aes_set_key,
.cra_cipher.cia_encrypt = aes_encrypt, .cra_cipher.cia_encrypt = aes_arm64_encrypt,
.cra_cipher.cia_decrypt = aes_decrypt .cra_cipher.cia_decrypt = aes_arm64_decrypt
}; };
static int __init aes_init(void) static int __init aes_init(void)
......
...@@ -197,14 +197,14 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, ...@@ -197,14 +197,14 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
return 0; return 0;
} }
static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{ {
struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm);
ctx->ops->encrypt(&ctx->key[0], (const u32 *) src, (u32 *) dst); ctx->ops->encrypt(&ctx->key[0], (const u32 *) src, (u32 *) dst);
} }
static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) static void crypto_aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{ {
struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm);
...@@ -396,8 +396,8 @@ static struct crypto_alg algs[] = { { ...@@ -396,8 +396,8 @@ static struct crypto_alg algs[] = { {
.cia_min_keysize = AES_MIN_KEY_SIZE, .cia_min_keysize = AES_MIN_KEY_SIZE,
.cia_max_keysize = AES_MAX_KEY_SIZE, .cia_max_keysize = AES_MAX_KEY_SIZE,
.cia_setkey = aes_set_key, .cia_setkey = aes_set_key,
.cia_encrypt = aes_encrypt, .cia_encrypt = crypto_aes_encrypt,
.cia_decrypt = aes_decrypt .cia_decrypt = crypto_aes_decrypt
} }
} }
}, { }, {
......
...@@ -345,7 +345,7 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, ...@@ -345,7 +345,7 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
return aes_set_key_common(tfm, crypto_tfm_ctx(tfm), in_key, key_len); return aes_set_key_common(tfm, crypto_tfm_ctx(tfm), in_key, key_len);
} }
static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) static void aesni_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{ {
struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm)); struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm));
...@@ -358,7 +358,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) ...@@ -358,7 +358,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
} }
} }
static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) static void aesni_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{ {
struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm)); struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm));
...@@ -919,8 +919,8 @@ static struct crypto_alg aesni_cipher_alg = { ...@@ -919,8 +919,8 @@ static struct crypto_alg aesni_cipher_alg = {
.cia_min_keysize = AES_MIN_KEY_SIZE, .cia_min_keysize = AES_MIN_KEY_SIZE,
.cia_max_keysize = AES_MAX_KEY_SIZE, .cia_max_keysize = AES_MAX_KEY_SIZE,
.cia_setkey = aes_set_key, .cia_setkey = aes_set_key,
.cia_encrypt = aes_encrypt, .cia_encrypt = aesni_encrypt,
.cia_decrypt = aes_decrypt .cia_decrypt = aesni_decrypt
} }
} }
}; };
......
...@@ -1332,7 +1332,7 @@ EXPORT_SYMBOL_GPL(crypto_aes_set_key); ...@@ -1332,7 +1332,7 @@ EXPORT_SYMBOL_GPL(crypto_aes_set_key);
f_rl(bo, bi, 3, k); \ f_rl(bo, bi, 3, k); \
} while (0) } while (0)
static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
{ {
const struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); const struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
u32 b0[4], b1[4]; u32 b0[4], b1[4];
...@@ -1402,7 +1402,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) ...@@ -1402,7 +1402,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
i_rl(bo, bi, 3, k); \ i_rl(bo, bi, 3, k); \
} while (0) } while (0)
static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) static void crypto_aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
{ {
const struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); const struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
u32 b0[4], b1[4]; u32 b0[4], b1[4];
...@@ -1454,8 +1454,8 @@ static struct crypto_alg aes_alg = { ...@@ -1454,8 +1454,8 @@ static struct crypto_alg aes_alg = {
.cia_min_keysize = AES_MIN_KEY_SIZE, .cia_min_keysize = AES_MIN_KEY_SIZE,
.cia_max_keysize = AES_MAX_KEY_SIZE, .cia_max_keysize = AES_MAX_KEY_SIZE,
.cia_setkey = crypto_aes_set_key, .cia_setkey = crypto_aes_set_key,
.cia_encrypt = aes_encrypt, .cia_encrypt = crypto_aes_encrypt,
.cia_decrypt = aes_decrypt .cia_decrypt = crypto_aes_decrypt
} }
} }
}; };
......
...@@ -300,7 +300,7 @@ static inline u8 *padlock_xcrypt_cbc(const u8 *input, u8 *output, void *key, ...@@ -300,7 +300,7 @@ static inline u8 *padlock_xcrypt_cbc(const u8 *input, u8 *output, void *key,
return iv; return iv;
} }
static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) static void padlock_aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
{ {
struct aes_ctx *ctx = aes_ctx(tfm); struct aes_ctx *ctx = aes_ctx(tfm);
...@@ -309,7 +309,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) ...@@ -309,7 +309,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
padlock_store_cword(&ctx->cword.encrypt); padlock_store_cword(&ctx->cword.encrypt);
} }
static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) static void padlock_aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
{ {
struct aes_ctx *ctx = aes_ctx(tfm); struct aes_ctx *ctx = aes_ctx(tfm);
...@@ -332,8 +332,8 @@ static struct crypto_alg aes_alg = { ...@@ -332,8 +332,8 @@ static struct crypto_alg aes_alg = {
.cia_min_keysize = AES_MIN_KEY_SIZE, .cia_min_keysize = AES_MIN_KEY_SIZE,
.cia_max_keysize = AES_MAX_KEY_SIZE, .cia_max_keysize = AES_MAX_KEY_SIZE,
.cia_setkey = aes_set_key, .cia_setkey = aes_set_key,
.cia_encrypt = aes_encrypt, .cia_encrypt = padlock_aes_encrypt,
.cia_decrypt = aes_decrypt, .cia_decrypt = padlock_aes_decrypt,
} }
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment