[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 04/06: sha256: minor optimization
From: |
gnunet |
Subject: |
[libmicrohttpd] 04/06: sha256: minor optimization |
Date: |
Sun, 16 May 2021 19:04:35 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit ab7c8f4efc0c6f0c259e6b9303637969d2435f4b
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun May 16 18:09:20 2021 +0300
sha256: minor optimization
---
src/microhttpd/sha256.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/microhttpd/sha256.c b/src/microhttpd/sha256.c
index d06b70b2..6c79c941 100644
--- a/src/microhttpd/sha256.c
+++ b/src/microhttpd/sha256.c
@@ -341,8 +341,8 @@ MHD_SHA256_finish (void *ctx_,
if (SHA256_BLOCK_SIZE - bytes_have < SHA256_SIZE_OF_LEN_ADD)
{ /* No space in current block to put total length of message.
Pad current block with zeros and process it. */
- while (bytes_have < SHA256_BLOCK_SIZE)
- ctx->buffer[bytes_have++] = 0;
+ if (bytes_have < SHA256_BLOCK_SIZE)
+ memset (ctx->buffer + bytes_have, 0, SHA256_BLOCK_SIZE - bytes_have);
/* Process full block. */
sha256_transform (ctx->H, ctx->buffer);
/* Start new block. */
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (8a9a64a7 -> 714c5735), gnunet, 2021/05/16
- [libmicrohttpd] 01/06: mhd_bithelpers: replaced macro with static function, gnunet, 2021/05/16
- [libmicrohttpd] 03/06: sha256: re-arranged struct members to have better alignment, gnunet, 2021/05/16
- [libmicrohttpd] 05/06: sha256: formatting, cosmetics, typos in comments, gnunet, 2021/05/16
- [libmicrohttpd] 02/06: sha256: renamed one function for clarity and uniformity, gnunet, 2021/05/16
- [libmicrohttpd] 04/06: sha256: minor optimization,
gnunet <=
- [libmicrohttpd] 06/06: Implemented SHA-1 calculation, gnunet, 2021/05/16