summaryrefslogtreecommitdiffstats
path: root/qemu/roms/ipxe/src/include/ipxe/sha256.h
diff options
context:
space:
mode:
Diffstat (limited to 'qemu/roms/ipxe/src/include/ipxe/sha256.h')
-rw-r--r--qemu/roms/ipxe/src/include/ipxe/sha256.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/qemu/roms/ipxe/src/include/ipxe/sha256.h b/qemu/roms/ipxe/src/include/ipxe/sha256.h
index 9aa9f3e57..e234cce33 100644
--- a/qemu/roms/ipxe/src/include/ipxe/sha256.h
+++ b/qemu/roms/ipxe/src/include/ipxe/sha256.h
@@ -7,11 +7,14 @@
*
*/
-FILE_LICENCE ( GPL2_OR_LATER );
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <stdint.h>
#include <ipxe/crypto.h>
+/** SHA-256 number of rounds */
+#define SHA256_ROUNDS 64
+
/** An SHA-256 digest */
struct sha256_digest {
/** Hash output */
@@ -58,6 +61,8 @@ union sha256_digest_data_dwords {
struct sha256_context {
/** Amount of accumulated data */
size_t len;
+ /** Digest size */
+ size_t digestsize;
/** Digest and accumulated data */
union sha256_digest_data_dwords ddd;
} __attribute__ (( packed ));
@@ -68,6 +73,16 @@ struct sha256_context {
/** SHA-256 digest size */
#define SHA256_DIGEST_SIZE sizeof ( struct sha256_digest )
+/** SHA-224 digest size */
+#define SHA224_DIGEST_SIZE ( SHA256_DIGEST_SIZE * 224 / 256 )
+
+extern void sha256_family_init ( struct sha256_context *context,
+ const struct sha256_digest *init,
+ size_t digestsize );
+extern void sha256_update ( void *ctx, const void *data, size_t len );
+extern void sha256_final ( void *ctx, void *out );
+
extern struct digest_algorithm sha256_algorithm;
+extern struct digest_algorithm sha224_algorithm;
#endif /* _IPXE_SHA256_H */