summaryrefslogtreecommitdiffstats
path: root/arch/s390/crypto/sha1_s390.c
diff options
context:
space:
mode:
authorJan Glauber2007-10-09 16:43:13 +0200
committerDavid S. Miller2007-10-11 01:55:50 +0200
commit5265eeb2b036835021591173ac64e624baaff55c (patch)
tree0263f8e8db4ead27b6e02f3200e3a1305bbf2080 /arch/s390/crypto/sha1_s390.c
parent[CRYPTO] sha: Load the SHA[1|256] module by an alias (diff)
downloadkernel-qcow2-linux-5265eeb2b036835021591173ac64e624baaff55c.tar.gz
kernel-qcow2-linux-5265eeb2b036835021591173ac64e624baaff55c.tar.xz
kernel-qcow2-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 'arch/s390/crypto/sha1_s390.c')
-rw-r--r--arch/s390/crypto/sha1_s390.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/s390/crypto/sha1_s390.c b/arch/s390/crypto/sha1_s390.c
index 8ebd3cd6bd1f..5a834f6578ab 100644
--- a/arch/s390/crypto/sha1_s390.c
+++ b/arch/s390/crypto/sha1_s390.c
@@ -26,12 +26,10 @@
#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;
}