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

This commit is contained in:
Jouni Malinen 2009-10-17 12:55:12 +03:00
parent 1e8c857abe
commit 08d38568df
5 changed files with 10 additions and 26 deletions

View file

@ -29,19 +29,6 @@
#ifdef CONFIG_TLS_INTERNAL #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 { struct crypto_hash {
enum crypto_hash_alg alg; enum crypto_hash_alg alg;
union { union {

View file

@ -19,11 +19,6 @@
#include "md5_i.h" #include "md5_i.h"
#include "crypto.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]); static void MD5Transform(u32 buf[4], u32 const in[16]);

View file

@ -15,7 +15,11 @@
#ifndef MD5_I_H #ifndef MD5_I_H
#define 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 MD5Init(struct MD5Context *context);
void MD5Update(struct MD5Context *context, unsigned char const *buf, void MD5Update(struct MD5Context *context, unsigned char const *buf,

View file

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

View file

@ -15,7 +15,11 @@
#ifndef SHA1_I_H #ifndef SHA1_I_H
#define 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 SHA1Init(struct SHA1Context *context);
void SHA1Update(struct SHA1Context *context, const void *data, u32 len); void SHA1Update(struct SHA1Context *context, const void *data, u32 len);