From 4827969cc8411f38d4b10916658d2aa665ca555d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Vejpustek?= Date: Wed, 1 Sep 2021 12:37:31 +0200 Subject: [PATCH] fix(crypto): unify function headers in sha2.c and sha2.h --- crypto/sha2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crypto/sha2.c b/crypto/sha2.c index f280e1fdd9..5aa0ea38cb 100644 --- a/crypto/sha2.c +++ b/crypto/sha2.c @@ -577,7 +577,7 @@ void sha1_Update(SHA1_CTX* context, const sha2_byte *data, size_t len) { usedspace = freespace = 0; } -void sha1_Final(SHA1_CTX* context, sha2_byte digest[]) { +void sha1_Final(SHA1_CTX* context, sha2_byte digest[SHA1_DIGEST_LENGTH]) { unsigned int usedspace = 0; /* If no digest buffer is passed, we don't bother doing this: */ @@ -631,7 +631,7 @@ void sha1_Final(SHA1_CTX* context, sha2_byte digest[]) { usedspace = 0; } -char *sha1_End(SHA1_CTX* context, char buffer[]) { +char *sha1_End(SHA1_CTX* context, char buffer[SHA1_DIGEST_STRING_LENGTH]) { sha2_byte digest[SHA1_DIGEST_LENGTH] = {0}, *d = digest; int i = 0; @@ -884,7 +884,7 @@ void sha256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { usedspace = freespace = 0; } -void sha256_Final(SHA256_CTX* context, sha2_byte digest[]) { +void sha256_Final(SHA256_CTX* context, sha2_byte digest[SHA256_DIGEST_LENGTH]) { unsigned int usedspace = 0; /* If no digest buffer is passed, we don't bother doing this: */ @@ -938,7 +938,7 @@ void sha256_Final(SHA256_CTX* context, sha2_byte digest[]) { usedspace = 0; } -char *sha256_End(SHA256_CTX* context, char buffer[]) { +char *sha256_End(SHA256_CTX* context, char buffer[SHA256_DIGEST_STRING_LENGTH]) { sha2_byte digest[SHA256_DIGEST_LENGTH] = {0}, *d = digest; int i = 0; @@ -1228,7 +1228,7 @@ static void sha512_Last(SHA512_CTX* context) { sha512_Transform(context->state, context->buffer, context->state); } -void sha512_Final(SHA512_CTX* context, sha2_byte digest[]) { +void sha512_Final(SHA512_CTX* context, sha2_byte digest[SHA512_DIGEST_LENGTH]) { /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { sha512_Last(context); @@ -1247,7 +1247,7 @@ void sha512_Final(SHA512_CTX* context, sha2_byte digest[]) { memzero(context, sizeof(SHA512_CTX)); } -char *sha512_End(SHA512_CTX* context, char buffer[]) { +char *sha512_End(SHA512_CTX* context, char buffer[SHA512_DIGEST_STRING_LENGTH]) { sha2_byte digest[SHA512_DIGEST_LENGTH] = {0}, *d = digest; int i = 0;