mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-23 17:31:55 +00:00
SHA & MD5 libs: changing headers
This commit is contained in:
parent
a41ce27bf7
commit
5aa9ab0cfd
21
lib/md5.c
21
lib/md5.c
@ -1,22 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* This code implements the MD5 message-digest algorithm.
|
* BIRD -- MD5 Hash Function and HMAC-MD5 Function
|
||||||
* 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.
|
|
||||||
*
|
*
|
||||||
* Equivalent code is available from RSA Data Security, Inc.
|
* (c) 2015 CZ.NIC z.s.p.o.
|
||||||
* 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.
|
|
||||||
*
|
*
|
||||||
* 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"
|
#include "nest/bird.h"
|
||||||
|
13
lib/md5.h
13
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 {
|
struct MD5Context {
|
||||||
u32 buf[4];
|
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 MD5Final(unsigned char digest[16], struct MD5Context *context);
|
||||||
void MD5Transform(u32 buf[4], u32 const in[16]);
|
void MD5Transform(u32 buf[4], u32 const in[16]);
|
||||||
|
|
||||||
#endif /* !MD5_H */
|
#endif /* _BIRD_MD5_H_ */
|
||||||
|
@ -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.
|
* (c) 2015 CZ.NIC z.s.p.o.
|
||||||
*
|
*
|
||||||
|
@ -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.
|
* (c) 2015 CZ.NIC z.s.p.o.
|
||||||
*
|
*
|
||||||
@ -267,6 +267,10 @@ sha1_final(sha1_context *hd)
|
|||||||
return hd->buf;
|
return hd->buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SHA1-HMAC
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shortcut function which puts the hash value of the supplied buffer
|
* Shortcut function which puts the hash value of the supplied buffer
|
||||||
* into outbuf which must have a size of 20 bytes.
|
* into outbuf which must have a size of 20 bytes.
|
||||||
|
@ -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.
|
* (c) 2015 CZ.NIC z.s.p.o.
|
||||||
*
|
*
|
||||||
|
@ -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.
|
* (c) 2015 CZ.NIC z.s.p.o.
|
||||||
*
|
*
|
||||||
|
@ -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.
|
* (c) 2015 CZ.NIC z.s.p.o.
|
||||||
*
|
*
|
||||||
|
@ -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.
|
* (c) 2015 CZ.NIC z.s.p.o.
|
||||||
*
|
*
|
||||||
|
@ -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.
|
* (c) 2015 CZ.NIC z.s.p.o.
|
||||||
*
|
*
|
||||||
|
@ -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.
|
* (c) 2015 CZ.NIC z.s.p.o.
|
||||||
*
|
*
|
||||||
|
@ -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.
|
* (c) 2015 CZ.NIC z.s.p.o.
|
||||||
*
|
*
|
||||||
|
@ -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.
|
* (c) 2015 CZ.NIC z.s.p.o.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user