diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:56:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:56:35 +0000 |
commit | eba0cfa6b0bef4f2e73c8630a7efa3944df8b0f8 (patch) | |
tree | 74c37eede1f0634cc5de1c63c934edaa1630c6bc /util_lib/include/sha256.h | |
parent | Initial commit. (diff) | |
download | kexec-tools-eba0cfa6b0bef4f2e73c8630a7efa3944df8b0f8.tar.xz kexec-tools-eba0cfa6b0bef4f2e73c8630a7efa3944df8b0f8.zip |
Adding upstream version 1:2.0.27.upstream/1%2.0.27upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'util_lib/include/sha256.h')
-rw-r--r-- | util_lib/include/sha256.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/util_lib/include/sha256.h b/util_lib/include/sha256.h new file mode 100644 index 0000000..467fb22 --- /dev/null +++ b/util_lib/include/sha256.h @@ -0,0 +1,22 @@ +#ifndef SHA256_H +#define SHA256_H + +#include <sys/types.h> +#include <stdint.h> + +typedef struct +{ + size_t total[2]; + uint32_t state[8]; + uint8_t buffer[64]; +} +sha256_context; + +typedef uint8_t sha256_digest_t[32]; + +void sha256_starts( sha256_context *ctx ); +void sha256_update( sha256_context *ctx, const uint8_t *input, size_t length ); +void sha256_finish( sha256_context *ctx, sha256_digest_t digest ); + + +#endif /* SHA256_H */ |