Browse Source

sha2: remove including of c-files

Steffen Jaeckel 11 years ago
parent
commit
f3cdac05ec
4 changed files with 11 additions and 12 deletions
  1. 6 0
      src/hashes/sha2/sha224.c
  2. 0 4
      src/hashes/sha2/sha256.c
  3. 5 4
      src/hashes/sha2/sha384.c
  4. 0 4
      src/hashes/sha2/sha512.c

+ 6 - 0
src/hashes/sha2/sha224.c

@@ -13,6 +13,10 @@
    LTC_SHA-224 new NIST standard based off of LTC_SHA-256 truncated to 224 bits (Tom St Denis)
 */
 
+#include "tomcrypt.h"
+
+#if defined(LTC_SHA224) && defined(LTC_SHA256)
+
 const struct ltc_hash_descriptor sha224_desc =
 {
     "sha224",
@@ -119,6 +123,8 @@ int  sha224_test(void)
  #endif
 }
 
+#endif /* defined(LTC_SHA224) && defined(LTC_SHA256) */
+
 
 /* $Source$ */
 /* $Revision$ */

+ 0 - 4
src/hashes/sha2/sha256.c

@@ -327,10 +327,6 @@ int  sha256_test(void)
  #endif
 }
 
-#ifdef LTC_SHA224
-#include "sha224.c"
-#endif
-
 #endif
 
 

+ 5 - 4
src/hashes/sha2/sha384.c

@@ -13,6 +13,10 @@
    LTC_SHA384 hash included in sha512.c, Tom St Denis
 */
 
+#include "tomcrypt.h"
+
+#if defined(LTC_SHA384) && defined(LTC_SHA512)
+
 const struct ltc_hash_descriptor sha384_desc =
 {
     "sha384",
@@ -125,10 +129,7 @@ int  sha384_test(void)
  #endif
 }
 
-
-
-
-
+#endif /* defined(LTC_SHA384) && defined(LTC_SHA512) */
 
 /* $Source$ */
 /* $Revision$ */

+ 0 - 4
src/hashes/sha2/sha512.c

@@ -305,10 +305,6 @@ int  sha512_test(void)
   #endif
 }
 
-#ifdef LTC_SHA384
-   #include "sha384.c"
-#endif
-
 #endif