Browse Source

Move shared MD5/SHA-1 internal definitions into header files

Jouni Malinen 15 years ago
parent
commit
08d38568df
5 changed files with 10 additions and 26 deletions
  1. 0 13
      src/crypto/crypto_internal.c
  2. 0 5
      src/crypto/md5-internal.c
  3. 5 1
      src/crypto/md5_i.h
  4. 0 6
      src/crypto/sha1-internal.c
  5. 5 1
      src/crypto/sha1_i.h

+ 0 - 13
src/crypto/crypto_internal.c

@@ -29,19 +29,6 @@
 
 #ifdef CONFIG_TLS_INTERNAL
 
-struct MD5Context {
-	u32 buf[4];
-	u32 bits[2];
-	u8 in[64];
-};
-
-struct SHA1Context {
-	u32 state[5];
-	u32 count[2];
-	unsigned char buffer[64];
-};
-
-
 struct crypto_hash {
 	enum crypto_hash_alg alg;
 	union {

+ 0 - 5
src/crypto/md5-internal.c

@@ -19,11 +19,6 @@
 #include "md5_i.h"
 #include "crypto.h"
 
-struct MD5Context {
-	u32 buf[4];
-	u32 bits[2];
-	u8 in[64];
-};
 
 static void MD5Transform(u32 buf[4], u32 const in[16]);
 

+ 5 - 1
src/crypto/md5_i.h

@@ -15,7 +15,11 @@
 #ifndef MD5_I_H
 #define MD5_I_H
 
-struct MD5Context;
+struct MD5Context {
+	u32 buf[4];
+	u32 bits[2];
+	u8 in[64];
+};
 
 void MD5Init(struct MD5Context *context);
 void MD5Update(struct MD5Context *context, unsigned char const *buf,

+ 0 - 6
src/crypto/sha1-internal.c

@@ -20,12 +20,6 @@
 #include "md5.h"
 #include "crypto.h"
 
-struct SHA1Context {
-	u32 state[5];
-	u32 count[2];
-	unsigned char buffer[64];
-};
-
 typedef struct SHA1Context SHA1_CTX;
 
 void SHA1Transform(u32 state[5], const unsigned char buffer[64]);

+ 5 - 1
src/crypto/sha1_i.h

@@ -15,7 +15,11 @@
 #ifndef SHA1_I_H
 #define SHA1_I_H
 
-struct SHA1Context;
+struct SHA1Context {
+	u32 state[5];
+	u32 count[2];
+	unsigned char buffer[64];
+};
 
 void SHA1Init(struct SHA1Context *context);
 void SHA1Update(struct SHA1Context *context, const void *data, u32 len);