[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 sha512_digest sha384_init_digest = {
},
};
/**
* Initialise SHA-384 algorithm
*
* @v ctx SHA-384 context
*/
static void sha384_init ( void *ctx ) {
struct sha512_context *context = ctx;
sha512_family_init ( context, &sha384_init_digest, SHA384_DIGEST_SIZE );
}
/** SHA-384 algorithm */
struct digest_algorithm sha384_algorithm = {
.name = "sha384",
.ctxsize = sizeof ( struct sha512_context ),
.blocksize = sizeof ( union sha512_block ),
.digestsize = SHA384_DIGEST_SIZE,
.init = sha384_init,
.update = sha512_update,
.final = sha512_final,
};
SHA512_ALGORITHM ( sha384, sha384_algorithm, SHA384_DIGEST_SIZE,
&sha384_init_digest );