summaryrefslogtreecommitdiff
path: root/crypto/sha1.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/sha1.c')
-rw-r--r--crypto/sha1.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/crypto/sha1.c b/crypto/sha1.c
index 835de18b..a1a216e6 100644
--- a/crypto/sha1.c
+++ b/crypto/sha1.c
@@ -12,7 +12,7 @@
/**
@file sha1.c
- LTC_SHA1 code by Tom St Denis
+ LTC_SHA1 code by Tom St Denis
*/
@@ -66,7 +66,7 @@ static int sha1_compress(hash_state *md, unsigned char *buf)
/* expand it */
for (i = 16; i < 80; i++) {
- W[i] = ROL(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1);
+ W[i] = ROL(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1);
}
/* compress */
@@ -75,9 +75,9 @@ static int sha1_compress(hash_state *md, unsigned char *buf)
#define FF1(a,b,c,d,e,i) e = (ROLc(a, 5) + F1(b,c,d) + e + W[i] + 0x6ed9eba1UL); b = ROLc(b, 30);
#define FF2(a,b,c,d,e,i) e = (ROLc(a, 5) + F2(b,c,d) + e + W[i] + 0x8f1bbcdcUL); b = ROLc(b, 30);
#define FF3(a,b,c,d,e,i) e = (ROLc(a, 5) + F3(b,c,d) + e + W[i] + 0xca62c1d6UL); b = ROLc(b, 30);
-
+
#ifdef LTC_SMALL_CODE
-
+
for (i = 0; i < 20; ) {
FF0(a,b,c,d,e,i++); t = e; e = d; d = c; c = b; b = a; a = t;
}
@@ -105,7 +105,7 @@ static int sha1_compress(hash_state *md, unsigned char *buf)
}
/* round two */
- for (; i < 40; ) {
+ for (; i < 40; ) {
FF1(a,b,c,d,e,i++);
FF1(e,a,b,c,d,i++);
FF1(d,e,a,b,c,i++);
@@ -114,7 +114,7 @@ static int sha1_compress(hash_state *md, unsigned char *buf)
}
/* round three */
- for (; i < 60; ) {
+ for (; i < 60; ) {
FF2(a,b,c,d,e,i++);
FF2(e,a,b,c,d,i++);
FF2(d,e,a,b,c,i++);
@@ -123,7 +123,7 @@ static int sha1_compress(hash_state *md, unsigned char *buf)
}
/* round four */
- for (; i < 80; ) {
+ for (; i < 80; ) {
FF3(a,b,c,d,e,i++);
FF3(e,a,b,c,d,i++);
FF3(d,e,a,b,c,i++);
@@ -241,12 +241,12 @@ int sha1_done(hash_state * md, unsigned char *out)
/**
Self-test the hash
@return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled
-*/
+*/
int sha1_test(void)
{
#ifndef LTC_TEST
return CRYPT_NOP;
- #else
+ #else
static const struct {
char *msg;
unsigned char hash[20];