summaryrefslogtreecommitdiffstats
path: root/crypto/sha1_generic.c
diff options
context:
space:
mode:
authorJan Glauber <jang@de.ibm.com>2007-10-09 22:43:13 +0800
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 16:55:50 -0700
commit5265eeb2b036835021591173ac64e624baaff55c (patch)
tree0263f8e8db4ead27b6e02f3200e3a1305bbf2080 /crypto/sha1_generic.c
parentad5d27899fdbe7a66e57fdf1af883dbd7ff88dac (diff)
downloadlinux-5265eeb2b036835021591173ac64e624baaff55c.tar.gz
linux-5265eeb2b036835021591173ac64e624baaff55c.tar.bz2
linux-5265eeb2b036835021591173ac64e624baaff55c.zip
[CRYPTO] sha: Add header file for SHA definitions
There are currently several SHA implementations that all define their own initialization vectors and size values. Since this values are idential move them to a header file under include/crypto. Signed-off-by: Jan Glauber <jang@de.ibm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/sha1_generic.c')
-rw-r--r--crypto/sha1_generic.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/crypto/sha1_generic.c b/crypto/sha1_generic.c
index 70364dd5c45a..48a3c3e0bf5f 100644
--- a/crypto/sha1_generic.c
+++ b/crypto/sha1_generic.c
@@ -22,12 +22,10 @@
#include <linux/crypto.h>
#include <linux/cryptohash.h>
#include <linux/types.h>
+#include <crypto/sha.h>
#include <asm/scatterlist.h>
#include <asm/byteorder.h>
-#define SHA1_DIGEST_SIZE 20
-#define SHA1_HMAC_BLOCK_SIZE 64
-
struct sha1_ctx {
u64 count;
u32 state[5];
@@ -39,7 +37,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 +109,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,