diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-09-05 17:39:09 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-09-05 17:39:09 +0300 |
commit | 2646f3a681d993ebfff8eaa340615fd94c3d2738 (patch) | |
tree | ba461a041fdfd24c3bff281aca6b6f0f1b90e4d2 /src/microhttpd/sha1.c | |
parent | 9d3187cfc185946411ea79f96bac7d9a12fdd1a7 (diff) | |
download | libmicrohttpd-2646f3a681d993ebfff8eaa340615fd94c3d2738.tar.gz libmicrohttpd-2646f3a681d993ebfff8eaa340615fd94c3d2738.zip |
sha*/md5: fixed implicit value conversion
Performance may be improved as a side effect
Diffstat (limited to 'src/microhttpd/sha1.c')
-rw-r--r-- | src/microhttpd/sha1.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/microhttpd/sha1.c b/src/microhttpd/sha1.c index 5d4a5b93..9888cbfe 100644 --- a/src/microhttpd/sha1.c +++ b/src/microhttpd/sha1.c | |||
@@ -43,11 +43,11 @@ MHD_SHA1_init (void *ctx_) | |||
43 | struct sha1_ctx *const ctx = ctx_; | 43 | struct sha1_ctx *const ctx = ctx_; |
44 | /* Initial hash values, see FIPS PUB 180-4 paragraph 5.3.1 */ | 44 | /* Initial hash values, see FIPS PUB 180-4 paragraph 5.3.1 */ |
45 | /* Just some "magic" numbers defined by standard */ | 45 | /* Just some "magic" numbers defined by standard */ |
46 | ctx->H[0] = 0x67452301UL; | 46 | ctx->H[0] = UINT32_C (0x67452301); |
47 | ctx->H[1] = 0xefcdab89UL; | 47 | ctx->H[1] = UINT32_C (0xefcdab89); |
48 | ctx->H[2] = 0x98badcfeUL; | 48 | ctx->H[2] = UINT32_C (0x98badcfe); |
49 | ctx->H[3] = 0x10325476UL; | 49 | ctx->H[3] = UINT32_C (0x10325476); |
50 | ctx->H[4] = 0xc3d2e1f0UL; | 50 | ctx->H[4] = UINT32_C (0xc3d2e1f0); |
51 | 51 | ||
52 | /* Initialise number of bytes. */ | 52 | /* Initialise number of bytes. */ |
53 | ctx->count = 0; | 53 | ctx->count = 0; |
@@ -121,13 +121,13 @@ sha1_transform (uint32_t H[_SHA1_DIGEST_LENGTH], | |||
121 | #endif /* _MHD_GET_32BIT_BE_UNALIGNED */ | 121 | #endif /* _MHD_GET_32BIT_BE_UNALIGNED */ |
122 | 122 | ||
123 | /* SHA-1 values of Kt for t=0..19, see FIPS PUB 180-4 paragraph 4.2.1. */ | 123 | /* SHA-1 values of Kt for t=0..19, see FIPS PUB 180-4 paragraph 4.2.1. */ |
124 | #define K00 0x5a827999UL | 124 | #define K00 UINT32_C(0x5a827999) |
125 | /* SHA-1 values of Kt for t=20..39, see FIPS PUB 180-4 paragraph 4.2.1.*/ | 125 | /* SHA-1 values of Kt for t=20..39, see FIPS PUB 180-4 paragraph 4.2.1.*/ |
126 | #define K20 0x6ed9eba1UL | 126 | #define K20 UINT32_C(0x6ed9eba1) |
127 | /* SHA-1 values of Kt for t=40..59, see FIPS PUB 180-4 paragraph 4.2.1.*/ | 127 | /* SHA-1 values of Kt for t=40..59, see FIPS PUB 180-4 paragraph 4.2.1.*/ |
128 | #define K40 0x8f1bbcdcUL | 128 | #define K40 UINT32_C(0x8f1bbcdc) |
129 | /* SHA-1 values of Kt for t=60..79, see FIPS PUB 180-4 paragraph 4.2.1.*/ | 129 | /* SHA-1 values of Kt for t=60..79, see FIPS PUB 180-4 paragraph 4.2.1.*/ |
130 | #define K60 0xca62c1d6UL | 130 | #define K60 UINT32_C(0xca62c1d6) |
131 | 131 | ||
132 | /* During first 16 steps, before making any calculations on each step, | 132 | /* During first 16 steps, before making any calculations on each step, |
133 | the W element is read from input data buffer as big-endian value and | 133 | the W element is read from input data buffer as big-endian value and |