From 5e5c78bfa99a6593a20a7305d9f0427ed0171d0c Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Sun, 28 Oct 2012 23:04:35 +0200 Subject: [PATCH] Move crypto files There will be more, so give them subdirectory. --- Makefile | 6 +++--- doc/mainpage.dox | 7 ++++--- test/compile.c | 2 +- test/test_crypto.c | 6 +++--- usual/{ => crypto}/hmac.c | 4 ++-- usual/{ => crypto}/hmac.h | 6 +++--- usual/{ => crypto}/md5.c | 2 +- usual/{ => crypto}/md5.h | 4 ++-- usual/{ => crypto}/sha1.c | 2 +- usual/{ => crypto}/sha1.h | 4 ++-- 10 files changed, 22 insertions(+), 21 deletions(-) rename usual/{ => crypto}/hmac.c (97%) rename usual/{ => crypto}/hmac.h (93%) rename usual/{ => crypto}/md5.c (99%) rename usual/{ => crypto}/md5.h (96%) rename usual/{ => crypto}/sha1.c (99%) rename usual/{ => crypto}/sha1.h (96%) diff --git a/Makefile b/Makefile index af353aa..9efdbc4 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,9 @@ libusual_la_SOURCES = usual/config.h.in \ usual/cbtree.h usual/cbtree.c \ usual/cfparser.h usual/cfparser.c \ usual/crc32.h usual/crc32.c \ + usual/crypto/hmac.h usual/crypto/hmac.c \ + usual/crypto/md5.h usual/crypto/md5.c \ + usual/crypto/sha1.h usual/crypto/sha1.c \ usual/ctype.h \ usual/cxalloc.h usual/cxalloc.c \ usual/cxextra.h usual/cxextra.c \ @@ -29,12 +32,10 @@ libusual_la_SOURCES = usual/config.h.in \ usual/getopt.h usual/getopt.c \ usual/hashtab-impl.h \ usual/heap.h usual/heap.c \ - usual/hmac.h usual/hmac.c \ usual/list.h usual/list.c \ usual/logging.h usual/logging.c \ usual/lookup3.h usual/lookup3.c \ usual/mbuf.h usual/mbuf.c \ - usual/md5.h usual/md5.c \ usual/mdict.h usual/mdict.c \ usual/mempool.h usual/mempool.c \ usual/misc.h \ @@ -43,7 +44,6 @@ libusual_la_SOURCES = usual/config.h.in \ usual/pthread.h usual/pthread.c \ usual/regex.h usual/regex.c \ usual/safeio.h usual/safeio.c \ - usual/sha1.h usual/sha1.c \ usual/shlist.h \ usual/signal.h usual/signal.c \ usual/slab.h usual/slab.c \ diff --git a/doc/mainpage.dox b/doc/mainpage.dox index 9a52091..d2eac13 100644 --- a/doc/mainpage.dox +++ b/doc/mainpage.dox @@ -57,14 +57,15 @@ * Config parser * CRC32 * Endianess conversion - * HMAC-SHA1 * Jenkins' lookup3 hash * Misc arithmetic - * MD5 hash - * SHA1 hash * POSIX regex compat * PostgreSQL data formats * Low-level UTF8 handling + * Cryptography + * HMAC-SHA1 + * MD5 hash + * SHA1 hash * Memory Allocation * Context Allocator framework * Extra allocators diff --git a/test/compile.c b/test/compile.c index a306513..ac1c76b 100644 --- a/test/compile.c +++ b/test/compile.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include //#include #include diff --git a/test/test_crypto.c b/test/test_crypto.c index 5c9fa25..3b0cdd1 100644 --- a/test/test_crypto.c +++ b/test/test_crypto.c @@ -6,9 +6,9 @@ #define str_check(a, b) tt_str_op(a, ==, b) -#include -#include -#include +#include +#include +#include static const char *mkhex(const uint8_t *src, int len) { diff --git a/usual/hmac.c b/usual/crypto/hmac.c similarity index 97% rename from usual/hmac.c rename to usual/crypto/hmac.c index 732f46e..c2990e3 100644 --- a/usual/hmac.c +++ b/usual/crypto/hmac.c @@ -16,8 +16,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include +#include +#include #include diff --git a/usual/hmac.h b/usual/crypto/hmac.h similarity index 93% rename from usual/hmac.h rename to usual/crypto/hmac.h index 09b20b4..0c7296f 100644 --- a/usual/hmac.h +++ b/usual/crypto/hmac.h @@ -21,12 +21,12 @@ * HMAC-SHA1 implementation (RFC2104). */ -#ifndef _USUAL_HMAC_H_ -#define _USUAL_HMAC_H_ +#ifndef _USUAL_CRYPTO_HMAC_H_ +#define _USUAL_CRYPTO_HMAC_H_ #include -#include +#include /** HMAC-SHA1 Context */ struct hmac_sha1_ctx { diff --git a/usual/md5.c b/usual/crypto/md5.c similarity index 99% rename from usual/md5.c rename to usual/crypto/md5.c index bb3ef4e..5621112 100644 --- a/usual/md5.c +++ b/usual/crypto/md5.c @@ -16,7 +16,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include #include #include diff --git a/usual/md5.h b/usual/crypto/md5.h similarity index 96% rename from usual/md5.h rename to usual/crypto/md5.h index 4ba03f3..dde433d 100644 --- a/usual/md5.h +++ b/usual/crypto/md5.h @@ -22,8 +22,8 @@ * MD5 cryptographic hash. */ -#ifndef _USUAL_MD5_H_ -#define _USUAL_MD5_H_ +#ifndef _USUAL_CRYPTO_MD5_H_ +#define _USUAL_CRYPTO_MD5_H_ #include diff --git a/usual/sha1.c b/usual/crypto/sha1.c similarity index 99% rename from usual/sha1.c rename to usual/crypto/sha1.c index eea7c8a..50df215 100644 --- a/usual/sha1.c +++ b/usual/crypto/sha1.c @@ -16,7 +16,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include #include #include diff --git a/usual/sha1.h b/usual/crypto/sha1.h similarity index 96% rename from usual/sha1.h rename to usual/crypto/sha1.h index 09dbdf3..76b6f9d 100644 --- a/usual/sha1.h +++ b/usual/crypto/sha1.h @@ -22,8 +22,8 @@ * SHA1 implementation. */ -#ifndef _USUAL_SHA1_H_ -#define _USUAL_SHA1_H_ +#ifndef _USUAL_CRYPTO_SHA1_H_ +#define _USUAL_CRYPTO_SHA1_H_ #include -- 2.39.5