summaryrefslogtreecommitdiffstats
path: root/libc/stdlib/sha1hash.c
diff options
context:
space:
mode:
authorAndré Goddard Rosa <andre.goddard@gmail.com>2010-02-05 18:32:52 -0200
committerJean-Baptiste Queru <jbq@google.com>2010-04-29 07:29:06 -0700
commite734769276045c0cb89d4620fdd4ef35a0e6c335 (patch)
tree8b7cdc163f1dce70efb9f5221e6e0b845a07c368 /libc/stdlib/sha1hash.c
parent1698d9ebfc7e27271852a1fdf305a2ac37b3ebe4 (diff)
downloadbionic-e734769276045c0cb89d4620fdd4ef35a0e6c335.zip
bionic-e734769276045c0cb89d4620fdd4ef35a0e6c335.tar.gz
bionic-e734769276045c0cb89d4620fdd4ef35a0e6c335.tar.bz2
improve readability of stdlib: fix indentation and remove trailing spaces
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Change-Id: I7dd90a0816b5376ffc1de4499d56935e0bd574a1
Diffstat (limited to 'libc/stdlib/sha1hash.c')
-rw-r--r--libc/stdlib/sha1hash.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/libc/stdlib/sha1hash.c b/libc/stdlib/sha1hash.c
index 28e3399..1c7aaf3 100644
--- a/libc/stdlib/sha1hash.c
+++ b/libc/stdlib/sha1hash.c
@@ -4,7 +4,7 @@ By Steve Reid <sreid@sea-to-sky.net>
100% Public Domain
-----------------
-Modified 7/98
+Modified 7/98
By James H. Brown <jbrown@burgoyne.com>
Still 100% Public Domain
@@ -26,7 +26,7 @@ Since the file IO in main() reads 16K at a time, any file 8K or larger would
be guaranteed to generate the wrong hash (e.g. Test Vector #3, a million
"a"s).
-I also changed the declaration of variables i & j in SHA1Update to
+I also changed the declaration of variables i & j in SHA1Update to
unsigned long from unsigned int for the same reason.
These changes should make no difference to any 32 bit implementations since
@@ -53,7 +53,7 @@ Still 100% public domain
Modified 4/01
By Saul Kravitz <Saul.Kravitz@celera.com>
Still 100% PD
-Modified to run on Compaq Alpha hardware.
+Modified to run on Compaq Alpha hardware.
-----------------
Modified 2/03
@@ -116,7 +116,7 @@ void SHA1Final(unsigned char digest[20], SHA1_CTX* context);
void SHAPrintContext(SHA1_CTX *context, char *msg){
printf("%s (%d,%d) %x %x %x %x %x\n",
msg,
- context->count[0], context->count[1],
+ context->count[0], context->count[1],
context->state[0],
context->state[1],
context->state[2],
@@ -238,8 +238,7 @@ unsigned char finalcount[8];
while ((context->count[0] & 504) != 448) {
SHA1Update(context, (unsigned char *)"\0", 1);
}
- SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform()
-*/
+ SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */
for (i = 0; i < 20; i++) {
digest[i] = (unsigned char)
((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
@@ -254,7 +253,7 @@ unsigned char finalcount[8];
SHA1Transform(context->state, context->buffer);
#endif
}
-
+
/*************************************************************/
/* This is not quite the MIME base64 algorithm: it uses _ instead of /,
@@ -302,7 +301,7 @@ int main(int argc, char** argv)
fputs("Unable to open file.", stderr);
return(-1);
}
- }
+ }
SHA1Init(&context);
while (!feof(file)) { /* note: what if ferror(file) */
i = fread(buffer, 1, 16384, file);