diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1996-09-29 17:18:18 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1996-09-29 17:18:18 +0000 |
commit | 074c29182a8e12b33fee3bc772afdde1fd8fd7e3 (patch) | |
tree | 3831156e333418b2fb2b93e4ff0fbf1632bfbb10 /lib/libc | |
parent | 145c67ff5f5e405af22255876ad04f4368dba16a (diff) |
Fixed standalone test mode for NEW_SHA1.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/hash/sha1.c | 10 |
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 ); |