aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/sha256.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
commit931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch)
treed8c1843a95da5ea0bb4acc09f7e37843d9995c86 /src/nvim/sha256.c
parent142d9041391780ac15b89886a54015fdc5c73995 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-931bffbda3668ddc609fc1da8f9eb576b170aa52.tar.gz
rneovim-931bffbda3668ddc609fc1da8f9eb576b170aa52.tar.bz2
rneovim-931bffbda3668ddc609fc1da8f9eb576b170aa52.zip
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'src/nvim/sha256.c')
-rw-r--r--src/nvim/sha256.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/nvim/sha256.c b/src/nvim/sha256.c
index db647f3ecb..d49224a987 100644
--- a/src/nvim/sha256.c
+++ b/src/nvim/sha256.c
@@ -1,6 +1,3 @@
-// This is an open source non-commercial project. Dear PVS-Studio, please check
-// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
-
/// @file sha256.c
///
/// FIPS-180-2 compliant SHA-256 implementation
@@ -18,8 +15,8 @@
#include <stdio.h>
#include <string.h>
+#include "nvim/memory.h"
#include "nvim/sha256.h"
-#include "nvim/vim.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "sha256.c.generated.h"
@@ -201,14 +198,14 @@ void sha256_update(context_sha256_T *ctx, const uint8_t *input, size_t length)
memcpy(ctx->buffer + left, input, fill);
sha256_process(ctx, ctx->buffer);
length -= fill;
- input += fill;
+ input += fill;
left = 0;
}
while (length >= SHA256_BUFFER_SIZE) {
sha256_process(ctx, input);
length -= SHA256_BUFFER_SIZE;
- input += SHA256_BUFFER_SIZE;
+ input += SHA256_BUFFER_SIZE;
}
if (length) {
@@ -230,7 +227,7 @@ void sha256_finish(context_sha256_T *ctx, uint8_t digest[SHA256_SUM_SIZE])
uint8_t msglen[8];
high = (ctx->total[0] >> 29) | (ctx->total[1] << 3);
- low = (ctx->total[0] << 3);
+ low = (ctx->total[0] << 3);
PUT_UINT32(high, msglen, 0);
PUT_UINT32(low, msglen, 4);