X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=crypto%2Fsha1_generic.c;h=c7c6899e1fca8efb0ce9af81c42747f180203ed7;hb=4ade1742fb39a43a8b29055d499591c7cace4aa4;hp=70364dd5c45a84d9d0d9263b558916d982285f01;hpb=ad5d27899fdbe7a66e57fdf1af883dbd7ff88dac;p=linux-2.6-omap-h63xx.git diff --git a/crypto/sha1_generic.c b/crypto/sha1_generic.c index 70364dd5c45..c7c6899e1fc 100644 --- a/crypto/sha1_generic.c +++ b/crypto/sha1_generic.c @@ -22,12 +22,9 @@ #include #include #include -#include +#include #include -#define SHA1_DIGEST_SIZE 20 -#define SHA1_HMAC_BLOCK_SIZE 64 - struct sha1_ctx { u64 count; u32 state[5]; @@ -39,7 +36,7 @@ static void sha1_init(struct crypto_tfm *tfm) struct sha1_ctx *sctx = crypto_tfm_ctx(tfm); static const struct sha1_ctx initstate = { 0, - { 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 }, + { SHA1_H0, SHA1_H1, SHA1_H2, SHA1_H3, SHA1_H4 }, { 0, } }; @@ -111,7 +108,7 @@ static struct crypto_alg alg = { .cra_name = "sha1", .cra_driver_name= "sha1-generic", .cra_flags = CRYPTO_ALG_TYPE_DIGEST, - .cra_blocksize = SHA1_HMAC_BLOCK_SIZE, + .cra_blocksize = SHA1_BLOCK_SIZE, .cra_ctxsize = sizeof(struct sha1_ctx), .cra_module = THIS_MODULE, .cra_alignmask = 3, @@ -123,18 +120,18 @@ static struct crypto_alg alg = { .dia_final = sha1_final } } }; -static int __init init(void) +static int __init sha1_generic_mod_init(void) { return crypto_register_alg(&alg); } -static void __exit fini(void) +static void __exit sha1_generic_mod_fini(void) { crypto_unregister_alg(&alg); } -module_init(init); -module_exit(fini); +module_init(sha1_generic_mod_init); +module_exit(sha1_generic_mod_fini); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm");