[crypto] Use private data field for digest algorithms

Following the example of commit 25072c1 ("[crypto] Use private data
field for key exchange algorithms"), extend the definition of a digest
algorithm to include an opaque private data field.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-06-18 15:54:19 +01:00
parent 69e95ae7a5
commit d7e89f46b4
14 changed files with 161 additions and 198 deletions
+2 -20
View File
@@ -49,24 +49,6 @@ static const struct sha256_digest sha224_init_digest = {
},
};
/**
* Initialise SHA-224 algorithm
*
* @v ctx SHA-224 context
*/
static void sha224_init ( void *ctx ) {
struct sha256_context *context = ctx;
sha256_family_init ( context, &sha224_init_digest, SHA224_DIGEST_SIZE );
}
/** SHA-224 algorithm */
struct digest_algorithm sha224_algorithm = {
.name = "sha224",
.ctxsize = sizeof ( struct sha256_context ),
.blocksize = sizeof ( union sha256_block ),
.digestsize = SHA224_DIGEST_SIZE,
.init = sha224_init,
.update = sha256_update,
.final = sha256_final,
};
SHA256_ALGORITHM ( sha224, sha224_algorithm, SHA224_DIGEST_SIZE,
&sha224_init_digest );