2 * Glue Code for the asm optimized version of the AES Cipher Algorithm
6 #include <linux/module.h>
7 #include <crypto/aes.h>
10 asmlinkage
void aes_enc_blk(struct crypto_aes_ctx
*ctx
, u8
*out
, const u8
*in
);
11 asmlinkage
void aes_dec_blk(struct crypto_aes_ctx
*ctx
, u8
*out
, const u8
*in
);
13 void crypto_aes_encrypt_x86(struct crypto_aes_ctx
*ctx
, u8
*dst
, const u8
*src
)
15 aes_enc_blk(ctx
, dst
, src
);
17 EXPORT_SYMBOL_GPL(crypto_aes_encrypt_x86
);
19 void crypto_aes_decrypt_x86(struct crypto_aes_ctx
*ctx
, u8
*dst
, const u8
*src
)
21 aes_dec_blk(ctx
, dst
, src
);
23 EXPORT_SYMBOL_GPL(crypto_aes_decrypt_x86
);
25 static void aes_encrypt(struct crypto_tfm
*tfm
, u8
*dst
, const u8
*src
)
27 aes_enc_blk(crypto_tfm_ctx(tfm
), dst
, src
);
30 static void aes_decrypt(struct crypto_tfm
*tfm
, u8
*dst
, const u8
*src
)
32 aes_dec_blk(crypto_tfm_ctx(tfm
), dst
, src
);
35 static struct crypto_alg aes_alg
= {
37 .cra_driver_name
= "aes-asm",
39 .cra_flags
= CRYPTO_ALG_TYPE_CIPHER
,
40 .cra_blocksize
= AES_BLOCK_SIZE
,
41 .cra_ctxsize
= sizeof(struct crypto_aes_ctx
),
42 .cra_module
= THIS_MODULE
,
43 .cra_list
= LIST_HEAD_INIT(aes_alg
.cra_list
),
46 .cia_min_keysize
= AES_MIN_KEY_SIZE
,
47 .cia_max_keysize
= AES_MAX_KEY_SIZE
,
48 .cia_setkey
= crypto_aes_set_key
,
49 .cia_encrypt
= aes_encrypt
,
50 .cia_decrypt
= aes_decrypt
55 static int __init
aes_init(void)
57 return crypto_register_alg(&aes_alg
);
60 static void __exit
aes_fini(void)
62 crypto_unregister_alg(&aes_alg
);
65 module_init(aes_init
);
66 module_exit(aes_fini
);
68 MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm, asm optimized");
69 MODULE_LICENSE("GPL");
71 MODULE_ALIAS("aes-asm");