Commit 075c2675 authored by Eric Rost's avatar Eric Rost Committed by Greg Kroah-Hartman

staging: skein: Adds Loadable Module Support

Adds loadable module support to the Skein Hashing Algorithm driver.
Signed-off-by: default avatarEric Rost <eric.rost@mybabylon.net>
Reviewed-by: default avatarJason Cooper <jason@lakedaemon.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f96d8ced
config CRYPTO_SKEIN config CRYPTO_SKEIN
bool "Skein digest algorithm" tristate "Skein digest algorithm"
depends on (X86 || UML_X86) && 64BIT && CRYPTO depends on (X86 || UML_X86) && 64BIT && CRYPTO
select CRYPTO_HASH select CRYPTO_HASH
select CRYPTO_ALGAPI select CRYPTO_ALGAPI
......
# #
# Makefile for the skein secure hash algorithm # Makefile for the skein secure hash algorithm
# #
obj-$(CONFIG_CRYPTO_SKEIN) += skein_base.o \ obj-$(CONFIG_CRYPTO_SKEIN) += skein.o
skein_api.o \ skein-y := skein_base.o \
skein_block.o \ skein_api.o \
threefish_block.o \ skein_block.o \
threefish_api.o \ threefish_block.o \
skein_generic.o threefish_api.o \
skein_generic.o
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h>
#include <crypto/internal/hash.h> #include <crypto/internal/hash.h>
#include "skein_base.h" #include "skein_base.h"
...@@ -139,6 +140,7 @@ static struct shash_alg alg256 = { ...@@ -139,6 +140,7 @@ static struct shash_alg alg256 = {
.cra_driver_name = "skein", .cra_driver_name = "skein",
.cra_flags = CRYPTO_ALG_TYPE_SHASH, .cra_flags = CRYPTO_ALG_TYPE_SHASH,
.cra_blocksize = SKEIN_256_BLOCK_BYTES, .cra_blocksize = SKEIN_256_BLOCK_BYTES,
.cra_module = THIS_MODULE,
} }
}; };
...@@ -156,6 +158,7 @@ static struct shash_alg alg512 = { ...@@ -156,6 +158,7 @@ static struct shash_alg alg512 = {
.cra_driver_name = "skein", .cra_driver_name = "skein",
.cra_flags = CRYPTO_ALG_TYPE_SHASH, .cra_flags = CRYPTO_ALG_TYPE_SHASH,
.cra_blocksize = SKEIN_512_BLOCK_BYTES, .cra_blocksize = SKEIN_512_BLOCK_BYTES,
.cra_module = THIS_MODULE,
} }
}; };
...@@ -173,6 +176,7 @@ static struct shash_alg alg1024 = { ...@@ -173,6 +176,7 @@ static struct shash_alg alg1024 = {
.cra_driver_name = "skein", .cra_driver_name = "skein",
.cra_flags = CRYPTO_ALG_TYPE_SHASH, .cra_flags = CRYPTO_ALG_TYPE_SHASH,
.cra_blocksize = SKEIN_1024_BLOCK_BYTES, .cra_blocksize = SKEIN_1024_BLOCK_BYTES,
.cra_module = THIS_MODULE,
} }
}; };
...@@ -196,4 +200,17 @@ static int __init skein_generic_init(void) ...@@ -196,4 +200,17 @@ static int __init skein_generic_init(void)
return -1; return -1;
} }
device_initcall(skein_generic_init); static void __exit skein_generic_fini(void)
{
crypto_unregister_shash(&alg256);
crypto_unregister_shash(&alg512);
crypto_unregister_shash(&alg1024);
}
module_init(skein_generic_init);
module_exit(skein_generic_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Skein Hash Algorithm");
MODULE_ALIAS("skein");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment