From 08d38568df4b5c36997c5b2615064979fb89b16f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 17 Oct 2009 12:55:12 +0300 Subject: [PATCH] Move shared MD5/SHA-1 internal definitions into header files --- src/crypto/crypto_internal.c | 13 ------------- src/crypto/md5-internal.c | 5 ----- src/crypto/md5_i.h | 6 +++++- src/crypto/sha1-internal.c | 6 ------ src/crypto/sha1_i.h | 6 +++++- 5 files changed, 10 insertions(+), 26 deletions(-) diff --git a/src/crypto/crypto_internal.c b/src/crypto/crypto_internal.c index 41ec8bce3..34b43aedb 100644 --- a/src/crypto/crypto_internal.c +++ b/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 { diff --git a/src/crypto/md5-internal.c b/src/crypto/md5-internal.c index d58bbde9a..f8692a955 100644 --- a/src/crypto/md5-internal.c +++ b/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]); diff --git a/src/crypto/md5_i.h b/src/crypto/md5_i.h index 7697c3fe6..b7f659605 100644 --- a/src/crypto/md5_i.h +++ b/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, diff --git a/src/crypto/sha1-internal.c b/src/crypto/sha1-internal.c index dfe894094..51e612136 100644 --- a/src/crypto/sha1-internal.c +++ b/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]); diff --git a/src/crypto/sha1_i.h b/src/crypto/sha1_i.h index e4b3a968b..ec2f82f75 100644 --- a/src/crypto/sha1_i.h +++ b/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);