From 37a4bcc40e52181d9e35663115196534ff2a2442 Mon Sep 17 00:00:00 2001 From: ame Date: Mon, 8 Apr 2024 10:31:23 -0500 Subject: sha256 & sha224 --- src/hash/sha2-256.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/hash/sha2-256.c') diff --git a/src/hash/sha2-256.c b/src/hash/sha2-256.c index 5327209..69029bf 100644 --- a/src/hash/sha2-256.c +++ b/src/hash/sha2-256.c @@ -175,14 +175,14 @@ void sha512_final(struct sha512_hash* hash, char* out_stream){ _sha512_t_final(hash); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h0); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h1); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h2); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h3); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h4); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h5); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h6); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h7); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h0); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h1); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h2); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h3); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h4); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h5); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h6); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h7); memcpy(hash, &old_hash, sizeof * hash); memcpy(hash->buffer, old, bs); @@ -196,12 +196,12 @@ void sha384_final(struct sha512_hash* hash, char* out_stream){ _sha512_t_final(hash); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h0); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h1); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h2); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h3); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h4); - sprintf((char*)out_stream, "%s%016lx", out_stream, hash->h5); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h0); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h1); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h2); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h3); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h4); + sprintf((char*)out_stream, "%s%016llx", out_stream, hash->h5); memcpy(hash, &old_hash, sizeof * hash); memcpy(hash->buffer, old, bs); -- cgit v1.2.3