summaryrefslogtreecommitdiffstats
path: root/src/crypto
diff options
context:
space:
mode:
authorMichael Brown2007-02-01 06:48:56 +0100
committerMichael Brown2007-02-01 06:48:56 +0100
commitcc8f9e4b7fa6a82415c2f13d4434b379ef760bcb (patch)
treeece501e37b08aefc978204a1d6b78c488305636f /src/crypto
parentVanilla copies from axtls (diff)
downloadipxe-cc8f9e4b7fa6a82415c2f13d4434b379ef760bcb.tar.gz
ipxe-cc8f9e4b7fa6a82415c2f13d4434b379ef760bcb.tar.xz
ipxe-cc8f9e4b7fa6a82415c2f13d4434b379ef760bcb.zip
Make context sizes available for statically-allocated structures
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/axtls_sha1.c2
-rw-r--r--src/crypto/md5.c12
2 files changed, 2 insertions, 12 deletions
diff --git a/src/crypto/axtls_sha1.c b/src/crypto/axtls_sha1.c
index 17c08797..b44fe7fe 100644
--- a/src/crypto/axtls_sha1.c
+++ b/src/crypto/axtls_sha1.c
@@ -17,7 +17,7 @@ static void sha1_final ( void *ctx, void *out ) {
struct crypto_algorithm sha1_algorithm = {
.name = "sha1",
- .ctxsize = sizeof ( SHA1_CTX ),
+ .ctxsize = SHA1_CTX_SIZE,
.blocksize = 64,
.digestsize = SHA1_SIZE,
.init = sha1_init,
diff --git a/src/crypto/md5.c b/src/crypto/md5.c
index 94ab69a2..09378e20 100644
--- a/src/crypto/md5.c
+++ b/src/crypto/md5.c
@@ -26,16 +26,6 @@
#include <gpxe/crypto.h>
#include <gpxe/md5.h>
-#define MD5_DIGEST_SIZE 16
-#define MD5_BLOCK_WORDS 16
-#define MD5_HASH_WORDS 4
-
-struct md5_ctx {
- u32 hash[MD5_HASH_WORDS];
- u32 block[MD5_BLOCK_WORDS];
- u64 byte_count;
-};
-
#define __md5step __attribute__ (( regparm ( 3 ) ))
struct md5_step {
@@ -236,7 +226,7 @@ static void md5_final(void *context, void *out)
struct crypto_algorithm md5_algorithm = {
.name = "md5",
- .ctxsize = sizeof ( struct md5_ctx ),
+ .ctxsize = MD5_CTX_SIZE,
.blocksize = ( MD5_BLOCK_WORDS * 4 ),
.digestsize = MD5_DIGEST_SIZE,
.init = md5_init,