~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/crypto/aes_glue.c

Version: ~ [ linux-5.2-rc1 ] ~ [ linux-5.1.2 ] ~ [ linux-5.0.16 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.43 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.119 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.176 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.179 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.139 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.67 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Glue Code for the asm optimized version of the AES Cipher Algorithm
  3  *
  4  */
  5 
  6 #include <crypto/aes.h>
  7 
  8 asmlinkage void aes_enc_blk(struct crypto_aes_ctx *ctx, u8 *out, const u8 *in);
  9 asmlinkage void aes_dec_blk(struct crypto_aes_ctx *ctx, u8 *out, const u8 *in);
 10 
 11 void crypto_aes_encrypt_x86(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
 12 {
 13         aes_enc_blk(ctx, dst, src);
 14 }
 15 EXPORT_SYMBOL_GPL(crypto_aes_encrypt_x86);
 16 
 17 void crypto_aes_decrypt_x86(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
 18 {
 19         aes_dec_blk(ctx, dst, src);
 20 }
 21 EXPORT_SYMBOL_GPL(crypto_aes_decrypt_x86);
 22 
 23 static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
 24 {
 25         aes_enc_blk(crypto_tfm_ctx(tfm), dst, src);
 26 }
 27 
 28 static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
 29 {
 30         aes_dec_blk(crypto_tfm_ctx(tfm), dst, src);
 31 }
 32 
 33 static struct crypto_alg aes_alg = {
 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
 49                 }
 50         }
 51 };
 52 
 53 static int __init aes_init(void)
 54 {
 55         return crypto_register_alg(&aes_alg);
 56 }
 57 
 58 static void __exit aes_fini(void)
 59 {
 60         crypto_unregister_alg(&aes_alg);
 61 }
 62 
 63 module_init(aes_init);
 64 module_exit(aes_fini);
 65 
 66 MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm, asm optimized");
 67 MODULE_LICENSE("GPL");
 68 MODULE_ALIAS("aes");
 69 MODULE_ALIAS("aes-asm");
 70 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp