Merge branch 'linus' into genirq
[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
e90b1a2b
HX
8asmlinkage void aes_enc_blk(struct crypto_tfm *tfm, u8 *out, const u8 *in);
9asmlinkage void aes_dec_blk(struct crypto_tfm *tfm, u8 *out, const u8 *in);
10
11static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
12{
13 aes_enc_blk(tfm, dst, src);
14}
15
16static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
17{
18 aes_dec_blk(tfm, dst, src);
19}
a2a892a2
AS
20
21static struct crypto_alg aes_alg = {
06e1a8f0
SS
22 .cra_name = "aes",
23 .cra_driver_name = "aes-asm",
24 .cra_priority = 200,
25 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
26 .cra_blocksize = AES_BLOCK_SIZE,
27 .cra_ctxsize = sizeof(struct crypto_aes_ctx),
28 .cra_module = THIS_MODULE,
29 .cra_list = LIST_HEAD_INIT(aes_alg.cra_list),
30 .cra_u = {
31 .cipher = {
32 .cia_min_keysize = AES_MIN_KEY_SIZE,
33 .cia_max_keysize = AES_MAX_KEY_SIZE,
34 .cia_setkey = crypto_aes_set_key,
35 .cia_encrypt = aes_encrypt,
36 .cia_decrypt = aes_decrypt
a2a892a2
AS
37 }
38 }
39};
40
41static int __init aes_init(void)
42{
a2a892a2
AS
43 return crypto_register_alg(&aes_alg);
44}
45
46static void __exit aes_fini(void)
47{
48 crypto_unregister_alg(&aes_alg);
49}
50
51module_init(aes_init);
52module_exit(aes_fini);
53
06e1a8f0 54MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm, asm optimized");
a2a892a2 55MODULE_LICENSE("GPL");
03c6b749 56MODULE_ALIAS("aes");
06e1a8f0 57MODULE_ALIAS("aes-asm");
This page took 0.30927 seconds and 5 git commands to generate.