summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-09-29 17:18:18 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-09-29 17:18:18 +0000
commit074c29182a8e12b33fee3bc772afdde1fd8fd7e3 (patch)
tree3831156e333418b2fb2b93e4ff0fbf1632bfbb10
parent145c67ff5f5e405af22255876ad04f4368dba16a (diff)
Fixed standalone test mode for NEW_SHA1.
-rw-r--r--lib/libc/hash/sha1.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/libc/hash/sha1.c b/lib/libc/hash/sha1.c
index dd0bac42e3c..706fdbd5a2d 100644
--- a/lib/libc/hash/sha1.c
+++ b/lib/libc/hash/sha1.c
@@ -1,5 +1,5 @@
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: sha1.c,v 1.1 1996/09/29 16:15:05 millert Exp $";
+static char rcsid[] = "$OpenBSD: sha1.c,v 1.2 1996/09/29 17:18:17 millert Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -320,11 +320,19 @@ void main()
sha1Init( &sha1Info );
sha1Update( &sha1Info, ( BYTE * ) "abc", 3 );
sha1Final( &sha1Info );
+#ifdef NEW_SHA1
+ if( sha1Info.digest[ 0 ] != 0xA9993E36L ||
+ sha1Info.digest[ 1 ] != 0x4706816AL ||
+ sha1Info.digest[ 2 ] != 0xBA3E2571L ||
+ sha1Info.digest[ 3 ] != 0x7850C26CL ||
+ sha1Info.digest[ 4 ] != 0x9CD0D89DL )
+#else
if( sha1Info.digest[ 0 ] != 0x0164B8A9L ||
sha1Info.digest[ 1 ] != 0x14CD2A5EL ||
sha1Info.digest[ 2 ] != 0x74C4F7FFL ||
sha1Info.digest[ 3 ] != 0x082C4D97L ||
sha1Info.digest[ 4 ] != 0xF1EDF880L )
+#endif
{
puts( "Error in SHA1 implementation" );
exit( -1 );