[CRYPTO] gcm: New algorithm
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / x86 / crypto / aes_64.c
blobd7a41a97dd3f66752f34d63ce5996d319035ab73
1 /*
2 * Glue Code for AES Cipher Algorithm
4 */
6 #include <crypto/aes.h>
8 asmlinkage void aes_enc_blk(struct crypto_tfm *tfm, u8 *out, const u8 *in);
9 asmlinkage void aes_dec_blk(struct crypto_tfm *tfm, u8 *out, const u8 *in);
11 static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
13 aes_enc_blk(tfm, dst, src);
16 static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
18 aes_dec_blk(tfm, dst, src);
21 static struct crypto_alg aes_alg = {
22 .cra_name = "aes",
23 .cra_driver_name = "aes-x86_64",
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
41 static int __init aes_init(void)
43 return crypto_register_alg(&aes_alg);
46 static void __exit aes_fini(void)
48 crypto_unregister_alg(&aes_alg);
51 module_init(aes_init);
52 module_exit(aes_fini);
54 MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm");
55 MODULE_LICENSE("GPL");
56 MODULE_ALIAS("aes");