Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34219
b: refs/heads/master
c: 5644bda
h: refs/heads/master
i:
  34217: 7081e5c
  34215: ff5c3fd
v: v3
  • Loading branch information
Michal Ludvig authored and Herbert Xu committed Sep 21, 2006
1 parent f4ffddb commit 797fa2e
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 8 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: cb17530b0a4e01bd595a7ac437467a1a9833a15c
refs/heads/master: 5644bda5d6aa17a70b8842eb56365d501a5da159
17 changes: 13 additions & 4 deletions trunk/drivers/crypto/Kconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
menu "Hardware crypto devices"

config CRYPTO_DEV_PADLOCK
bool "Support for VIA PadLock ACE"
tristate "Support for VIA PadLock ACE"
depends on X86_32
select CRYPTO_ALGAPI
default y
default m
help
Some VIA processors come with an integrated crypto engine
(so called VIA PadLock ACE, Advanced Cryptography Engine)
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.
Otherwise software encryption is used.

Selecting M for this option will compile a helper module
padlock.ko that should autoload all below configured
algorithms. Don't worry if your hardware does not support
some or all of them. In such case padlock.ko will
simply write a single line into the kernel log informing
about its failure but everything will keep working fine.

If you are unsure, say M. The compiled module will be
called padlock.ko

config CRYPTO_DEV_PADLOCK_AES
tristate "PadLock driver for AES algorithm"
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/crypto/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
obj-$(CONFIG_CRYPTO_DEV_PADLOCK) += padlock.o
obj-$(CONFIG_CRYPTO_DEV_PADLOCK_AES) += padlock-aes.o
obj-$(CONFIG_CRYPTO_DEV_PADLOCK_SHA) += padlock-sha.o
3 changes: 0 additions & 3 deletions trunk/drivers/crypto/padlock-aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,3 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR("Michal Ludvig");

MODULE_ALIAS("aes-padlock");

/* This module used to be called padlock. */
MODULE_ALIAS("padlock");
58 changes: 58 additions & 0 deletions trunk/drivers/crypto/padlock.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Cryptographic API.
*
* Support for VIA PadLock hardware crypto engine.
*
* Copyright (c) 2006 Michal Ludvig <michal@logix.cz>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*/

#include <linux/module.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/crypto.h>
#include <linux/cryptohash.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/scatterlist.h>
#include "padlock.h"

static int __init padlock_init(void)
{
int success = 0;

if (crypto_alg_available("aes-padlock", 0))
success++;

if (crypto_alg_available("sha1-padlock", 0))
success++;

if (crypto_alg_available("sha256-padlock", 0))
success++;

if (!success) {
printk(KERN_WARNING PFX "No VIA PadLock drivers have been loaded.\n");
return -ENODEV;
}

printk(KERN_NOTICE PFX "%d drivers are available.\n", success);

return 0;
}

static void __exit padlock_fini(void)
{
}

module_init(padlock_init);
module_exit(padlock_fini);

MODULE_DESCRIPTION("Load all configured PadLock algorithms.");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Michal Ludvig");

0 comments on commit 797fa2e

Please sign in to comment.