diff options
| author | Jakub Zelenka <bukka@php.net> | 2016-02-29 19:31:20 +0000 |
|---|---|---|
| committer | Jakub Zelenka <bukka@php.net> | 2016-02-29 19:31:20 +0000 |
| commit | 70141093a731049ee9220e9e965f61ded56ed4d5 (patch) | |
| tree | 6e67b382253a186889bfdc37c31062d6fb9880d9 /ext/hash/hash_gost.c | |
| parent | e453af3851daf08f5af9b45fc7819c3a9c336f1e (diff) | |
| parent | 97294aca7e066443291cc2d77f8674ac23eabb32 (diff) | |
| download | php-git-70141093a731049ee9220e9e965f61ded56ed4d5.tar.gz | |
Merge branch 'master' into openssl_aead
Diffstat (limited to 'ext/hash/hash_gost.c')
| -rw-r--r-- | ext/hash/hash_gost.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c index 2bc78313fb..4e72117451 100644 --- a/ext/hash/hash_gost.c +++ b/ext/hash/hash_gost.c @@ -207,10 +207,10 @@ AA(v, l, r); \ } -static inline void Gost(PHP_GOST_CTX *context, php_hash_uint32 data[8]) +static inline void Gost(PHP_GOST_CTX *context, uint32_t data[8]) { int i; - php_hash_uint32 l, r, t, key[8], u[8], v[8], w[8], s[8], *h = context->state, *m = data; + uint32_t l, r, t, key[8], u[8], v[8], w[8], s[8], *h = context->state, *m = data; memcpy(u, context->state, sizeof(u)); memcpy(v, data, sizeof(v)); @@ -227,11 +227,11 @@ static inline void Gost(PHP_GOST_CTX *context, php_hash_uint32 data[8]) static inline void GostTransform(PHP_GOST_CTX *context, const unsigned char input[32]) { int i, j; - php_hash_uint32 data[8], temp = 0, save = 0; + uint32_t data[8], temp = 0, save = 0; for (i = 0, j = 0; i < 8; ++i, j += 4) { - data[i] = ((php_hash_uint32) input[j]) | (((php_hash_uint32) input[j + 1]) << 8) | - (((php_hash_uint32) input[j + 2]) << 16) | (((php_hash_uint32) input[j + 3]) << 24); + 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; @@ -252,7 +252,7 @@ PHP_HASH_API void PHP_GOSTInitCrypto(PHP_GOST_CTX *context) context->tables = &tables_crypto; } -static const php_hash_uint32 MAX32 = 0xffffffffLU; +static const uint32_t MAX32 = 0xffffffffLU; PHP_HASH_API void PHP_GOSTUpdate(PHP_GOST_CTX *context, const unsigned char *input, size_t len) { @@ -288,7 +288,7 @@ PHP_HASH_API void PHP_GOSTUpdate(PHP_GOST_CTX *context, const unsigned char *inp PHP_HASH_API void PHP_GOSTFinal(unsigned char digest[32], PHP_GOST_CTX *context) { - php_hash_uint32 i, j, l[8] = {0}; + uint32_t i, j, l[8] = {0}; if (context->length) { GostTransform(context, context->buffer); |
