x86: Fix files explicitly requiring export.h for EXPORT_SYMBOL/THIS_MODULE
[deliverable/linux.git] / arch / x86 / crypto / aes_glue.c
CommitLineData
a2a892a2 1/*
06e1a8f0 2 * Glue Code for the asm optimized version of the AES Cipher Algorithm
a2a892a2 3 *
a2a892a2
AS
4 */
5
89e12654 6#include <crypto/aes.h>
a2a892a2 7
07bf44f8
HY
8asmlinkage void aes_enc_blk(struct crypto_aes_ctx *ctx, u8 *out, const u8 *in);
9asmlinkage void aes_dec_blk(struct crypto_aes_ctx *ctx, u8 *out, const u8 *in);
10
11void crypto_aes_encrypt_x86(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
12{
13 aes_enc_blk(ctx, dst, src);
14}
15EXPORT_SYMBOL_GPL(crypto_aes_encrypt_x86);
16
17void crypto_aes_decrypt_x86(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
18{
19 aes_dec_blk(ctx, dst, src);
20}
21EXPORT_SYMBOL_GPL(crypto_aes_decrypt_x86);
e90b1a2b
HX
22
23static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
24{
07bf44f8 25 aes_enc_blk(crypto_tfm_ctx(tfm), dst, src);
e90b1a2b
HX
26}
27
28static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
29{
07bf44f8 30 aes_dec_blk(crypto_tfm_ctx(tfm), dst, src);
e90b1a2b 31}
a2a892a2
AS
32
33static struct crypto_alg aes_alg = {
06e1a8f0
SS
34 .cra_name = "aes",
35 .cra_driver_name = "aes-asm",
36 .cra_priority = 200,
37 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
38 .cra_blocksize = AES_BLOCK_SIZE,
39 .cra_ctxsize = sizeof(struct crypto_aes_ctx),
40 .cra_module = THIS_MODULE,
41 .cra_list = LIST_HEAD_INIT(aes_alg.cra_list),
42 .cra_u = {
43 .cipher = {
44 .cia_min_keysize = AES_MIN_KEY_SIZE,
45 .cia_max_keysize = AES_MAX_KEY_SIZE,
46 .cia_setkey = crypto_aes_set_key,
47 .cia_encrypt = aes_encrypt,
48 .cia_decrypt = aes_decrypt
a2a892a2
AS
49 }
50 }
51};
52
53static int __init aes_init(void)
54{
a2a892a2
AS
55 return crypto_register_alg(&aes_alg);
56}
57
58static void __exit aes_fini(void)
59{
60 crypto_unregister_alg(&aes_alg);
61}
62
63module_init(aes_init);
64module_exit(aes_fini);
65
06e1a8f0 66MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm, asm optimized");
a2a892a2 67MODULE_LICENSE("GPL");
03c6b749 68MODULE_ALIAS("aes");
06e1a8f0 69MODULE_ALIAS("aes-asm");
This page took 0.579369 seconds and 5 git commands to generate.