diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-02-24 23:22:46 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-02-24 23:22:46 +0100 |
commit | 1817a8622d0e3b54db3824c58540d20e3c2a11c7 (patch) | |
tree | d72c7f3c0f83ed95379cd5f88b1dd81958f4ad7a /ext/hash/hash_gost.c | |
parent | ffcdb2be161e5253a5c4e6198d1ad3973cfe837a (diff) | |
parent | f678b0eae2766a91e3a9e680b3d71befe7e4879c (diff) | |
download | php-git-1817a8622d0e3b54db3824c58540d20e3c2a11c7.tar.gz |
Merge branch 'PHP-7.1'
Diffstat (limited to 'ext/hash/hash_gost.c')
-rw-r--r-- | ext/hash/hash_gost.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c index 1ce8beefd4..e00a55ed96 100644 --- a/ext/hash/hash_gost.c +++ b/ext/hash/hash_gost.c @@ -227,14 +227,13 @@ static inline void Gost(PHP_GOST_CTX *context, uint32_t data[8]) static inline void GostTransform(PHP_GOST_CTX *context, const unsigned char input[32]) { int i, j; - uint32_t data[8], temp = 0, save = 0; + uint32_t data[8], temp = 0; for (i = 0, j = 0; i < 8; ++i, j += 4) { data[i] = ((uint32_t) input[j]) | (((uint32_t) input[j + 1]) << 8) | (((uint32_t) input[j + 2]) << 16) | (((uint32_t) input[j + 3]) << 24); - save = context->state[i + 8]; context->state[i + 8] += data[i] + temp; - temp = ((context->state[i + 8] < data[i]) || (context->state[i + 8] < save)) ? 1 : 0; + temp = context->state[i + 8] < data[i] ? 1 : (context->state[i + 8] == data[i] ? temp : 0); } Gost(context, data); |