diff options
Diffstat (limited to 'contrib/bind9/lib/isc/sha1.c')
-rw-r--r-- | contrib/bind9/lib/isc/sha1.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/contrib/bind9/lib/isc/sha1.c b/contrib/bind9/lib/isc/sha1.c index 0549e88..6f4af6d 100644 --- a/contrib/bind9/lib/isc/sha1.c +++ b/contrib/bind9/lib/isc/sha1.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any @@ -15,16 +15,16 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sha1.c,v 1.10.2.2.2.3 2004/03/06 08:14:35 marka Exp $ */ +/* $Id: sha1.c,v 1.14.18.2 2005/04/29 00:16:49 marka Exp $ */ /* $NetBSD: sha1.c,v 1.5 2000/01/22 22:19:14 mycroft Exp $ */ /* $OpenBSD: sha1.c,v 1.9 1997/07/23 21:12:32 kstailey Exp $ */ -/* +/*! \file * SHA-1 in C - * By Steve Reid <steve@edmweb.com> + * \author By Steve Reid <steve@edmweb.com> * 100% Public Domain - * + * \verbatim * Test Vectors (from FIPS PUB 180-1) * "abc" * A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D @@ -32,6 +32,7 @@ * 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 * A million repetitions of "a" * 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F + * \endverbatim */ #include "config.h" @@ -44,7 +45,8 @@ #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) -/* +/*@{*/ +/*! * blk0() and blk() perform the initial expand. * I got the idea of expanding during the round function from SSLeay */ @@ -61,7 +63,9 @@ ^ block->l[(i + 2) & 15] \ ^ block->l[i & 15], 1)) -/* +/*@}*/ +/*@{*/ +/*! * (R0+R1), R2, R3, R4 are the different operations (rounds) used in SHA1 */ #define R0(v,w,x,y,z,i) \ @@ -80,6 +84,8 @@ z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); \ w = rol(w, 30); +/*@}*/ + typedef union { unsigned char c[64]; unsigned int l[16]; @@ -154,7 +160,7 @@ do_R4(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d, } #endif -/* +/*! * Hash a single 512-bit block. This is the core of the algorithm. */ static void @@ -217,7 +223,7 @@ transform(isc_uint32_t state[5], const unsigned char buffer[64]) { } -/* +/*! * isc_sha1_init - Initialize new context */ void @@ -240,7 +246,7 @@ isc_sha1_invalidate(isc_sha1_t *context) { memset(context, 0, sizeof(isc_sha1_t)); } -/* +/*! * Run your data through this. */ void @@ -270,7 +276,7 @@ isc_sha1_update(isc_sha1_t *context, const unsigned char *data, } -/* +/*! * Add padding and return the message digest. */ |