mirror of https://github.com/ipxe/ipxe.git
Make context sizes available for statically-allocated structures
parent
d467552367
commit
cc8f9e4b7f
|
@ -17,7 +17,7 @@ static void sha1_final ( void *ctx, void *out ) {
|
||||||
|
|
||||||
struct crypto_algorithm sha1_algorithm = {
|
struct crypto_algorithm sha1_algorithm = {
|
||||||
.name = "sha1",
|
.name = "sha1",
|
||||||
.ctxsize = sizeof ( SHA1_CTX ),
|
.ctxsize = SHA1_CTX_SIZE,
|
||||||
.blocksize = 64,
|
.blocksize = 64,
|
||||||
.digestsize = SHA1_SIZE,
|
.digestsize = SHA1_SIZE,
|
||||||
.init = sha1_init,
|
.init = sha1_init,
|
||||||
|
|
|
@ -26,16 +26,6 @@
|
||||||
#include <gpxe/crypto.h>
|
#include <gpxe/crypto.h>
|
||||||
#include <gpxe/md5.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 ) ))
|
#define __md5step __attribute__ (( regparm ( 3 ) ))
|
||||||
|
|
||||||
struct md5_step {
|
struct md5_step {
|
||||||
|
@ -236,7 +226,7 @@ static void md5_final(void *context, void *out)
|
||||||
|
|
||||||
struct crypto_algorithm md5_algorithm = {
|
struct crypto_algorithm md5_algorithm = {
|
||||||
.name = "md5",
|
.name = "md5",
|
||||||
.ctxsize = sizeof ( struct md5_ctx ),
|
.ctxsize = MD5_CTX_SIZE,
|
||||||
.blocksize = ( MD5_BLOCK_WORDS * 4 ),
|
.blocksize = ( MD5_BLOCK_WORDS * 4 ),
|
||||||
.digestsize = MD5_DIGEST_SIZE,
|
.digestsize = MD5_DIGEST_SIZE,
|
||||||
.init = md5_init,
|
.init = md5_init,
|
||||||
|
|
|
@ -3,6 +3,20 @@
|
||||||
|
|
||||||
struct crypto_algorithm;
|
struct crypto_algorithm;
|
||||||
|
|
||||||
|
#include <stdint.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 MD5_CTX_SIZE sizeof ( struct md5_ctx )
|
||||||
|
|
||||||
extern struct crypto_algorithm md5_algorithm;
|
extern struct crypto_algorithm md5_algorithm;
|
||||||
|
|
||||||
#endif /* _GPXE_MD5_H */
|
#endif /* _GPXE_MD5_H */
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
#ifndef _GPXE_SHA1_H
|
#ifndef _GPXE_SHA1_H
|
||||||
#define _GPXE_SHA1_H
|
#define _GPXE_SHA1_H
|
||||||
|
|
||||||
|
#include "crypto/axtls/crypto.h"
|
||||||
|
|
||||||
struct crypto_algorithm;
|
struct crypto_algorithm;
|
||||||
|
|
||||||
|
#define SHA1_CTX_SIZE sizeof ( SHA1_CTX )
|
||||||
|
|
||||||
extern struct crypto_algorithm sha1_algorithm;
|
extern struct crypto_algorithm sha1_algorithm;
|
||||||
|
|
||||||
#endif /* _GPXE_SHA1_H */
|
#endif /* _GPXE_SHA1_H */
|
||||||
|
|
Loading…
Reference in New Issue