]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
SHA & MD5 libs: changing headers
authorPavel Tvrdík <pawel.tvrdik@gmail.cz>
Wed, 13 May 2015 07:27:44 +0000 (09:27 +0200)
committerPavel Tvrdík <pawel.tvrdik@gmail.cz>
Wed, 13 May 2015 07:27:44 +0000 (09:27 +0200)
12 files changed:
lib/md5.c
lib/md5.h
lib/md5_test.c
lib/sha1.c
lib/sha1.h
lib/sha1_test.c
lib/sha256.c
lib/sha256.h
lib/sha256_test.c
lib/sha512.c
lib/sha512.h
lib/sha512_test.c

index ad284f07fdd589d733f9b5e101547bf543c8c4ca..0a354b872d7ae9d46f77b18a93c3987df87ae08c 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -1,22 +1,13 @@
 /*
- * 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"
index 1258635710188913e6954d961358152986257133..fbcd2bf4b605a069a84919b841b1ebd5ad385746 100644 (file)
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -1,5 +1,12 @@
-#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_ */
index 10da0c4d25da007a786d298fc7bea547b6515325..f95a62f934b3c78aae7cd2e61a2dec142d20e6e0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     BIRD Library -- MD5 message-digest algorithm Tests
+ *     BIRD -- MD5 and HMAC-MD5 Tests
  *
  *     (c) 2015 CZ.NIC z.s.p.o.
  *
index fff37ff6fa0800a16a3ee71a7284c68b230ff790..2f10479d32f851df4a64ddca55bfc824c92b2ec8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     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.
index 78023b7201f8dad966d3734d01521914e27273ea..9600e61f480ca982cb5df884aaf793809508a3f0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     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.
  *
index d33c419f25e36581767846235569763a265c7182..04b2daa34bf2b40c87b45c102e65da62509b5de5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     BIRD Library -- SHA-1 Hash Function Tests
+ *     BIRD -- SHA-1 and HMAC-SHA-1 Tests
  *
  *     (c) 2015 CZ.NIC z.s.p.o.
  *
index 84fcc737e8fb968b4288c8f57aa926722e5ba882..4025c6a0c9ab60c7fbf76b84db3724f0115209aa 100644 (file)
@@ -1,5 +1,6 @@
 /*
- *     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.
  *
index 682cab13f8df45f9572b99ea05b563a1d900572b..44e4a6d017854a754a4892996de7b30aac9b76b5 100644 (file)
@@ -1,5 +1,6 @@
 /*
- *     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.
  *
index 9ef2f8c3cfa2fa329aab2d17b7d114885224e95d..80047e469b2fed0e14c8fa1ef9ca8022c970e536 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     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.
  *
index 69bcd09965fb5f6af24f0986368c03e33480db46..e917eb9892f40f331862ce1cd43b471e638f140b 100644 (file)
@@ -1,5 +1,6 @@
 /*
- *     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.
  *
index 369d97b04f1fcff63dd8bcdd8b2e84d0c1915796..e37bbcb6a7f9f9bcea70a5fd74cb1348023e428b 100644 (file)
@@ -1,5 +1,6 @@
 /*
- *     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.
  *
index d0a5d9c53a111e1d0598b458ebf53e414233aec3..b6a0fe5c3719b2073459d04eaa84a01e58d69a63 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     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.
  *