/*
- * 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>
+ * 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"
-#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];
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_ */
/*
- * BIRD Library -- MD5 message-digest algorithm Tests
+ * BIRD -- MD5 and HMAC-MD5 Tests
*
* (c) 2015 CZ.NIC z.s.p.o.
*
/*
- * 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.
*
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.
/*
- * 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.
*
/*
- * BIRD Library -- SHA-1 Hash Function Tests
+ * BIRD -- SHA-1 and HMAC-SHA-1 Tests
*
* (c) 2015 CZ.NIC z.s.p.o.
*
/*
- * BIRD -- SHA256 and SHA224 Hash Functions
+ * BIRD -- SHA-256 and SHA-224 Hash Functions,
+ * HMAC-SHA-256 and HMAC-SHA-224 Functions
*
* (c) 2015 CZ.NIC z.s.p.o.
*
/*
- * BIRD -- SHA256 and SHA224 Hash Functions
+ * BIRD -- SHA-256 and SHA-224 Hash Functions,
+ * HMAC-SHA-256 and HMAC-SHA-224 Functions
*
* (c) 2015 CZ.NIC z.s.p.o.
*
/*
- * BIRD Library -- SHA256 and SHA224 Hash Functions Tests
+ * BIRD -- SHA-256, SHA-224, HMAC-SHA-256 and HMAC-SHA224 Tests
*
* (c) 2015 CZ.NIC z.s.p.o.
*
/*
- * BIRD -- SHA512 and SHA384 Hash Functions
+ * BIRD -- SHA-512 and SHA-384 Hash Functions,
+ * HMAC-SHA-512 and HMAC-SHA-384 Functions
*
* (c) 2015 CZ.NIC z.s.p.o.
*
/*
- * BIRD -- SHA512 and SHA384 Hash Functions
+ * BIRD -- SHA-512 and SHA-384 Hash Functions,
+ * HMAC-SHA-512 and HMAC-SHA-384 Functions
*
* (c) 2015 CZ.NIC z.s.p.o.
*
/*
- * BIRD Library -- SHA512 and SHA384 Hash Functions Tests
+ * BIRD -- SHA-512, SHA-384, HMAC-SHA-512 and HMAC-SHA-384 Tests
*
* (c) 2015 CZ.NIC z.s.p.o.
*