padlock-aes.c (0612ec48762bf8712db1925b2e67246d2237ebab) padlock-aes.c (1191f0a49390caf16f4a2831a4fc373757471ad6)
1/*
2 * Cryptographic API.
3 *
4 * Support for VIA PadLock hardware crypto engine.
5 *
6 * Copyright (c) 2004 Michal Ludvig <michal@logix.cz>
7 *
8 * Key expansion routine taken from crypto/aes.c

--- 481 unchanged lines hidden (view full) ---

490 .cia_encrypt_ecb = aes_encrypt_ecb,
491 .cia_decrypt_ecb = aes_decrypt_ecb,
492 .cia_encrypt_cbc = aes_encrypt_cbc,
493 .cia_decrypt_cbc = aes_decrypt_cbc,
494 }
495 }
496};
497
1/*
2 * Cryptographic API.
3 *
4 * Support for VIA PadLock hardware crypto engine.
5 *
6 * Copyright (c) 2004 Michal Ludvig <michal@logix.cz>
7 *
8 * Key expansion routine taken from crypto/aes.c

--- 481 unchanged lines hidden (view full) ---

490 .cia_encrypt_ecb = aes_encrypt_ecb,
491 .cia_decrypt_ecb = aes_decrypt_ecb,
492 .cia_encrypt_cbc = aes_encrypt_cbc,
493 .cia_decrypt_cbc = aes_decrypt_cbc,
494 }
495 }
496};
497
498int __init padlock_init_aes(void)
498static int __init padlock_init(void)
499{
499{
500 printk(KERN_NOTICE PFX "Using VIA PadLock ACE for AES algorithm.\n");
500 int ret;
501
501
502 if (!cpu_has_xcrypt) {
503 printk(KERN_ERR PFX "VIA PadLock not detected.\n");
504 return -ENODEV;
505 }
506
507 if (!cpu_has_xcrypt_enabled) {
508 printk(KERN_ERR PFX "VIA PadLock detected, but not enabled. Hmm, strange...\n");
509 return -ENODEV;
510 }
511
502 gen_tabs();
512 gen_tabs();
503 return crypto_register_alg(&aes_alg);
513 if ((ret = crypto_register_alg(&aes_alg))) {
514 printk(KERN_ERR PFX "VIA PadLock AES initialization failed.\n");
515 return ret;
516 }
517
518 printk(KERN_NOTICE PFX "Using VIA PadLock ACE for AES algorithm.\n");
519
520 return ret;
504}
505
521}
522
506void __exit padlock_fini_aes(void)
523static void __exit padlock_fini(void)
507{
508 crypto_unregister_alg(&aes_alg);
509}
524{
525 crypto_unregister_alg(&aes_alg);
526}
527
528module_init(padlock_init);
529module_exit(padlock_fini);
530
531MODULE_DESCRIPTION("VIA PadLock AES algorithm support");
532MODULE_LICENSE("GPL");
533MODULE_AUTHOR("Michal Ludvig");
534
535MODULE_ALIAS("aes-padlock");