From 111518dde5d1544b3d103d7f11000b28f78aaa09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Sun, 2 Dec 2012 21:39:33 +0100
Subject: [PATCH] Replaced all internal usage of sha.h.

---
 ChangeLog                   | 3 ++-
 dsa.h                       | 3 ++-
 examples/nettle-benchmark.c | 3 ++-
 hmac.h                      | 3 ++-
 rsa.h                       | 3 ++-
 sha-example.c               | 2 +-
 sha1-compress.c             | 2 +-
 sha1-meta.c                 | 2 +-
 sha1.c                      | 2 +-
 sha224-meta.c               | 2 +-
 sha256-compress.c           | 2 +-
 sha256-meta.c               | 2 +-
 sha256.c                    | 2 +-
 sha384-meta.c               | 2 +-
 sha512-compress.c           | 2 +-
 sha512-meta.c               | 2 +-
 sha512.c                    | 2 +-
 testsuite/pbkdf2-test.c     | 1 -
 testsuite/sha1-huge-test.c  | 1 -
 testsuite/sha1-test.c       | 1 -
 testsuite/sha224-test.c     | 1 -
 testsuite/sha256-test.c     | 1 -
 testsuite/sha384-test.c     | 1 -
 testsuite/sha512-test.c     | 1 -
 yarrow.h                    | 2 +-
 25 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3c1c92a8..07905606 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2012-12-02  Niels Möller  <nisse@lysator.liu.se>
 
-	Split sha.h into new files sha1.h and sha2.h.
+	Split sha.h into new files sha1.h and sha2.h. Replaced all
+	internal usage of sha.h in all files.
 	* sha.h: Kept for compatibility, just includes both new files.
 	* sha1.h: New file.
 	* sha2.h: New file.
diff --git a/dsa.h b/dsa.h
index 1a974646..7ee26249 100644
--- a/dsa.h
+++ b/dsa.h
@@ -30,7 +30,8 @@
 
 #include "nettle-types.h"
 
-#include "sha.h"
+#include "sha1.h"
+#include "sha2.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/examples/nettle-benchmark.c b/examples/nettle-benchmark.c
index d3da1bca..7b0171c5 100644
--- a/examples/nettle-benchmark.c
+++ b/examples/nettle-benchmark.c
@@ -49,7 +49,8 @@
 #include "memxor.h"
 #include "salsa20.h"
 #include "serpent.h"
-#include "sha.h"
+#include "sha1.h"
+#include "sha2.h"
 #include "sha3.h"
 #include "twofish.h"
 
diff --git a/hmac.h b/hmac.h
index 6cb2b746..c6cb0e06 100644
--- a/hmac.h
+++ b/hmac.h
@@ -30,7 +30,8 @@
 
 #include "md5.h"
 #include "ripemd160.h"
-#include "sha.h"
+#include "sha1.h"
+#include "sha2.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/rsa.h b/rsa.h
index 861101b9..4226f389 100644
--- a/rsa.h
+++ b/rsa.h
@@ -30,7 +30,8 @@
 #include "nettle-types.h"
 
 #include "md5.h"
-#include "sha.h"
+#include "sha1.h"
+#include "sha2.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sha-example.c b/sha-example.c
index 8b3d5059..dcd889c7 100644
--- a/sha-example.c
+++ b/sha-example.c
@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <nettle/sha.h>
+#include <nettle/sha1.h>
 
 #define BUF_SIZE 1000
 
diff --git a/sha1-compress.c b/sha1-compress.c
index d1961744..afdfe8e8 100644
--- a/sha1-compress.c
+++ b/sha1-compress.c
@@ -55,7 +55,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "sha.h"
+#include "sha1.h"
 
 #include "macros.h"
 
diff --git a/sha1-meta.c b/sha1-meta.c
index 9a051bda..60c2bb58 100644
--- a/sha1-meta.c
+++ b/sha1-meta.c
@@ -26,7 +26,7 @@
 
 #include "nettle-meta.h"
 
-#include "sha.h"
+#include "sha1.h"
 
 const struct nettle_hash nettle_sha1
 = _NETTLE_HASH(sha1, SHA1);
diff --git a/sha1.c b/sha1.c
index 95ec418a..dc52be22 100644
--- a/sha1.c
+++ b/sha1.c
@@ -44,7 +44,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "sha.h"
+#include "sha1.h"
 
 #include "macros.h"
 #include "nettle-write.h"
diff --git a/sha224-meta.c b/sha224-meta.c
index 8c6d9fbc..27b29102 100644
--- a/sha224-meta.c
+++ b/sha224-meta.c
@@ -26,7 +26,7 @@
 
 #include "nettle-meta.h"
 
-#include "sha.h"
+#include "sha2.h"
 
 const struct nettle_hash nettle_sha224
 = _NETTLE_HASH(sha224, SHA224);
diff --git a/sha256-compress.c b/sha256-compress.c
index 7d449297..3f441e81 100644
--- a/sha256-compress.c
+++ b/sha256-compress.c
@@ -31,7 +31,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "sha.h"
+#include "sha2.h"
 
 #include "macros.h"
 
