diff options
| author | jdp_ <42700985+jdpatdiscord@users.noreply.github.com> | 2023-08-28 14:01:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-28 20:01:15 +0200 |
| commit | 2a3a07121640cfa7fb286f0e7eb7e149c0dfabef (patch) | |
| tree | b693b9d540e11dc268c7c97419f6f6230bdf5c11 /src/sha1 | |
| parent | b4aa7fafc9eef5377701896353aac145a23182a6 (diff) | |
Reduce code stink (#1818)
CRC32.cpp:
Make table initialization compile time
DSi_NAND.cpp:
Fix file close / unmount / disk close on error
~L427: Remove redundant calls, as they are immediately rendered useless by `rem` being overwritten
NDS.cpp / FreeBIOS.h:
Remove unneeded size values in header
Remove unneeded memset's as they are initialized anyway
sha1.c / sha1.h:
Fix useless warning
Wifi.cpp:
Remove unneeded includes
DSi.cpp:
Reduce ugly casts
Deduplicate code
qt_sdl/main.cpp:
silence clang switch statement warning
qt_sdl/main.h:
fix override warnings
dolphin/BitSet.h:
use msvc extensions only when appropriate, fix broken bit set count under _WIN32
Diffstat (limited to 'src/sha1')
| -rw-r--r-- | src/sha1/sha1.c | 4 | ||||
| -rw-r--r-- | src/sha1/sha1.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/sha1/sha1.c b/src/sha1/sha1.c index 3729550..c0052b7 100644 --- a/src/sha1/sha1.c +++ b/src/sha1/sha1.c @@ -104,7 +104,7 @@ A million repetitions of "a" /* Hash a single 512-bit block. This is the core of the algorithm. */ -void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]) +void SHA1Transform(uint32_t state[5], const unsigned char* buffer) { uint32_t a, b, c, d, e; typedef union { @@ -193,7 +193,7 @@ uint32_t j; memcpy(&context->buffer[j], data, (i = 64-j)); SHA1Transform(context->state, context->buffer); for ( ; i + 63 < len; i += 64) { - SHA1Transform(context->state, &data[i]); + SHA1Transform(context->state, data + i); } j = 0; } diff --git a/src/sha1/sha1.h b/src/sha1/sha1.h index 56ffa56..dd8f84a 100644 --- a/src/sha1/sha1.h +++ b/src/sha1/sha1.h @@ -13,7 +13,7 @@ typedef struct { unsigned char buffer[64]; } SHA1_CTX; -void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]); +void SHA1Transform(uint32_t state[5], const unsigned char* buffer); void SHA1Init(SHA1_CTX* context); void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len); void SHA1Final(unsigned char digest[20], SHA1_CTX* context); |