gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]