diff --git a/sha256-meta.c b/sha256-meta.c
index 65923103..5c882b7b 100644
--- a/sha256-meta.c
+++ b/sha256-meta.c
@@ -26,7 +26,7 @@
 
 #include "nettle-meta.h"
 
-#include "sha.h"
+#include "sha2.h"
 
 const struct nettle_hash nettle_sha256
 = _NETTLE_HASH(sha256, SHA256);
diff --git a/sha256.c b/sha256.c
index dee55d9d..47995979 100644
--- a/sha256.c
+++ b/sha256.c
@@ -35,7 +35,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "sha.h"
+#include "sha2.h"
 
 #include "macros.h"
 #include "nettle-write.h"
diff --git a/sha384-meta.c b/sha384-meta.c
index 18603443..e5a7ab3f 100644
--- a/sha384-meta.c
+++ b/sha384-meta.c
@@ -26,7 +26,7 @@
 
 #include "nettle-meta.h"
 
-#include "sha.h"
+#include "sha2.h"
 
 const struct nettle_hash nettle_sha384
 = _NETTLE_HASH(sha384, SHA384);
diff --git a/sha512-compress.c b/sha512-compress.c
index 901b6cf4..9dd34f4c 100644
--- a/sha512-compress.c
+++ b/sha512-compress.c
@@ -31,7 +31,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "sha.h"
+#include "sha2.h"
 
 #include "macros.h"
 
diff --git a/sha512-meta.c b/sha512-meta.c
index cfc485d3..cb62762c 100644
--- a/sha512-meta.c
+++ b/sha512-meta.c
@@ -26,7 +26,7 @@
 
 #include "nettle-meta.h"
 
-#include "sha.h"
+#include "sha2.h"
 
 const struct nettle_hash nettle_sha512
 = _NETTLE_HASH(sha512, SHA512);
diff --git a/sha512.c b/sha512.c
index d39137ad..95623cb7 100644
--- a/sha512.c
+++ b/sha512.c
@@ -35,7 +35,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "sha.h"
+#include "sha2.h"
 
 #include "macros.h"
 
diff --git a/testsuite/pbkdf2-test.c b/testsuite/pbkdf2-test.c
index ffb55807..e3cf9539 100644
--- a/testsuite/pbkdf2-test.c
+++ b/testsuite/pbkdf2-test.c
@@ -1,6 +1,5 @@
 #include "testutils.h"
 #include "hmac.h"
-#include "sha.h"
 #include "pbkdf2.h"
 
 /* NOTE: The salt argument is expected to expand to length, data */
diff --git a/testsuite/sha1-huge-test.c b/testsuite/sha1-huge-test.c
index 6557eadc..156a762a 100644
--- a/testsuite/sha1-huge-test.c
+++ b/testsuite/sha1-huge-test.c
@@ -1,5 +1,4 @@
 #include "testutils.h"
-#include "sha.h"
 
 void
 test_main(void)
diff --git a/testsuite/sha1-test.c b/testsuite/sha1-test.c
index 5f39c0fc..8356555b 100644
--- a/testsuite/sha1-test.c
+++ b/testsuite/sha1-test.c
@@ -1,5 +1,4 @@
 #include "testutils.h"
-#include "sha.h"
 
 void
 test_main(void)
diff --git a/testsuite/sha224-test.c b/testsuite/sha224-test.c
index 8a001007..eb20c300 100644
--- a/testsuite/sha224-test.c
+++ b/testsuite/sha224-test.c
@@ -1,5 +1,4 @@
 #include "testutils.h"
-#include "sha.h"
 
 void
 test_main(void)
diff --git a/testsuite/sha256-test.c b/testsuite/sha256-test.c
index 43adcc2b..e625c56d 100644
--- a/testsuite/sha256-test.c
+++ b/testsuite/sha256-test.c
@@ -1,5 +1,4 @@
 #include "testutils.h"
-#include "sha.h"
 
 void
 test_main(void)
diff --git a/testsuite/sha384-test.c b/testsuite/sha384-test.c
index 7b94fa48..13a02144 100644
--- a/testsuite/sha384-test.c
+++ b/testsuite/sha384-test.c
@@ -1,5 +1,4 @@
 #include "testutils.h"
-#include "sha.h"
 
 void
 test_main(void)
diff --git a/testsuite/sha512-test.c b/testsuite/sha512-test.c
index 490935b8..853d5b82 100644
--- a/testsuite/sha512-test.c
+++ b/testsuite/sha512-test.c
@@ -1,5 +1,4 @@
 #include "testutils.h"
-#include "sha.h"
 
 void
 test_main(void)
diff --git a/yarrow.h b/yarrow.h
index e2b5aadd..8a0de5f6 100644
--- a/yarrow.h
+++ b/yarrow.h
@@ -27,7 +27,7 @@
 #define NETTLE_YARROW_H_INCLUDED
 
 #include "aes.h"
-#include "sha.h"
+#include "sha2.h"
 
 #ifdef __cplusplus
 extern "C" {
-- 
GitLab