Commit 5aa9ab0c authored by Pavel Tvrdík's avatar Pavel Tvrdík
Browse files

SHA & MD5 libs: changing headers

parent a41ce27b
Loading
Loading
Loading
Loading
+7 −16
Original line number Diff line number Diff line
/*
 * This code implements the MD5 message-digest algorithm.
 * The algorithm is due to Ron Rivest.  This code was
 * written by Colin Plumb in 1993, no copyright is claimed.
 * This code is in the public domain; do with it what you wish.
 *	BIRD -- MD5 Hash Function and HMAC-MD5 Function
 *
 * Equivalent code is available from RSA Data Security, Inc.
 * This code has been tested against that, and is equivalent,
 * except that you don't need to include two pages of legalese
 * with every copy.
 *	(c) 2015 CZ.NIC z.s.p.o.
 *
 * To compute the message digest of a chunk of bytes, declare an
 * MD5Context structure, pass it to MD5Init, call MD5Update as
 * needed on buffers full of bytes, and then call MD5Final, which
 * will fill a supplied 16-byte array with the digest.
 */

/*
 *	Adapted for BIRD by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
 *
 *	The code was written by Colin Plumb in 1993, no copyright is claimed.
 *
 *	Can be freely distributed and used under the terms of the GNU GPL.
 */

#include "nest/bird.h"
+10 −3
Original line number Diff line number Diff line
#ifndef MD5_H
#define MD5_H
/*
 *	BIRD -- MD5 Hash Function and HMAC-MD5 Function
 *
 *	(c) 2015 CZ.NIC z.s.p.o.
 *
 *	Adapted for BIRD by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
 *
 *	Can be freely distributed and used under the terms of the GNU GPL.
 */

struct MD5Context {
	u32 buf[4];
@@ -13,4 +20,4 @@ void MD5Update(struct MD5Context *context, unsigned char const *buf,
void MD5Final(unsigned char digest[16], struct MD5Context *context);
void MD5Transform(u32 buf[4], u32 const in[16]);

#endif /* !MD5_H */
#endif /* _BIRD_MD5_H_ */
+1 −1
Original line number Diff line number Diff line
/*
 *	BIRD Library -- MD5 message-digest algorithm Tests
 *	BIRD -- MD5 and HMAC-MD5 Tests
 *
 *	(c) 2015 CZ.NIC z.s.p.o.
 *
+5 −1
Original line number Diff line number Diff line
/*
 *	BIRD -- SHA-1 Hash Function (FIPS 180-1, RFC 3174)
 *	BIRD -- SHA-1 Hash Function (FIPS 180-1, RFC 3174) and HMAC-SHA-1
 *
 *	(c) 2015 CZ.NIC z.s.p.o.
 *
@@ -267,6 +267,10 @@ sha1_final(sha1_context *hd)
  return hd->buf;
}

/**
 * 	SHA1-HMAC
 */

/*
 * Shortcut function which puts the hash value of the supplied buffer
 * into outbuf which must have a size of 20 bytes.
+1 −1
Original line number Diff line number Diff line
/*
 *	BIRD -- SHA-1 Hash Function (FIPS 180-1, RFC 3174)
 *	BIRD -- SHA-1 Hash Function (FIPS 180-1, RFC 3174) and HMAC-SHA-1
 *
 *	(c) 2015 CZ.NIC z.s.p.o.
 *
Loading