]> err.no Git - linux-2.6/blobdiff - arch/s390/crypto/sha1_s390.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[linux-2.6] / arch / s390 / crypto / sha1_s390.c
index af4460ec381f62aede34475b3e9e47fd172329ec..9cf9eca227472f7ab4a50591d68e14353c2b885a 100644 (file)
@@ -12,7 +12,7 @@
  *   Author(s): Thomas Spatzier
  *             Jan Glauber (jan.glauber@de.ibm.com)
  *
- * Derived from "crypto/sha1.c"
+ * Derived from "crypto/sha1_generic.c"
  *   Copyright (c) Alan Smithee.
  *   Copyright (c) Andrew McDonald <andrew@mcdonald.org.uk>
  *   Copyright (c) Jean-Francois Dive <jef@linuxbe.org>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/crypto.h>
+#include <crypto/sha.h>
 
 #include "crypt_s390.h"
 
-#define SHA1_DIGEST_SIZE       20
-#define SHA1_BLOCK_SIZE                64
-
 struct s390_sha1_ctx {
        u64 count;              /* message length */
        u32 state[5];
@@ -42,11 +40,11 @@ static void sha1_init(struct crypto_tfm *tfm)
 {
        struct s390_sha1_ctx *sctx = crypto_tfm_ctx(tfm);
 
-       sctx->state[0] = 0x67452301;
-       sctx->state[1] = 0xEFCDAB89;
-       sctx->state[2] = 0x98BADCFE;
-       sctx->state[3] = 0x10325476;
-       sctx->state[4] = 0xC3D2E1F0;
+       sctx->state[0] = SHA1_H0;
+       sctx->state[1] = SHA1_H1;
+       sctx->state[2] = SHA1_H2;
+       sctx->state[3] = SHA1_H3;
+       sctx->state[4] = SHA1_H4;
        sctx->count = 0;
 }
 
@@ -139,7 +137,7 @@ static struct crypto_alg alg = {
        .dia_final      =       sha1_final } }
 };
 
-static int __init init(void)
+static int __init sha1_s390_init(void)
 {
        if (!crypt_s390_func_available(KIMD_SHA_1))
                return -EOPNOTSUPP;
@@ -147,13 +145,13 @@ static int __init init(void)
        return crypto_register_alg(&alg);
 }
 
-static void __exit fini(void)
+static void __exit sha1_s390_fini(void)
 {
        crypto_unregister_alg(&alg);
 }
 
-module_init(init);
-module_exit(fini);
+module_init(sha1_s390_init);
+module_exit(sha1_s390_fini);
 
 MODULE_ALIAS("sha1");