Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34214
b: refs/heads/master
c: 1191f0a
h: refs/heads/master
v: v3
  • Loading branch information
Michal Ludvig authored and Herbert Xu committed Sep 21, 2006
1 parent fc0b3e7 commit e07a7b9
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 80 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b14cdd6704c96474ba5c74b5959487beaa5ee1cd
refs/heads/master: 1191f0a49390caf16f4a2831a4fc373757471ad6
16 changes: 11 additions & 5 deletions trunk/drivers/crypto/Kconfig
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
menu "Hardware crypto devices"

config CRYPTO_DEV_PADLOCK
tristate "Support for VIA PadLock ACE"
bool "Support for VIA PadLock ACE"
depends on X86_32
select CRYPTO_ALGAPI
default y
help
Some VIA processors come with an integrated crypto engine
(so called VIA PadLock ACE, Advanced Cryptography Engine)
that provides instructions for very fast {en,de}cryption
with some algorithms.
that provides instructions for very fast cryptographic
operations with supported algorithms.

The instructions are used only when the CPU supports them.
Otherwise software encryption is used. If you are unsure,
say Y.

config CRYPTO_DEV_PADLOCK_AES
bool "Support for AES in VIA PadLock"
tristate "PadLock driver for AES algorithm"
depends on CRYPTO_DEV_PADLOCK
default y
default m
help
Use VIA PadLock for AES algorithm.

Available in VIA C3 and newer CPUs.

If unsure say M. The compiled module will be
called padlock-aes.ko

endmenu
8 changes: 1 addition & 7 deletions trunk/drivers/crypto/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@

obj-$(CONFIG_CRYPTO_DEV_PADLOCK) += padlock.o

padlock-objs-$(CONFIG_CRYPTO_DEV_PADLOCK_AES) += padlock-aes.o

padlock-objs := padlock-generic.o $(padlock-objs-y)

obj-$(CONFIG_CRYPTO_DEV_PADLOCK_AES) += padlock-aes.o
34 changes: 30 additions & 4 deletions trunk/drivers/crypto/padlock-aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,15 +495,41 @@ static struct crypto_alg aes_alg = {
}
};

int __init padlock_init_aes(void)
static int __init padlock_init(void)
{
printk(KERN_NOTICE PFX "Using VIA PadLock ACE for AES algorithm.\n");
int ret;

if (!cpu_has_xcrypt) {
printk(KERN_ERR PFX "VIA PadLock not detected.\n");
return -ENODEV;
}

if (!cpu_has_xcrypt_enabled) {
printk(KERN_ERR PFX "VIA PadLock detected, but not enabled. Hmm, strange...\n");
return -ENODEV;
}

gen_tabs();
return crypto_register_alg(&aes_alg);
if ((ret = crypto_register_alg(&aes_alg))) {
printk(KERN_ERR PFX "VIA PadLock AES initialization failed.\n");
return ret;
}

printk(KERN_NOTICE PFX "Using VIA PadLock ACE for AES algorithm.\n");

return ret;
}

void __exit padlock_fini_aes(void)
static void __exit padlock_fini(void)
{
crypto_unregister_alg(&aes_alg);
}

module_init(padlock_init);
module_exit(padlock_fini);

MODULE_DESCRIPTION("VIA PadLock AES algorithm support");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Michal Ludvig");

MODULE_ALIAS("aes-padlock");
63 changes: 0 additions & 63 deletions trunk/drivers/crypto/padlock-generic.c

This file was deleted.

0 comments on commit e07a7b9

Please sign in to comment.