diff --git a/hash.h b/hash.h index 8c5a514..16989fc 100644 --- a/hash.h +++ b/hash.h @@ -26,6 +26,9 @@ struct lc_hash_impl { void *(*ctx_new)(void); void (*ctx_free)(void *); + + size_t blocklen; + size_t hashlen; }; struct lc_hash_ctx { diff --git a/hash_sha224_sha256.c b/hash_sha224_sha256.c index 6444564..ea7760d 100644 --- a/hash_sha224_sha256.c +++ b/hash_sha224_sha256.c @@ -266,6 +266,9 @@ static struct lc_hash_impl sha224_impl = { .ctx_new = &sha224_sha256_ctx_new, .ctx_free = NULL, + + .blocklen = LC_SHA224_BLOCKLEN, + .hashlen = LC_SHA224_HASHLEN, }; static struct lc_hash_impl sha256_impl = { @@ -276,6 +279,9 @@ static struct lc_hash_impl sha256_impl = { .ctx_new = &sha224_sha256_ctx_new, .ctx_free = NULL, + + .blocklen = LC_SHA256_BLOCKLEN, + .hashlen = LC_SHA256_HASHLEN, }; const struct lc_hash_impl * diff --git a/hash_sha384_sha512.c b/hash_sha384_sha512.c index 54a9921..f63f657 100644 --- a/hash_sha384_sha512.c +++ b/hash_sha384_sha512.c @@ -271,6 +271,9 @@ static struct lc_hash_impl sha384_impl = { .ctx_new = &sha384_sha512_ctx_new, .ctx_free = NULL, + + .blocklen = LC_SHA384_BLOCKLEN, + .hashlen = LC_SHA384_HASHLEN, }; static struct lc_hash_impl sha512_impl = { @@ -281,6 +284,9 @@ static struct lc_hash_impl sha512_impl = { .ctx_new = &sha384_sha512_ctx_new, .ctx_free = NULL, + + .blocklen = LC_SHA512_BLOCKLEN, + .hashlen = LC_SHA512_HASHLEN, }; const struct lc_hash_impl *