diff options
Diffstat (limited to 'ext/hash')
98 files changed, 259 insertions, 645 deletions
diff --git a/ext/hash/bench.php b/ext/hash/bench.php index 98af373ac3..a1cc4bedd1 100644..100755 --- a/ext/hash/bench.php +++ b/ext/hash/bench.php @@ -1,3 +1,4 @@ +#!/usr/bin/env php <?php /* diff --git a/ext/hash/config.m4 b/ext/hash/config.m4 index 070a78102a..dcf5e017e4 100644 --- a/ext/hash/config.m4 +++ b/ext/hash/config.m4 @@ -3,9 +3,6 @@ dnl config.m4 for extension hash PHP_ARG_WITH(mhash, for mhash support, [ --with-mhash[=DIR] Include mhash support]) -PHP_ARG_ENABLE(hash, whether to enable hash support, -[ --disable-hash Disable hash support], yes) - if test "$PHP_MHASH" != "no"; then if test "$PHP_HASH" = "no"; then PHP_HASH="yes" @@ -14,44 +11,42 @@ if test "$PHP_MHASH" != "no"; then AC_DEFINE(PHP_MHASH_BC, 1, [ ]) fi -if test "$PHP_HASH" != "no"; then - AC_DEFINE(HAVE_HASH_EXT,1,[Have HASH Extension]) - - PHP_C_BIGENDIAN - - AC_CHECK_SIZEOF(short, 2) - AC_CHECK_SIZEOF(int, 4) - AC_CHECK_SIZEOF(long, 4) - AC_CHECK_SIZEOF(long long, 8) - - if test $ac_cv_c_bigendian_php = yes; then - EXT_HASH_SHA3_SOURCES="hash_sha3.c" - AC_DEFINE(HAVE_SLOW_HASH3, 1, [Define is hash3 algo is available]) - AC_MSG_WARN("Use SHA3 slow implementation on bigendian") - else - PHP_CHECK_64BIT([ - SHA3_DIR="sha3/generic32lc" - SHA3_OPT_SRC="$SHA3_DIR/KeccakP-1600-inplace32BI.c" - ],[ - SHA3_DIR="sha3/generic64lc" - SHA3_OPT_SRC="$SHA3_DIR/KeccakP-1600-opt64.c" - ]) - EXT_HASH_SHA3_SOURCES="$SHA3_OPT_SRC $SHA3_DIR/KeccakHash.c $SHA3_DIR/KeccakSponge.c hash_sha3.c" - PHP_HASH_CFLAGS="-I@ext_srcdir@/$SHA3_DIR -DKeccakP200_excluded -DKeccakP400_excluded -DKeccakP800_excluded" - - PHP_ADD_BUILD_DIR(ext/hash/$SHA3_DIR, 1) - fi - - EXT_HASH_SOURCES="hash.c hash_md.c hash_sha.c hash_ripemd.c hash_haval.c \ - hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c hash_adler32.c \ - hash_crc32.c hash_fnv.c hash_joaat.c $EXT_HASH_SHA3_SOURCES" - EXT_HASH_HEADERS="php_hash.h php_hash_md.h php_hash_sha.h php_hash_ripemd.h \ - php_hash_haval.h php_hash_tiger.h php_hash_gost.h php_hash_snefru.h \ - php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h \ - php_hash_fnv.h php_hash_joaat.h php_hash_sha3.h" - - PHP_NEW_EXTENSION(hash, $EXT_HASH_SOURCES, $ext_shared,,$PHP_HASH_CFLAGS) - ifdef([PHP_INSTALL_HEADERS], [ - PHP_INSTALL_HEADERS(ext/hash, $EXT_HASH_HEADERS) +AC_DEFINE(HAVE_HASH_EXT,1,[Have HASH Extension]) + +PHP_C_BIGENDIAN + +AC_CHECK_SIZEOF(short, 2) +AC_CHECK_SIZEOF(int, 4) +AC_CHECK_SIZEOF(long, 4) +AC_CHECK_SIZEOF(long long, 8) + +if test $ac_cv_c_bigendian_php = yes; then + EXT_HASH_SHA3_SOURCES="hash_sha3.c" + AC_DEFINE(HAVE_SLOW_HASH3, 1, [Define is hash3 algo is available]) + AC_MSG_WARN("Use SHA3 slow implementation on bigendian") +else + PHP_CHECK_64BIT([ + SHA3_DIR="sha3/generic32lc" + SHA3_OPT_SRC="$SHA3_DIR/KeccakP-1600-inplace32BI.c" + ],[ + SHA3_DIR="sha3/generic64lc" + SHA3_OPT_SRC="$SHA3_DIR/KeccakP-1600-opt64.c" ]) + EXT_HASH_SHA3_SOURCES="$SHA3_OPT_SRC $SHA3_DIR/KeccakHash.c $SHA3_DIR/KeccakSponge.c hash_sha3.c" + PHP_HASH_CFLAGS="-I@ext_srcdir@/$SHA3_DIR -DKeccakP200_excluded -DKeccakP400_excluded -DKeccakP800_excluded" + + PHP_ADD_BUILD_DIR(ext/hash/$SHA3_DIR, 1) fi + +EXT_HASH_SOURCES="hash.c hash_md.c hash_sha.c hash_ripemd.c hash_haval.c \ + hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c hash_adler32.c \ + hash_crc32.c hash_fnv.c hash_joaat.c $EXT_HASH_SHA3_SOURCES" +EXT_HASH_HEADERS="php_hash.h php_hash_md.h php_hash_sha.h php_hash_ripemd.h \ + php_hash_haval.h php_hash_tiger.h php_hash_gost.h php_hash_snefru.h \ + php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h \ + php_hash_fnv.h php_hash_joaat.h php_hash_sha3.h" + +PHP_NEW_EXTENSION(hash, $EXT_HASH_SOURCES, 0,,$PHP_HASH_CFLAGS) +ifdef([PHP_INSTALL_HEADERS], [ + PHP_INSTALL_HEADERS(ext/hash, $EXT_HASH_HEADERS) +]) diff --git a/ext/hash/config.w32 b/ext/hash/config.w32 index 1bf39d14d2..4a81060385 100644 --- a/ext/hash/config.w32 +++ b/ext/hash/config.w32 @@ -1,33 +1,36 @@ // vim:ft=javascript -ARG_ENABLE("hash", "enable hash support", "yes"); -ARG_WITH("mhash", "mhash support", "no"); +ARG_WITH('mhash', 'mhash support (BC via hash)', 'no'); -if (PHP_MHASH != "no") { - if (PHP_HASH == "no") { - PHP_HASH = "yes"; - } +if (PHP_MHASH != 'no') { AC_DEFINE('PHP_MHASH_BC', 1); } -if (PHP_HASH != "no") { - var sha3_arch_dir = "sha3/" + (X64 ? "generic64lc" : "generic32lc"); - var sha3_dir = "ext/hash/" + sha3_arch_dir; - if (CHECK_HEADER_ADD_INCLUDE("KeccakHash.h", "CFLAGS_HASH", PHP_HASH + ";" + sha3_dir)) { - AC_DEFINE('HAVE_HASH_EXT', 1); - EXTENSION("hash", "hash.c hash_md.c hash_sha.c hash_ripemd.c hash_haval.c " - + "hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c " - + "hash_adler32.c hash_crc32.c hash_joaat.c hash_fnv.c hash_sha3.c"); - - ADD_SOURCES(sha3_dir, "KeccakHash.c KeccakSponge.c " + (X64 ? "KeccakP-1600-opt64.c" : "KeccakP-1600-inplace32BI.c"), - "hash"); - ADD_FLAG("CFLAGS_HASH", "/DKeccakP200_excluded /DKeccakP400_excluded /DKeccakP800_excluded"); - - - PHP_INSTALL_HEADERS("ext/hash/", "php_hash.h php_hash_md.h php_hash_sha.h php_hash_ripemd.h " + - "php_hash_haval.h php_hash_tiger.h php_hash_gost.h php_hash_snefru.h " + - "php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h php_hash_sha3.h "); - } else { - WARNING("hash not enabled; libraries and headers not found"); - } +AC_DEFINE('HAVE_HASH_EXT', 1); + +PHP_HASH = 'yes'; + +EXTENSION('hash', 'hash.c hash_md.c hash_sha.c hash_ripemd.c hash_haval.c ' + + 'hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c ' + + 'hash_adler32.c hash_crc32.c hash_joaat.c hash_fnv.c ' + + 'hash_sha3.c', false); + +var hash_sha3_dir = 'ext/hash/sha3/generic' + (X64 ? '64' : '32') + 'lc'; + +if(X64) { + ADD_SOURCES(hash_sha3_dir, 'KeccakHash.c KeccakSponge.c KeccakP-1600-opt64.c', 'hash'); +} else { + ADD_SOURCES(hash_sha3_dir, 'KeccakHash.c KeccakSponge.c KeccakP-1600-inplace32BI.c', 'hash'); } + +if (!CHECK_HEADER_ADD_INCLUDE('KeccakHash.h', 'CFLAGS_HASH', hash_sha3_dir)) { + // Should NEVER happen + ERROR('Unable to locate SHA3 headers'); +} + +ADD_FLAG('CFLAGS_HASH', '/DKeccakP200_excluded /DKeccakP400_excluded /DKeccakP800_excluded'); + +PHP_INSTALL_HEADERS('ext/hash/', 'php_hash.h php_hash_md.h php_hash_sha.h ' + + 'php_hash_ripemd.h php_hash_haval.h php_hash_tiger.h ' + + 'php_hash_gost.h php_hash_snefru.h php_hash_whirlpool.h ' + + 'php_hash_adler32.h php_hash_crc32.h php_hash_sha3.h'); diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 300fd82467..1c1d0b4ece 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -194,15 +194,15 @@ PHP_FUNCTION(hash_file) } /* }}} */ -static inline void php_hash_string_xor_char(unsigned char *out, const unsigned char *in, const unsigned char xor_with, const int length) { - int i; +static inline void php_hash_string_xor_char(unsigned char *out, const unsigned char *in, const unsigned char xor_with, const size_t length) { + size_t i; for (i=0; i < length; i++) { out[i] = in[i] ^ xor_with; } } -static inline void php_hash_string_xor(unsigned char *out, const unsigned char *in, const unsigned char *xor_with, const int length) { - int i; +static inline void php_hash_string_xor(unsigned char *out, const unsigned char *in, const unsigned char *xor_with, const size_t length) { + size_t i; for (i=0; i < length; i++) { out[i] = in[i] ^ xor_with[i]; } @@ -210,7 +210,7 @@ static inline void php_hash_string_xor(unsigned char *out, const unsigned char * static inline void php_hash_hmac_prep_key(unsigned char *K, const php_hash_ops *ops, void *context, const unsigned char *key, const size_t key_len) { memset(K, 0, ops->block_size); - if (key_len > (size_t)ops->block_size) { + if (key_len > ops->block_size) { /* Reduce the key first */ ops->hash_init(context); ops->hash_update(context, key, key_len); @@ -276,7 +276,7 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename, if (isfilename) { char buf[1024]; - int n; + size_t n; ops->hash_init(context); ops->hash_update(context, K, ops->block_size); while ((n = php_stream_read(stream, buf, sizeof(buf))) > 0) { @@ -329,40 +329,42 @@ PHP_FUNCTION(hash_hmac_file) } /* }}} */ -static void php_hashcontext_ctor(INTERNAL_FUNCTION_PARAMETERS, zval *objval) { +/* {{{ proto HashContext hash_init(string algo[, int options, string key]) +Initialize a hashing context */ +PHP_FUNCTION(hash_init) +{ zend_string *algo, *key = NULL; zend_long options = 0; int argc = ZEND_NUM_ARGS(); void *context; const php_hash_ops *ops; - php_hashcontext_object *hash = php_hashcontext_from_object(Z_OBJ_P(objval)); + php_hashcontext_object *hash; if (zend_parse_parameters(argc, "S|lS", &algo, &options, &key) == FAILURE) { - zval_ptr_dtor(return_value); RETURN_NULL(); } ops = php_hash_fetch_ops(ZSTR_VAL(algo), ZSTR_LEN(algo)); if (!ops) { php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", ZSTR_VAL(algo)); - zval_ptr_dtor(return_value); RETURN_FALSE; } if (options & PHP_HASH_HMAC) { if (!ops->is_crypto) { php_error_docref(NULL, E_WARNING, "HMAC requested with a non-cryptographic hashing algorithm: %s", ZSTR_VAL(algo)); - zval_ptr_dtor(return_value); RETURN_FALSE; } if (!key || (ZSTR_LEN(key) == 0)) { /* Note: a zero length key is no key at all */ php_error_docref(NULL, E_WARNING, "HMAC requested without a key"); - zval_ptr_dtor(return_value); RETURN_FALSE; } } + object_init_ex(return_value, php_hashcontext_ce); + hash = php_hashcontext_from_object(Z_OBJ_P(return_value)); + context = emalloc(ops->context_size); ops->hash_init(context); @@ -373,11 +375,11 @@ static void php_hashcontext_ctor(INTERNAL_FUNCTION_PARAMETERS, zval *objval) { if (options & PHP_HASH_HMAC) { char *K = emalloc(ops->block_size); - int i, block_size; + size_t i, block_size; memset(K, 0, ops->block_size); - if (ZSTR_LEN(key) > (size_t)ops->block_size) { + if (ZSTR_LEN(key) > ops->block_size) { /* Reduce the key first */ ops->hash_update(context, (unsigned char *) ZSTR_VAL(key), ZSTR_LEN(key)); ops->hash_final((unsigned char *) K, context); @@ -389,21 +391,13 @@ static void php_hashcontext_ctor(INTERNAL_FUNCTION_PARAMETERS, zval *objval) { /* XOR ipad */ block_size = ops->block_size; - for(i=0; i < block_size; i++) { + for(i = 0; i < block_size; i++) { K[i] ^= 0x36; } ops->hash_update(context, (unsigned char *) K, ops->block_size); hash->key = (unsigned char *) K; } } - -/* {{{ proto HashContext hash_init(string algo[, int options, string key]) -Initialize a hashing context */ -PHP_FUNCTION(hash_init) -{ - object_init_ex(return_value, php_hashcontext_ce); - php_hashcontext_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, return_value); -} /* }}} */ #define PHP_HASHCONTEXT_VERIFY(func, hash) { \ @@ -514,7 +508,7 @@ PHP_FUNCTION(hash_final) php_hashcontext_object *hash; zend_bool raw_output = 0; zend_string *digest; - int digest_len; + size_t digest_len; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &zhash, php_hashcontext_ce, &raw_output) == FAILURE) { return; @@ -527,11 +521,11 @@ PHP_FUNCTION(hash_final) digest = zend_string_alloc(digest_len, 0); hash->ops->hash_final((unsigned char *) ZSTR_VAL(digest), hash->context); if (hash->options & PHP_HASH_HMAC) { - int i, block_size; + size_t i, block_size; /* Convert K to opad -- 0x6A = 0x36 ^ 0x5C */ block_size = hash->ops->block_size; - for(i=0; i < block_size; i++) { + for(i = 0; i < block_size; i++) { hash->key[i] ^= 0x6A; } @@ -620,7 +614,8 @@ PHP_FUNCTION(hash_hkdf) zend_string *returnval, *ikm, *algo, *info = NULL, *salt = NULL; zend_long length = 0; unsigned char *prk, *digest, *K; - int i, rounds; + size_t i; + size_t rounds; const php_hash_ops *ops; void *context; @@ -649,8 +644,8 @@ PHP_FUNCTION(hash_hkdf) RETURN_FALSE; } else if (length == 0) { length = ops->digest_size; - } else if (length > ops->digest_size * 255) { - php_error_docref(NULL, E_WARNING, "Length must be less than or equal to %d: " ZEND_LONG_FMT, ops->digest_size * 255, length); + } else if (length > (zend_long) (ops->digest_size * 255)) { + php_error_docref(NULL, E_WARNING, "Length must be less than or equal to %zd: " ZEND_LONG_FMT, ops->digest_size * 255, length); RETURN_FALSE; } @@ -888,7 +883,7 @@ static PHP_METHOD(HashContext, __construct) { /* }}} */ static const zend_function_entry php_hashcontext_methods[] = { - PHP_ME(HashContext, __construct, NULL, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) + PHP_ME(HashContext, __construct, NULL, ZEND_ACC_PRIVATE) PHP_FE_END }; @@ -1067,9 +1062,12 @@ PHP_FUNCTION(mhash_keygen_s2k) void *context; char *key, *digest; int i = 0, j = 0; - int block_size = ops->digest_size; - int times = bytes / block_size; - if (bytes % block_size != 0) times++; + size_t block_size = ops->digest_size; + size_t times = bytes / block_size; + + if ((bytes % block_size) != 0) { + times++; + } context = emalloc(ops->context_size); ops->hash_init(context); @@ -1492,12 +1490,3 @@ zend_module_entry hash_module_entry = { #ifdef COMPILE_DL_HASH ZEND_GET_MODULE(hash) #endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/hash/hash_adler32.c b/ext/hash/hash_adler32.c index 0a08df8e7b..12bc44e446 100644 --- a/ext/hash/hash_adler32.c +++ b/ext/hash/hash_adler32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -70,12 +70,3 @@ const php_hash_ops php_hash_adler32_ops = { sizeof(PHP_ADLER32_CTX), 0 }; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/hash_crc32.c b/ext/hash/hash_crc32.c index aafc23fc81..4f095e4b71 100644 --- a/ext/hash/hash_crc32.c +++ b/ext/hash/hash_crc32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -91,12 +91,3 @@ const php_hash_ops php_hash_crc32b_ops = { sizeof(PHP_CRC32_CTX), 0 }; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/hash_fnv.c b/ext/hash/hash_fnv.c index aa6e9549aa..0ebe867b49 100644 --- a/ext/hash/hash_fnv.c +++ b/ext/hash/hash_fnv.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -76,13 +76,13 @@ PHP_HASH_API void PHP_FNV132Init(PHP_FNV132_CTX *context) /* }}} */ PHP_HASH_API void PHP_FNV132Update(PHP_FNV132_CTX *context, const unsigned char *input, - unsigned int inputLen) + size_t inputLen) { context->state = fnv_32_buf((void *)input, inputLen, context->state, 0); } PHP_HASH_API void PHP_FNV1a32Update(PHP_FNV132_CTX *context, const unsigned char *input, - unsigned int inputLen) + size_t inputLen) { context->state = fnv_32_buf((void *)input, inputLen, context->state, 1); } @@ -111,13 +111,13 @@ PHP_HASH_API void PHP_FNV164Init(PHP_FNV164_CTX *context) /* }}} */ PHP_HASH_API void PHP_FNV164Update(PHP_FNV164_CTX *context, const unsigned char *input, - unsigned int inputLen) + size_t inputLen) { context->state = fnv_64_buf((void *)input, inputLen, context->state, 0); } PHP_HASH_API void PHP_FNV1a64Update(PHP_FNV164_CTX *context, const unsigned char *input, - unsigned int inputLen) + size_t inputLen) { context->state = fnv_64_buf((void *)input, inputLen, context->state, 1); } @@ -223,12 +223,3 @@ fnv_64_buf(void *buf, size_t len, uint64_t hval, int alternate) /* return our new hash value */ return hval; } - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c index e18de57d9d..f51b310b70 100644 --- a/ext/hash/hash_gost.c +++ b/ext/hash/hash_gost.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -327,12 +327,3 @@ const php_hash_ops php_hash_gost_crypto_ops = { sizeof(PHP_GOST_CTX), 1 }; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/hash_haval.c b/ext/hash/hash_haval.c index be24f54f99..af2991e667 100644 --- a/ext/hash/hash_haval.c +++ b/ext/hash/hash_haval.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -538,12 +538,3 @@ PHP_HASH_API void PHP_HAVAL256Final(unsigned char *digest, PHP_HAVAL_CTX * conte ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/hash_joaat.c b/ext/hash/hash_joaat.c index bd38fe993c..fe04ed9cf2 100644 --- a/ext/hash/hash_joaat.c +++ b/ext/hash/hash_joaat.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -39,7 +39,7 @@ PHP_HASH_API void PHP_JOAATInit(PHP_JOAAT_CTX *context) context->state = 0; } -PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, unsigned int inputLen) +PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, size_t inputLen) { context->state = joaat_buf((void *)input, inputLen, context->state); } @@ -87,12 +87,3 @@ joaat_buf(void *buf, size_t len, uint32_t hval) return hval; } - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/hash/hash_md.c b/ext/hash/hash_md.c index 3cbd00a215..497c7d9d8d 100644 --- a/ext/hash/hash_md.c +++ b/ext/hash/hash_md.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -280,7 +280,7 @@ PHP_HASH_API void PHP_MD5Init(PHP_MD5_CTX * context) context. */ PHP_HASH_API void PHP_MD5Update(PHP_MD5_CTX * context, const unsigned char *input, - unsigned int inputLen) + size_t inputLen) { unsigned int i, index, partLen; @@ -539,7 +539,7 @@ PHP_HASH_API void PHP_MD4Init(PHP_MD4_CTX * context) operation, processing another message block, and updating the context. */ -PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX * context, const unsigned char *input, unsigned int inputLen) +PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX * context, const unsigned char *input, size_t inputLen) { unsigned int i, index, partLen; @@ -652,7 +652,7 @@ static void MD2_Transform(PHP_MD2_CTX *context, const unsigned char *block) } } -PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *buf, unsigned int len) +PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *buf, size_t len) { const unsigned char *p = buf, *e = buf + len; @@ -660,7 +660,7 @@ PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *buf, if (context->in_buffer + len < 16) { /* Not enough for block, just pass into buffer */ memcpy(context->buffer + context->in_buffer, p, len); - context->in_buffer += len; + context->in_buffer += (char) len; return; } /* Put buffered data together with inbound for a single block */ @@ -679,7 +679,7 @@ PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *buf, /* Copy remaining data to buffer */ if (p < e) { memcpy(context->buffer, p, e - p); - context->in_buffer = e - p; + context->in_buffer = (char) (e - p); } } @@ -691,12 +691,3 @@ PHP_HASH_API void PHP_MD2Final(unsigned char output[16], PHP_MD2_CTX *context) memcpy(output, context->state, 16); } - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/hash_ripemd.c b/ext/hash/hash_ripemd.c index 03aff00676..083e6a9955 100644 --- a/ext/hash/hash_ripemd.c +++ b/ext/hash/hash_ripemd.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -255,7 +255,7 @@ static void RIPEMD128Transform(uint32_t state[4], const unsigned char block[64]) operation, processing another message block, and updating the context. */ -PHP_HASH_API void PHP_RIPEMD128Update(PHP_RIPEMD128_CTX * context, const unsigned char *input, unsigned int inputLen) +PHP_HASH_API void PHP_RIPEMD128Update(PHP_RIPEMD128_CTX * context, const unsigned char *input, size_t inputLen) { unsigned int i, index, partLen; @@ -353,7 +353,7 @@ static void RIPEMD256Transform(uint32_t state[8], const unsigned char block[64]) operation, processing another message block, and updating the context. */ -PHP_HASH_API void PHP_RIPEMD256Update(PHP_RIPEMD256_CTX * context, const unsigned char *input, unsigned int inputLen) +PHP_HASH_API void PHP_RIPEMD256Update(PHP_RIPEMD256_CTX * context, const unsigned char *input, size_t inputLen) { unsigned int i, index, partLen; @@ -452,7 +452,7 @@ static void RIPEMD160Transform(uint32_t state[5], const unsigned char block[64]) operation, processing another message block, and updating the context. */ -PHP_HASH_API void PHP_RIPEMD160Update(PHP_RIPEMD160_CTX * context, const unsigned char *input, unsigned int inputLen) +PHP_HASH_API void PHP_RIPEMD160Update(PHP_RIPEMD160_CTX * context, const unsigned char *input, size_t inputLen) { unsigned int i, index, partLen; @@ -560,7 +560,7 @@ static void RIPEMD320Transform(uint32_t state[10], const unsigned char block[64] operation, processing another message block, and updating the context. */ -PHP_HASH_API void PHP_RIPEMD320Update(PHP_RIPEMD320_CTX * context, const unsigned char *input, unsigned int inputLen) +PHP_HASH_API void PHP_RIPEMD320Update(PHP_RIPEMD320_CTX * context, const unsigned char *input, size_t inputLen) { unsigned int i, index, partLen; @@ -766,12 +766,3 @@ PHP_HASH_API void PHP_RIPEMD320Final(unsigned char digest[40], PHP_RIPEMD320_CTX ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); } /* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/hash_sha.c b/ext/hash/hash_sha.c index 4758c2fa38..4e0e1c1797 100644 --- a/ext/hash/hash_sha.c +++ b/ext/hash/hash_sha.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -327,7 +327,7 @@ static void SHA1Transform(uint32_t state[5], const unsigned char block[64]) context. */ PHP_HASH_API void PHP_SHA1Update(PHP_SHA1_CTX * context, const unsigned char *input, - unsigned int inputLen) + size_t inputLen) { unsigned int i, index, partLen; @@ -537,7 +537,7 @@ PHP_HASH_API void PHP_SHA224Init(PHP_SHA224_CTX * context) operation, processing another message block, and updating the context. */ -PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX * context, const unsigned char *input, unsigned int inputLen) +PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX * context, const unsigned char *input, size_t inputLen) { unsigned int i, index, partLen; @@ -614,7 +614,7 @@ PHP_HASH_API void PHP_SHA224Final(unsigned char digest[28], PHP_SHA224_CTX * con operation, processing another message block, and updating the context. */ -PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX * context, const unsigned char *input, unsigned int inputLen) +PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX * context, const unsigned char *input, size_t inputLen) { unsigned int i, index, partLen; @@ -828,9 +828,9 @@ static void SHA512Transform(uint64_t state[8], const unsigned char block[128]) operation, processing another message block, and updating the context. */ -PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX * context, const unsigned char *input, unsigned int inputLen) +PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX * context, const unsigned char *input, size_t inputLen) { - unsigned int i, index, partLen; + unsigned int i = 0, index, partLen; /* Compute number of bytes mod 128 */ index = (unsigned int) ((context->count[0] >> 3) & 0x7F); @@ -854,8 +854,6 @@ PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX * context, const unsigned char } index = 0; - } else { - i = 0; } /* Buffer remaining input */ @@ -979,7 +977,7 @@ PHP_HASH_API void PHP_SHA512_224Init(PHP_SHA512_CTX * context) operation, processing another message block, and updating the context. */ -PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX * context, const unsigned char *input, unsigned int inputLen) +PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX * context, const unsigned char *input, size_t inputLen) { unsigned int i, index, partLen; @@ -1113,12 +1111,3 @@ const php_hash_ops php_hash_sha512_224_ops = { sizeof(PHP_SHA512_CTX), 1 }; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/hash_sha3.c b/ext/hash/hash_sha3.c index 86cfabe934..8d0a1e7f8b 100644 --- a/ext/hash/hash_sha3.c +++ b/ext/hash/hash_sha3.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -156,15 +156,21 @@ static void PHP_SHA3_Init(PHP_SHA3_CTX* ctx, static void PHP_SHA3_Update(PHP_SHA3_CTX* ctx, const unsigned char* buf, - unsigned int count, + size_t count, size_t block_size) { while (count > 0) { - unsigned int len = block_size - ctx->pos; - if (len > count) len = count; + size_t len = block_size - ctx->pos; + + if (len > count) { + len = count; + } + count -= len; + while (len-- > 0) { ctx->state[ctx->pos++] ^= *(buf++); } + if (ctx->pos >= block_size) { permute(ctx); ctx->pos = 0; @@ -174,9 +180,9 @@ static void PHP_SHA3_Update(PHP_SHA3_CTX* ctx, static void PHP_SHA3_Final(unsigned char* digest, PHP_SHA3_CTX* ctx, - int block_size, - int digest_size) { - int len = digest_size; + size_t block_size, + size_t digest_size) { + size_t len = digest_size; // Pad state to finalize ctx->state[ctx->pos++] ^= 0x06; @@ -205,7 +211,7 @@ void PHP_SHA3##bits##Init(PHP_SHA3_##bits##_CTX* ctx) { \ } \ void PHP_SHA3##bits##Update(PHP_SHA3_##bits##_CTX* ctx, \ const unsigned char* input, \ - unsigned int inputLen) { \ + size_t inputLen) { \ PHP_SHA3_Update(ctx, input, inputLen, \ (1600 - (2 * bits)) >> 3); \ } \ @@ -251,7 +257,7 @@ void PHP_SHA3##bits##Init(PHP_SHA3_##bits##_CTX* ctx) { \ } \ void PHP_SHA3##bits##Update(PHP_SHA3_##bits##_CTX* ctx, \ const unsigned char* input, \ - unsigned int inputLen) { \ + size_t inputLen) { \ Keccak_HashUpdate((Keccak_HashInstance *)ctx->hashinstance, input, inputLen * 8); \ } \ void PHP_SHA3##bits##Final(unsigned char* digest, \ @@ -280,12 +286,3 @@ DECLARE_SHA3_OPS(384); DECLARE_SHA3_OPS(512); #undef DECLARE_SHA3_OPS - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/hash_snefru.c b/ext/hash/hash_snefru.c index bab15c505a..0e6b703f2a 100644 --- a/ext/hash/hash_snefru.c +++ b/ext/hash/hash_snefru.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -142,9 +142,9 @@ PHP_HASH_API void PHP_SNEFRUUpdate(PHP_SNEFRU_CTX *context, const unsigned char if ((MAX32 - context->count[1]) < (len * 8)) { context->count[0]++; context->count[1] = MAX32 - context->count[1]; - context->count[1] = (len * 8) - context->count[1]; + context->count[1] = ((uint32_t) len * 8) - context->count[1]; } else { - context->count[1] += len * 8; + context->count[1] += (uint32_t) len * 8; } if (context->length + len < 32) { @@ -201,12 +201,3 @@ const php_hash_ops php_hash_snefru_ops = { sizeof(PHP_SNEFRU_CTX), 1 }; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/hash_tiger.c b/ext/hash/hash_tiger.c index 720045f821..4d126f0d8f 100644 --- a/ext/hash/hash_tiger.c +++ b/ext/hash/hash_tiger.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -259,12 +259,3 @@ PHP_HASH_TIGER_OPS(3, 192); PHP_HASH_TIGER_OPS(4, 128); PHP_HASH_TIGER_OPS(4, 160); PHP_HASH_TIGER_OPS(4, 192); - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/hash_whirlpool.c b/ext/hash/hash_whirlpool.c index f8303bd418..3bd9bd13da 100644 --- a/ext/hash/hash_whirlpool.c +++ b/ext/hash/hash_whirlpool.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -441,12 +441,3 @@ const php_hash_ops php_hash_whirlpool_ops = { sizeof(PHP_WHIRLPOOL_CTX), 1 }; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/php_hash.h b/ext/hash/php_hash.h index cba2967a0a..8f23c1920d 100644 --- a/ext/hash/php_hash.h +++ b/ext/hash/php_hash.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -30,7 +30,7 @@ #define L64 INT64_C typedef void (*php_hash_init_func_t)(void *context); -typedef void (*php_hash_update_func_t)(void *context, const unsigned char *buf, unsigned int count); +typedef void (*php_hash_update_func_t)(void *context, const unsigned char *buf, size_t count); typedef void (*php_hash_final_func_t)(unsigned char *digest, void *context); typedef int (*php_hash_copy_func_t)(const void *ops, void *orig_context, void *dest_context); @@ -40,9 +40,9 @@ typedef struct _php_hash_ops { php_hash_final_func_t hash_final; php_hash_copy_func_t hash_copy; - int digest_size; - int block_size; - int context_size; + size_t digest_size; + size_t block_size; + size_t context_size; unsigned is_crypto: 1; } php_hash_ops; @@ -128,10 +128,6 @@ extern zend_module_entry hash_module_entry; # define PHP_HASH_API #endif -#ifdef ZTS -#include "TSRM.h" -#endif - PHP_FUNCTION(hash); PHP_FUNCTION(hash_file); PHP_FUNCTION(hash_hkdf); @@ -151,10 +147,10 @@ PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const char *algo, size_t alg PHP_HASH_API void php_hash_register_algo(const char *algo, const php_hash_ops *ops); PHP_HASH_API int php_hash_copy(const void *ops, void *orig_context, void *dest_context); -static inline void php_hash_bin2hex(char *out, const unsigned char *in, int in_len) +static inline void php_hash_bin2hex(char *out, const unsigned char *in, size_t in_len) { static const char hexits[17] = "0123456789abcdef"; - int i; + size_t i; for(i = 0; i < in_len; i++) { out[i * 2] = hexits[in[i] >> 4]; @@ -163,13 +159,3 @@ static inline void php_hash_bin2hex(char *out, const unsigned char *in, int in_l } #endif /* PHP_HASH_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_adler32.h b/ext/hash/php_hash_adler32.h index f3192cfa2e..63f32ab536 100644 --- a/ext/hash/php_hash_adler32.h +++ b/ext/hash/php_hash_adler32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -31,12 +31,3 @@ PHP_HASH_API void PHP_ADLER32Final(unsigned char digest[4], PHP_ADLER32_CTX *con PHP_HASH_API int PHP_ADLER32Copy(const php_hash_ops *ops, PHP_ADLER32_CTX *orig_context, PHP_ADLER32_CTX *copy_context); #endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_crc32.h b/ext/hash/php_hash_crc32.h index c4d396c30d..5b187dc51f 100644 --- a/ext/hash/php_hash_crc32.h +++ b/ext/hash/php_hash_crc32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -32,12 +32,3 @@ PHP_HASH_API void PHP_CRC32Final(unsigned char digest[4], PHP_CRC32_CTX *context PHP_HASH_API int PHP_CRC32Copy(const php_hash_ops *ops, PHP_CRC32_CTX *orig_context, PHP_CRC32_CTX *copy_context); #endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_crc32_tables.h b/ext/hash/php_hash_crc32_tables.h index e226a3edfb..9d1e5b8376 100644 --- a/ext/hash/php_hash_crc32_tables.h +++ b/ext/hash/php_hash_crc32_tables.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -136,12 +136,3 @@ static const uint32_t crc32b_table[] = { 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, }; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_fnv.h b/ext/hash/php_hash_fnv.h index 8166c7b481..f00a469423 100644 --- a/ext/hash/php_hash_fnv.h +++ b/ext/hash/php_hash_fnv.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -53,25 +53,16 @@ typedef struct { PHP_HASH_API void PHP_FNV132Init(PHP_FNV132_CTX *context); -PHP_HASH_API void PHP_FNV132Update(PHP_FNV132_CTX *context, const unsigned char *input, unsigned int inputLen); -PHP_HASH_API void PHP_FNV1a32Update(PHP_FNV132_CTX *context, const unsigned char *input, unsigned int inputLen); +PHP_HASH_API void PHP_FNV132Update(PHP_FNV132_CTX *context, const unsigned char *input, size_t inputLen); +PHP_HASH_API void PHP_FNV1a32Update(PHP_FNV132_CTX *context, const unsigned char *input, size_t inputLen); PHP_HASH_API void PHP_FNV132Final(unsigned char digest[16], PHP_FNV132_CTX * context); PHP_HASH_API void PHP_FNV164Init(PHP_FNV164_CTX *context); -PHP_HASH_API void PHP_FNV164Update(PHP_FNV164_CTX *context, const unsigned char *input, unsigned int inputLen); -PHP_HASH_API void PHP_FNV1a64Update(PHP_FNV164_CTX *context, const unsigned char *input, unsigned int inputLen); +PHP_HASH_API void PHP_FNV164Update(PHP_FNV164_CTX *context, const unsigned char *input, size_t inputLen); +PHP_HASH_API void PHP_FNV1a64Update(PHP_FNV164_CTX *context, const unsigned char *input, size_t inputLen); PHP_HASH_API void PHP_FNV164Final(unsigned char digest[16], PHP_FNV164_CTX * context); static uint32_t fnv_32_buf(void *buf, size_t len, uint32_t hval, int alternate); static uint64_t fnv_64_buf(void *buf, size_t len, uint64_t hval, int alternate); #endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_gost.h b/ext/hash/php_hash_gost.h index 53679537e5..3837eeb263 100644 --- a/ext/hash/php_hash_gost.h +++ b/ext/hash/php_hash_gost.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -24,7 +24,7 @@ /* GOST context */ typedef struct { uint32_t state[16]; - uint32_t count[2]; + size_t count[2]; unsigned char length; unsigned char buffer[32]; const uint32_t (*tables)[4][256]; @@ -35,12 +35,3 @@ PHP_HASH_API void PHP_GOSTUpdate(PHP_GOST_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_GOSTFinal(unsigned char[64], PHP_GOST_CTX *); #endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_haval.h b/ext/hash/php_hash_haval.h index 263abbd8d9..1188b79cc3 100644 --- a/ext/hash/php_hash_haval.h +++ b/ext/hash/php_hash_haval.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/hash/php_hash_joaat.h b/ext/hash/php_hash_joaat.h index 5232bf5555..b9e7e7a7ee 100644 --- a/ext/hash/php_hash_joaat.h +++ b/ext/hash/php_hash_joaat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -24,18 +24,9 @@ typedef struct { } PHP_JOAAT_CTX; PHP_HASH_API void PHP_JOAATInit(PHP_JOAAT_CTX *context); -PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, unsigned int inputLen); +PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, size_t inputLen); PHP_HASH_API void PHP_JOAATFinal(unsigned char digest[16], PHP_JOAAT_CTX * context); static uint32_t joaat_buf(void *buf, size_t len, uint32_t hval); #endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_md.h b/ext/hash/php_hash_md.h index 819f507ab6..0073488c14 100644 --- a/ext/hash/php_hash_md.h +++ b/ext/hash/php_hash_md.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -65,7 +65,7 @@ typedef struct { PHP_HASH_API void make_digest(char *md5str, unsigned char *digest); PHP_HASH_API void PHP_MD5Init(PHP_MD5_CTX *); -PHP_HASH_API void PHP_MD5Update(PHP_MD5_CTX *, const unsigned char *, unsigned int); +PHP_HASH_API void PHP_MD5Update(PHP_MD5_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_MD5Final(unsigned char[16], PHP_MD5_CTX *); PHP_NAMED_FUNCTION(php_if_md5); @@ -80,7 +80,7 @@ typedef struct { } PHP_MD4_CTX; PHP_HASH_API void PHP_MD4Init(PHP_MD4_CTX *); -PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX *context, const unsigned char *, unsigned int); +PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX *context, const unsigned char *, size_t); PHP_HASH_API void PHP_MD4Final(unsigned char[16], PHP_MD4_CTX *); /* MD2 context */ @@ -92,7 +92,7 @@ typedef struct { } PHP_MD2_CTX; PHP_HASH_API void PHP_MD2Init(PHP_MD2_CTX *context); -PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *, unsigned int); +PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *, size_t); PHP_HASH_API void PHP_MD2Final(unsigned char[16], PHP_MD2_CTX *); #endif diff --git a/ext/hash/php_hash_ripemd.h b/ext/hash/php_hash_ripemd.h index 4747d68ea8..e8f1678166 100644 --- a/ext/hash/php_hash_ripemd.h +++ b/ext/hash/php_hash_ripemd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -46,19 +46,19 @@ typedef struct { } PHP_RIPEMD320_CTX; PHP_HASH_API void PHP_RIPEMD128Init(PHP_RIPEMD128_CTX *); -PHP_HASH_API void PHP_RIPEMD128Update(PHP_RIPEMD128_CTX *, const unsigned char *, unsigned int); +PHP_HASH_API void PHP_RIPEMD128Update(PHP_RIPEMD128_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_RIPEMD128Final(unsigned char[16], PHP_RIPEMD128_CTX *); PHP_HASH_API void PHP_RIPEMD160Init(PHP_RIPEMD160_CTX *); -PHP_HASH_API void PHP_RIPEMD160Update(PHP_RIPEMD160_CTX *, const unsigned char *, unsigned int); +PHP_HASH_API void PHP_RIPEMD160Update(PHP_RIPEMD160_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_RIPEMD160Final(unsigned char[20], PHP_RIPEMD160_CTX *); PHP_HASH_API void PHP_RIPEMD256Init(PHP_RIPEMD256_CTX *); -PHP_HASH_API void PHP_RIPEMD256Update(PHP_RIPEMD256_CTX *, const unsigned char *, unsigned int); +PHP_HASH_API void PHP_RIPEMD256Update(PHP_RIPEMD256_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_RIPEMD256Final(unsigned char[32], PHP_RIPEMD256_CTX *); PHP_HASH_API void PHP_RIPEMD320Init(PHP_RIPEMD320_CTX *); -PHP_HASH_API void PHP_RIPEMD320Update(PHP_RIPEMD320_CTX *, const unsigned char *, unsigned int); +PHP_HASH_API void PHP_RIPEMD320Update(PHP_RIPEMD320_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_RIPEMD320Final(unsigned char[40], PHP_RIPEMD320_CTX *); #endif /* PHP_HASH_RIPEMD_H */ diff --git a/ext/hash/php_hash_sha.h b/ext/hash/php_hash_sha.h index 9844ddeb7d..4903f8d8b2 100644 --- a/ext/hash/php_hash_sha.h +++ b/ext/hash/php_hash_sha.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -40,7 +40,7 @@ typedef struct { } PHP_SHA1_CTX; PHP_HASH_API void PHP_SHA1Init(PHP_SHA1_CTX *); -PHP_HASH_API void PHP_SHA1Update(PHP_SHA1_CTX *, const unsigned char *, unsigned int); +PHP_HASH_API void PHP_SHA1Update(PHP_SHA1_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_SHA1Final(unsigned char[20], PHP_SHA1_CTX *); PHP_FUNCTION(sha1); @@ -56,7 +56,7 @@ typedef struct { } PHP_SHA224_CTX; PHP_HASH_API void PHP_SHA224Init(PHP_SHA224_CTX *); -PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX *, const unsigned char *, unsigned int); +PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_SHA224Final(unsigned char[28], PHP_SHA224_CTX *); /* SHA256 context. */ @@ -67,7 +67,7 @@ typedef struct { } PHP_SHA256_CTX; PHP_HASH_API void PHP_SHA256Init(PHP_SHA256_CTX *); -PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX *, const unsigned char *, unsigned int); +PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_SHA256Final(unsigned char[32], PHP_SHA256_CTX *); /* SHA384 context */ @@ -78,7 +78,7 @@ typedef struct { } PHP_SHA384_CTX; PHP_HASH_API void PHP_SHA384Init(PHP_SHA384_CTX *); -PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX *, const unsigned char *, unsigned int); +PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_SHA384Final(unsigned char[48], PHP_SHA384_CTX *); /* SHA512 context */ @@ -89,7 +89,7 @@ typedef struct { } PHP_SHA512_CTX; PHP_HASH_API void PHP_SHA512Init(PHP_SHA512_CTX *); -PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX *, const unsigned char *, unsigned int); +PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_SHA512Final(unsigned char[64], PHP_SHA512_CTX *); PHP_HASH_API void PHP_SHA512_256Init(PHP_SHA512_CTX *); diff --git a/ext/hash/php_hash_sha3.h b/ext/hash/php_hash_sha3.h index 56ff450987..0608f4005e 100644 --- a/ext/hash/php_hash_sha3.h +++ b/ext/hash/php_hash_sha3.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -36,27 +36,19 @@ typedef PHP_SHA3_CTX PHP_SHA3_384_CTX; typedef PHP_SHA3_CTX PHP_SHA3_512_CTX; PHP_HASH_API void PHP_SHA3224Init(PHP_SHA3_224_CTX*); -PHP_HASH_API void PHP_SHA3224Update(PHP_SHA3_224_CTX*, const unsigned char*, unsigned int); +PHP_HASH_API void PHP_SHA3224Update(PHP_SHA3_224_CTX*, const unsigned char*, size_t); PHP_HASH_API void PHP_SAH3224Final(unsigned char[32], PHP_SHA3_224_CTX*); PHP_HASH_API void PHP_SHA3256Init(PHP_SHA3_256_CTX*); -PHP_HASH_API void PHP_SHA3256Update(PHP_SHA3_256_CTX*, const unsigned char*, unsigned int); +PHP_HASH_API void PHP_SHA3256Update(PHP_SHA3_256_CTX*, const unsigned char*, size_t); PHP_HASH_API void PHP_SAH3256Final(unsigned char[32], PHP_SHA3_256_CTX*); PHP_HASH_API void PHP_SHA3384Init(PHP_SHA3_384_CTX*); -PHP_HASH_API void PHP_SHA3384Update(PHP_SHA3_384_CTX*, const unsigned char*, unsigned int); +PHP_HASH_API void PHP_SHA3384Update(PHP_SHA3_384_CTX*, const unsigned char*, size_t); PHP_HASH_API void PHP_SAH3384Final(unsigned char[32], PHP_SHA3_384_CTX*); PHP_HASH_API void PHP_SHA3512Init(PHP_SHA3_512_CTX*); -PHP_HASH_API void PHP_SHA3512Update(PHP_SHA3_512_CTX*, const unsigned char*, unsigned int); +PHP_HASH_API void PHP_SHA3512Update(PHP_SHA3_512_CTX*, const unsigned char*, size_t); PHP_HASH_API void PHP_SAH3512Final(unsigned char[32], PHP_SHA3_512_CTX*); #endif -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_snefru.h b/ext/hash/php_hash_snefru.h index e15b36139b..2040fbfc94 100644 --- a/ext/hash/php_hash_snefru.h +++ b/ext/hash/php_hash_snefru.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -38,12 +38,3 @@ PHP_HASH_API void PHP_SNEFRUUpdate(PHP_SNEFRU_CTX *, const unsigned char *, size PHP_HASH_API void PHP_SNEFRUFinal(unsigned char[32], PHP_SNEFRU_CTX *); #endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_snefru_tables.h b/ext/hash/php_hash_snefru_tables.h index a0b661ddca..20d385443d 100644 --- a/ext/hash/php_hash_snefru_tables.h +++ b/ext/hash/php_hash_snefru_tables.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -929,12 +929,3 @@ static const uint32_t tables[16][256]= { /* 255*/ 0x4d87253cL /* End of S Box 15 */ } }; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_tiger.h b/ext/hash/php_hash_tiger.h index ca60dd4eae..b80e4e3254 100644 --- a/ext/hash/php_hash_tiger.h +++ b/ext/hash/php_hash_tiger.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -25,7 +25,7 @@ typedef struct { uint64_t passed; unsigned char buffer[64]; unsigned int passes:1; - unsigned int length:7; + size_t length; } PHP_TIGER_CTX; PHP_HASH_API void PHP_3TIGERInit(PHP_TIGER_CTX *context); @@ -36,12 +36,3 @@ PHP_HASH_API void PHP_TIGER160Final(unsigned char digest[20], PHP_TIGER_CTX *con PHP_HASH_API void PHP_TIGER192Final(unsigned char digest[24], PHP_TIGER_CTX *context); #endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_tiger_tables.h b/ext/hash/php_hash_tiger_tables.h index 4e1933ce42..3dbdc0a4c6 100644 --- a/ext/hash/php_hash_tiger_tables.h +++ b/ext/hash/php_hash_tiger_tables.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -536,12 +536,3 @@ static const uint64_t table[4*256] = { L64(0xCD56D9430EA8280E) /* 1020 */, L64(0xC12591D7535F5065) /* 1021 */, L64(0xC83223F1720AEF96) /* 1022 */, L64(0xC3A0396F7363A51F) /* 1023 */, }; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_whirlpool.h b/ext/hash/php_hash_whirlpool.h index 1ad4bf25dc..3a2e98cff2 100644 --- a/ext/hash/php_hash_whirlpool.h +++ b/ext/hash/php_hash_whirlpool.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -35,12 +35,3 @@ PHP_HASH_API void PHP_WHIRLPOOLUpdate(PHP_WHIRLPOOL_CTX *, const unsigned char * PHP_HASH_API void PHP_WHIRLPOOLFinal(unsigned char[64], PHP_WHIRLPOOL_CTX *); #endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/php_hash_whirlpool_tables.h b/ext/hash/php_hash_whirlpool_tables.h index 91c3cd8431..2127ccca59 100644 --- a/ext/hash/php_hash_whirlpool_tables.h +++ b/ext/hash/php_hash_whirlpool_tables.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -572,12 +572,3 @@ static const uint64_t C7[256] = { }; #endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/hash/tests/adler32.phpt b/ext/hash/tests/adler32.phpt index eab2a3f1fd..5b822b63a6 100644 --- a/ext/hash/tests/adler32.phpt +++ b/ext/hash/tests/adler32.phpt @@ -1,7 +1,5 @@ --TEST-- -ADLER32 ---SKIPIF-- -<?php extension_loaded('hash') or die('skip'); ?> +Hash: ADLER32 algorithm --FILE-- <?php echo hash('adler32', ''), "\n"; diff --git a/ext/hash/tests/bug52240.phpt b/ext/hash/tests/bug52240.phpt index 6e0c8f650d..911912bf04 100644 --- a/ext/hash/tests/bug52240.phpt +++ b/ext/hash/tests/bug52240.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #52240 (hash_copy() does not copy the HMAC key, causes wrong results and PHP crashes) ---SKIPIF-- -<?php extension_loaded('hash') or die('skip'); ?> --FILE-- <?php diff --git a/ext/hash/tests/bug64745.phpt b/ext/hash/tests/bug64745.phpt index c3c9c0a74c..b5706b057e 100644 --- a/ext/hash/tests/bug64745.phpt +++ b/ext/hash/tests/bug64745.phpt @@ -1,7 +1,5 @@ --TEST-- -Bug #64745 hash_pbkdf2() truncates data when using default length and hex output ---SKIPIF-- -<?php extension_loaded('hash') or die('skip'); ?> +Bug #64745 (hash_pbkdf2() truncates data when using default length and hex output) --FILE-- <?php $hash = hash_pbkdf2('sha1', 'password', 'salt', 1, 0); diff --git a/ext/hash/tests/bug70312.phpt b/ext/hash/tests/bug70312.phpt index 10e4fdefa9..87d72eb6aa 100644 --- a/ext/hash/tests/bug70312.phpt +++ b/ext/hash/tests/bug70312.phpt @@ -1,7 +1,5 @@ --TEST-- -Bug #70312 HAVAL gives wrong hashes in specific cases ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Bug #70312 (HAVAL gives wrong hashes in specific cases) --FILE-- <?php var_dump(hash('haval128,5', '1234567890123456789012345678901234567890123456789012345678901234')); diff --git a/ext/hash/tests/bug73127.phpt b/ext/hash/tests/bug73127.phpt index 78113de7ec..4b1578a6bc 100644 --- a/ext/hash/tests/bug73127.phpt +++ b/ext/hash/tests/bug73127.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #73127 (gost-crypto hash incorrect if input data contains long 0xFF sequence) ---SKIPIF-- -<?php if(!extension_loaded('hash')) die('skip hash extension not loaded'); ?> --FILE-- <?php diff --git a/ext/hash/tests/crc32.phpt b/ext/hash/tests/crc32.phpt index 3862fb17a6..80c6bb0286 100644 --- a/ext/hash/tests/crc32.phpt +++ b/ext/hash/tests/crc32.phpt @@ -1,7 +1,5 @@ --TEST-- -CRC32 ---SKIPIF-- -<?php extension_loaded('hash') or die('skip'); ?> +Hash: CRC32 algorithm --FILE-- <?php echo hash('crc32', ''), "\n"; diff --git a/ext/hash/tests/fnv132.phpt b/ext/hash/tests/fnv132.phpt index 051386ab75..914ce46f35 100644 --- a/ext/hash/tests/fnv132.phpt +++ b/ext/hash/tests/fnv132.phpt @@ -1,7 +1,5 @@ --TEST-- -FNV ---SKIPIF-- -<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?> +Hash: FNV132 algorithm --FILE-- <?php diff --git a/ext/hash/tests/fnv164.phpt b/ext/hash/tests/fnv164.phpt index b5e69420a6..8ff7304a7b 100644 --- a/ext/hash/tests/fnv164.phpt +++ b/ext/hash/tests/fnv164.phpt @@ -1,7 +1,5 @@ --TEST-- -FNV ---SKIPIF-- -<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?> +Hash: FNV164 algorithm --FILE-- <?php diff --git a/ext/hash/tests/fnv1a32.phpt b/ext/hash/tests/fnv1a32.phpt index 8297c7b920..d2e01f7998 100644 --- a/ext/hash/tests/fnv1a32.phpt +++ b/ext/hash/tests/fnv1a32.phpt @@ -1,7 +1,5 @@ --TEST-- -FNV ---SKIPIF-- -<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?> +Hash: FNV1a32 algorithm --FILE-- <?php diff --git a/ext/hash/tests/fnv1a64.phpt b/ext/hash/tests/fnv1a64.phpt index 8fd206ada4..870c6ced0c 100644 --- a/ext/hash/tests/fnv1a64.phpt +++ b/ext/hash/tests/fnv1a64.phpt @@ -1,7 +1,5 @@ --TEST-- -FNV ---SKIPIF-- -<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?> +Hash: FNV1a64 algorithm --FILE-- <?php diff --git a/ext/hash/tests/gost.phpt b/ext/hash/tests/gost.phpt index 6ce00242b1..1913574817 100644 --- a/ext/hash/tests/gost.phpt +++ b/ext/hash/tests/gost.phpt @@ -1,7 +1,5 @@ --TEST-- -gost ---SKIPIF-- -<?php extension_loaded('hash') or die('skip'); ?> +Hash: gost algorithm --FILE-- <?php echo hash('gost', ''), "\n"; diff --git a/ext/hash/tests/hash-clone.phpt b/ext/hash/tests/hash-clone.phpt index 9a067d73ae..7229b2a23e 100644 --- a/ext/hash/tests/hash-clone.phpt +++ b/ext/hash/tests/hash-clone.phpt @@ -1,7 +1,5 @@ --TEST-- -hash_copy() via clone ---SKIPIF-- -<?php extension_loaded('hash') or die('skip'); ?> +Hash: hash_copy() via clone --FILE-- <?php diff --git a/ext/hash/tests/hash_algos.phpt b/ext/hash/tests/hash_algos.phpt index f25bf38a04..efbb714788 100644 --- a/ext/hash/tests/hash_algos.phpt +++ b/ext/hash/tests/hash_algos.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_algos() function : basic functionality ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_algos() function : basic functionality --FILE-- <?php diff --git a/ext/hash/tests/hash_copy_001.phpt b/ext/hash/tests/hash_copy_001.phpt index e4b62c7ecc..95aaf14c05 100644 --- a/ext/hash/tests/hash_copy_001.phpt +++ b/ext/hash/tests/hash_copy_001.phpt @@ -1,7 +1,5 @@ --TEST-- -hash_copy() basic tests ---SKIPIF-- -<?php extension_loaded('hash') or die('skip'); ?> +Hash: hash_copy() basic tests --FILE-- <?php diff --git a/ext/hash/tests/hash_copy_002.phpt b/ext/hash/tests/hash_copy_002.phpt index 2b6ce4a07b..0528bb5a98 100644 --- a/ext/hash/tests/hash_copy_002.phpt +++ b/ext/hash/tests/hash_copy_002.phpt @@ -1,7 +1,5 @@ --TEST-- -hash_copy() errors ---SKIPIF-- -<?php extension_loaded('hash') or die('skip'); ?> +Hash: hash_copy() errors --FILE-- <?php diff --git a/ext/hash/tests/hash_equals.phpt b/ext/hash/tests/hash_equals.phpt index 8fdf22967e..0c8ab42f93 100644 --- a/ext/hash/tests/hash_equals.phpt +++ b/ext/hash/tests/hash_equals.phpt @@ -1,7 +1,5 @@ --TEST-- -hash_equals() function ---SKIPIF-- -<?php if(!extension_loaded('hash')) die('skip hash extension not loaded'); ?> +Hash: hash_equals() test --FILE-- <?php var_dump(hash_equals("same", "same")); diff --git a/ext/hash/tests/hash_error.phpt b/ext/hash/tests/hash_error.phpt index af59cf9b23..e760819e69 100644 --- a/ext/hash/tests/hash_error.phpt +++ b/ext/hash/tests/hash_error.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash() function : error conditions ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash() function : error conditions --FILE-- <?php diff --git a/ext/hash/tests/hash_file_basic.phpt b/ext/hash/tests/hash_file_basic.phpt index 583cfd0563..283cc37527 100644 --- a/ext/hash/tests/hash_file_basic.phpt +++ b/ext/hash/tests/hash_file_basic.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_file() function : basic functionality ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_file() function : basic functionality --CREDITS-- Felix De Vliegher <felix.devliegher@gmail.com> --FILE-- diff --git a/ext/hash/tests/hash_file_basic1.phpt b/ext/hash/tests/hash_file_basic1.phpt index 0ea91d5a32..3984fbcb21 100644 --- a/ext/hash/tests/hash_file_basic1.phpt +++ b/ext/hash/tests/hash_file_basic1.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_file() function : basic functionality ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_file() function : basic functionality --FILE-- <?php diff --git a/ext/hash/tests/hash_file_error.phpt b/ext/hash/tests/hash_file_error.phpt index 7a3b604e67..a634070de5 100644 --- a/ext/hash/tests/hash_file_error.phpt +++ b/ext/hash/tests/hash_file_error.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_file() function : error conditions ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_file() function : error conditions --CREDITS-- Felix De Vliegher <felix.devliegher@gmail.com> --FILE-- diff --git a/ext/hash/tests/hash_hkdf_basic.phpt b/ext/hash/tests/hash_hkdf_basic.phpt index 06b5dac2cd..7cd5f7e22e 100644 --- a/ext/hash/tests/hash_hkdf_basic.phpt +++ b/ext/hash/tests/hash_hkdf_basic.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_hkdf() function: basic functionality ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_hkdf() function: basic functionality --FILE-- <?php diff --git a/ext/hash/tests/hash_hkdf_edges.phpt b/ext/hash/tests/hash_hkdf_edges.phpt index 633efa4301..82acdbab04 100644 --- a/ext/hash/tests/hash_hkdf_edges.phpt +++ b/ext/hash/tests/hash_hkdf_edges.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_hkdf() function: edge cases ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_hkdf() function: edge cases --FILE-- <?php diff --git a/ext/hash/tests/hash_hkdf_error.phpt b/ext/hash/tests/hash_hkdf_error.phpt index ddda8df43b..b833054e80 100644 --- a/ext/hash/tests/hash_hkdf_error.phpt +++ b/ext/hash/tests/hash_hkdf_error.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_hkdf() function: error conditions ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_hkdf() function: error conditions --FILE-- <?php diff --git a/ext/hash/tests/hash_hkdf_rfc5869.phpt b/ext/hash/tests/hash_hkdf_rfc5869.phpt index d1ad9961f4..5652bff5ef 100644 --- a/ext/hash/tests/hash_hkdf_rfc5869.phpt +++ b/ext/hash/tests/hash_hkdf_rfc5869.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_hkdf() function: RFC 5869 test vectors ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_hkdf() function: RFC 5869 test vectors --FILE-- <?php diff --git a/ext/hash/tests/hash_hmac_algos.phpt b/ext/hash/tests/hash_hmac_algos.phpt index 87e44f7bae..b4240ac7cb 100644 --- a/ext/hash/tests/hash_hmac_algos.phpt +++ b/ext/hash/tests/hash_hmac_algos.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_hmac_algos() function : basic functionality ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_hmac_algos() function : basic functionality --FILE-- <?php diff --git a/ext/hash/tests/hash_hmac_basic.phpt b/ext/hash/tests/hash_hmac_basic.phpt index a829828913..1ad27e1cb2 100644 --- a/ext/hash/tests/hash_hmac_basic.phpt +++ b/ext/hash/tests/hash_hmac_basic.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_file() function : basic functionality ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_file() function : basic functionality --FILE-- <?php diff --git a/ext/hash/tests/hash_hmac_error.phpt b/ext/hash/tests/hash_hmac_error.phpt index b9a9e535d3..89d29b8df8 100644 --- a/ext/hash/tests/hash_hmac_error.phpt +++ b/ext/hash/tests/hash_hmac_error.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_hmac() function : basic functionality ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_hmac() function : basic functionality --FILE-- <?php /* diff --git a/ext/hash/tests/hash_hmac_file_basic.phpt b/ext/hash/tests/hash_hmac_file_basic.phpt index e2f6da14de..9135825008 100644 --- a/ext/hash/tests/hash_hmac_file_basic.phpt +++ b/ext/hash/tests/hash_hmac_file_basic.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_hmac_file() function : basic functionality ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_hmac_file() function : basic functionality --FILE-- <?php diff --git a/ext/hash/tests/hash_hmac_file_error.phpt b/ext/hash/tests/hash_hmac_file_error.phpt index 61f9e4d265..5b82c288ec 100644 --- a/ext/hash/tests/hash_hmac_file_error.phpt +++ b/ext/hash/tests/hash_hmac_file_error.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_hmac_file() function : basic functionality ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_hmac_file() function : basic functionality --FILE-- <?php diff --git a/ext/hash/tests/hash_init_error.phpt b/ext/hash/tests/hash_init_error.phpt index 95c67dad60..e941aabca5 100644 --- a/ext/hash/tests/hash_init_error.phpt +++ b/ext/hash/tests/hash_init_error.phpt @@ -1,9 +1,5 @@ --TEST-- -hash_init() function - errors test ---SKIPIF-- -<?php -if (!extension_loaded('hash')) die('skip hash extension not available'); -?> +Hash: hash_init() function - errors test --FILE-- <?php echo "*** Testing hash_init(): error conditions ***\n"; diff --git a/ext/hash/tests/hash_pbkdf2_basic.phpt b/ext/hash/tests/hash_pbkdf2_basic.phpt index 17610dfedc..71187a0fdd 100644 --- a/ext/hash/tests/hash_pbkdf2_basic.phpt +++ b/ext/hash/tests/hash_pbkdf2_basic.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_pbkdf2() function : basic functionality ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: hash_pbkdf2() function : basic functionality --FILE-- <?php diff --git a/ext/hash/tests/hash_pbkdf2_error.phpt b/ext/hash/tests/hash_pbkdf2_error.phpt index 5636a532a4..c0a76e17b4 100644 --- a/ext/hash/tests/hash_pbkdf2_error.phpt +++ b/ext/hash/tests/hash_pbkdf2_error.phpt @@ -1,7 +1,5 @@ --TEST-- -Test hash_pbkdf2() function : error functionality ---SKIPIF-- -<?php extension_loaded('hash') or die('skip: hash extension not loaded.'); ?> +Hash: Test hash_pbkdf2() function : error functionality --FILE-- <?php diff --git a/ext/hash/tests/hash_update_file.phpt b/ext/hash/tests/hash_update_file.phpt index 488be47411..bedaa73879 100644 --- a/ext/hash/tests/hash_update_file.phpt +++ b/ext/hash/tests/hash_update_file.phpt @@ -1,11 +1,7 @@ --TEST-- -hash_update_file() function - basic test +Hash: hash_update_file() test --CREDITS-- marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br ---SKIPIF-- -<?php -if (!extension_loaded('hash')) die('skip hash extension not available'); -?> --FILE-- <?php $filePath = __DIR__ . DIRECTORY_SEPARATOR . 'hash_update_stream.txt'; diff --git a/ext/hash/tests/hash_update_stream.phpt b/ext/hash/tests/hash_update_stream.phpt index 86d69b1f24..fd5f776539 100644 --- a/ext/hash/tests/hash_update_stream.phpt +++ b/ext/hash/tests/hash_update_stream.phpt @@ -1,11 +1,7 @@ --TEST-- -int hash_update_stream ( resource $context , resource $handle [, int $length = -1 ] ); +Hash: hash_update_stream() test --CREDITS-- marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br ---SKIPIF-- -<?php -if (!extension_loaded('hash')) die('skip hash extension not available'); -?> --FILE-- <?php $fp = tmpfile(); diff --git a/ext/hash/tests/haval.phpt b/ext/hash/tests/haval.phpt index 4dabe94bc8..b01abdb8ef 100644 --- a/ext/hash/tests/haval.phpt +++ b/ext/hash/tests/haval.phpt @@ -1,7 +1,5 @@ --TEST-- -haval algorithm (multi-vector, multi-pass, multi-width) ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: haval algorithm (multi-vector, multi-pass, multi-width) --FILE-- <?php echo "Empty String\n"; diff --git a/ext/hash/tests/hmac-md5.phpt b/ext/hash/tests/hmac-md5.phpt index 283285a544..38f204a356 100644 --- a/ext/hash/tests/hmac-md5.phpt +++ b/ext/hash/tests/hmac-md5.phpt @@ -1,7 +1,5 @@ --TEST-- -hmac-md5 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: hmac-md5 algorithm --FILE-- <?php /* Test Vectors from RFC 2104 */ diff --git a/ext/hash/tests/joaat.phpt b/ext/hash/tests/joaat.phpt index 63751c9f3b..819b598851 100644 --- a/ext/hash/tests/joaat.phpt +++ b/ext/hash/tests/joaat.phpt @@ -1,7 +1,5 @@ --TEST-- -Jenkins's one-at-a-time ---SKIPIF-- -<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?> +Hash: Jenkins's one-at-a-time --FILE-- <?php $tests = array( diff --git a/ext/hash/tests/md2.phpt b/ext/hash/tests/md2.phpt index c98ad34054..8ee023c1cb 100644 --- a/ext/hash/tests/md2.phpt +++ b/ext/hash/tests/md2.phpt @@ -1,7 +1,5 @@ --TEST-- -md2 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: md2 algorithm --FILE-- <?php echo hash('md2', '') . "\n"; diff --git a/ext/hash/tests/md4.phpt b/ext/hash/tests/md4.phpt index 9446d3d9c2..aed4a5ce05 100644 --- a/ext/hash/tests/md4.phpt +++ b/ext/hash/tests/md4.phpt @@ -1,7 +1,5 @@ --TEST-- -md4 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: md4 algorithm --FILE-- <?php /* RFC 1320 vectors */ diff --git a/ext/hash/tests/md5.phpt b/ext/hash/tests/md5.phpt index 8ded36ed61..1c90662dd6 100644 --- a/ext/hash/tests/md5.phpt +++ b/ext/hash/tests/md5.phpt @@ -1,7 +1,5 @@ --TEST-- -md5 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: md5 algorithm --FILE-- <?php echo hash('md5', '') . "\n"; diff --git a/ext/hash/tests/mhash_001.phpt b/ext/hash/tests/mhash_001.phpt index e8aac9b5e0..71d6d20df6 100644 --- a/ext/hash/tests/mhash_001.phpt +++ b/ext/hash/tests/mhash_001.phpt @@ -1,9 +1,7 @@ --TEST-- -mhash() test +MHash: mhash() test --SKIPIF-- -<?php - include "skip_mhash.inc"; -?> +<?php if(!function_exists('mhash')) { die('skip mhash compatibility layer not available'); } ?> --FILE-- <?php diff --git a/ext/hash/tests/mhash_002.phpt b/ext/hash/tests/mhash_002.phpt index a44bb4b555..2318470919 100644 --- a/ext/hash/tests/mhash_002.phpt +++ b/ext/hash/tests/mhash_002.phpt @@ -1,9 +1,7 @@ --TEST-- -mhash_get_block_size() & mhash_get_hash_name() test +MHash: mhash_get_block_size() & mhash_get_hash_name() test --SKIPIF-- -<?php - include "skip_mhash.inc"; -?> +<?php if(!function_exists('mhash')) { die('skip mhash compatibility layer not available'); } ?> --FILE-- <?php $supported_hash_al = array( diff --git a/ext/hash/tests/mhash_003.phpt b/ext/hash/tests/mhash_003.phpt index 38d1a8b5f0..a4d43eb8d5 100644 --- a/ext/hash/tests/mhash_003.phpt +++ b/ext/hash/tests/mhash_003.phpt @@ -1,9 +1,7 @@ --TEST-- -mhash_keygen_s2k() test +MHash: mhash_keygen_s2k() test --SKIPIF-- -<?php - include "skip_mhash.inc"; -?> +<?php if(!function_exists('mhash')) { die('skip mhash compatibility layer not available'); } ?> --FILE-- <?php diff --git a/ext/hash/tests/mhash_004.phpt b/ext/hash/tests/mhash_004.phpt index b928a794b1..f3c5e34ee3 100644 --- a/ext/hash/tests/mhash_004.phpt +++ b/ext/hash/tests/mhash_004.phpt @@ -1,9 +1,7 @@ --TEST-- -mhash() modifying algorithm parameter +MHash: mhash() modifying algorithm parameter --SKIPIF-- -<?php - include "skip_mhash.inc"; -?> +<?php if(!function_exists('mhash')) { die('skip mhash compatibility layer not available'); } ?> --FILE-- <?php diff --git a/ext/hash/tests/new-context.phpt b/ext/hash/tests/new-context.phpt index b4ddf64a0f..b8ada08357 100644 --- a/ext/hash/tests/new-context.phpt +++ b/ext/hash/tests/new-context.phpt @@ -1,5 +1,5 @@ --TEST-- -Attempt to instantiate a HashContext directly +Hash: Attempt to instantiate a HashContext directly --SKIPIF-- <?php if (!extension_loaded('hash')) echo 'skip'; --FILE-- diff --git a/ext/hash/tests/reuse.phpt b/ext/hash/tests/reuse.phpt index 481a6cfe0f..2955aac2c8 100644 --- a/ext/hash/tests/reuse.phpt +++ b/ext/hash/tests/reuse.phpt @@ -1,5 +1,5 @@ --TEST-- -Attempt to reuse a closed hash context +Hash: Attempt to reuse a closed hash context --SKIPIF-- <?php if (!extension_loaded('hash')) echo 'skip'; --FILE-- diff --git a/ext/hash/tests/ripemd128.phpt b/ext/hash/tests/ripemd128.phpt index e7473e316c..e896d35be0 100644 --- a/ext/hash/tests/ripemd128.phpt +++ b/ext/hash/tests/ripemd128.phpt @@ -1,7 +1,5 @@ --TEST-- -ripemd128 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: ripemd128 algorithm --FILE-- <?php echo hash('ripemd128', '') . "\n"; diff --git a/ext/hash/tests/ripemd160.phpt b/ext/hash/tests/ripemd160.phpt index 8fe7b05296..40dd82db29 100644 --- a/ext/hash/tests/ripemd160.phpt +++ b/ext/hash/tests/ripemd160.phpt @@ -1,7 +1,5 @@ --TEST-- -ripemd160 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: ripemd160 algorithm --FILE-- <?php echo hash('ripemd160', '') . "\n"; diff --git a/ext/hash/tests/ripemd256.phpt b/ext/hash/tests/ripemd256.phpt index 6fc23794a5..92b5160186 100644 --- a/ext/hash/tests/ripemd256.phpt +++ b/ext/hash/tests/ripemd256.phpt @@ -1,7 +1,5 @@ --TEST-- -ripemd256 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: ripemd256 algorithm --FILE-- <?php echo hash('ripemd256', '') . "\n"; diff --git a/ext/hash/tests/ripemd320.phpt b/ext/hash/tests/ripemd320.phpt index 152c922d5d..37930a4a0c 100644 --- a/ext/hash/tests/ripemd320.phpt +++ b/ext/hash/tests/ripemd320.phpt @@ -1,7 +1,5 @@ --TEST-- -ripemd320 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: ripemd320 algorithm --FILE-- <?php echo hash('ripemd320', '') . "\n"; diff --git a/ext/hash/tests/serialize-context.phpt b/ext/hash/tests/serialize-context.phpt index f0ac1baec6..32aa0ab806 100644 --- a/ext/hash/tests/serialize-context.phpt +++ b/ext/hash/tests/serialize-context.phpt @@ -1,7 +1,5 @@ --TEST-- -Serialize a context ---SKIPIF-- -<?php if (!extension_loaded('hash')) echo 'skip'; +Hash: Context serialization --FILE-- <?php diff --git a/ext/hash/tests/sha1.phpt b/ext/hash/tests/sha1.phpt index b193781653..82a9703734 100644 --- a/ext/hash/tests/sha1.phpt +++ b/ext/hash/tests/sha1.phpt @@ -1,7 +1,5 @@ --TEST-- -sha1 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: sha1 algorithm --FILE-- <?php echo hash('sha1', '') . "\n"; diff --git a/ext/hash/tests/sha224.phpt b/ext/hash/tests/sha224.phpt index 98f98584b1..a0180baaec 100644 --- a/ext/hash/tests/sha224.phpt +++ b/ext/hash/tests/sha224.phpt @@ -1,7 +1,5 @@ --TEST-- -sha224 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: sha224 algorithm --FILE-- <?php echo hash('sha224', '') . "\n"; diff --git a/ext/hash/tests/sha256.phpt b/ext/hash/tests/sha256.phpt index 5a91fb2732..ddc3962eda 100644 --- a/ext/hash/tests/sha256.phpt +++ b/ext/hash/tests/sha256.phpt @@ -1,7 +1,5 @@ --TEST-- -sha256 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: sha256 algorithm --FILE-- <?php echo hash('sha256', '') . "\n"; diff --git a/ext/hash/tests/sha3.phpt b/ext/hash/tests/sha3.phpt index 7e8d9c53c1..3a5f712c73 100644 --- a/ext/hash/tests/sha3.phpt +++ b/ext/hash/tests/sha3.phpt @@ -1,7 +1,5 @@ --TEST-- -sha3 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: sha3 algorithm --FILE-- <?php diff --git a/ext/hash/tests/sha384.phpt b/ext/hash/tests/sha384.phpt index e5be2ab274..03b873c079 100644 --- a/ext/hash/tests/sha384.phpt +++ b/ext/hash/tests/sha384.phpt @@ -1,7 +1,5 @@ --TEST-- -sha384 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: sha384 algorithm --FILE-- <?php echo hash('sha384', '') . "\n"; diff --git a/ext/hash/tests/sha512-224.phpt b/ext/hash/tests/sha512-224.phpt index 3769832ee6..6a3ae32c8e 100644 --- a/ext/hash/tests/sha512-224.phpt +++ b/ext/hash/tests/sha512-224.phpt @@ -1,7 +1,5 @@ --TEST-- -sha512/224 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: sha512/224 algorithm --FILE-- <?php echo hash('sha512/224', '') . "\n"; diff --git a/ext/hash/tests/sha512-256.phpt b/ext/hash/tests/sha512-256.phpt index 33ae5f1770..3bcfd34254 100644 --- a/ext/hash/tests/sha512-256.phpt +++ b/ext/hash/tests/sha512-256.phpt @@ -1,7 +1,5 @@ --TEST-- -sha512/256 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: sha512/256 algorithm --FILE-- <?php echo hash('sha512/256', '') . "\n"; diff --git a/ext/hash/tests/sha512.phpt b/ext/hash/tests/sha512.phpt index 93fbb20d63..1fa420b143 100644 --- a/ext/hash/tests/sha512.phpt +++ b/ext/hash/tests/sha512.phpt @@ -1,7 +1,5 @@ --TEST-- -sha512 algorithm ---SKIPIF-- -<?php if(!extension_loaded("hash")) print "skip"; ?> +Hash: sha512 algorithm --FILE-- <?php echo hash('sha512', '') . "\n"; diff --git a/ext/hash/tests/skip_mhash.inc b/ext/hash/tests/skip_mhash.inc deleted file mode 100644 index 608b557b28..0000000000 --- a/ext/hash/tests/skip_mhash.inc +++ /dev/null @@ -1,5 +0,0 @@ -<?php -if (!function_exists("mhash")) { - die("skip mhash extension is not available"); -} -?> diff --git a/ext/hash/tests/snefru.phpt b/ext/hash/tests/snefru.phpt index 1b0dfa70fe..3d4694e6ba 100644 --- a/ext/hash/tests/snefru.phpt +++ b/ext/hash/tests/snefru.phpt @@ -1,7 +1,5 @@ --TEST-- -snefru ---SKIPIF-- -<?php extension_loaded('hash') or die('skip'); ?> +Hash: snefru algorithm --FILE-- <?php echo hash('snefru', ''), "\n"; diff --git a/ext/hash/tests/tiger.phpt b/ext/hash/tests/tiger.phpt index 5a6c97ce81..cc2306e72c 100644 --- a/ext/hash/tests/tiger.phpt +++ b/ext/hash/tests/tiger.phpt @@ -1,7 +1,5 @@ --TEST-- -tiger ---SKIPIF-- -<?php extension_loaded('hash') or die('skip'); ?> +Hash: tiger algorithm --FILE-- <?php echo hash('tiger192,3', ''),"\n"; diff --git a/ext/hash/tests/whirlpool.phpt b/ext/hash/tests/whirlpool.phpt index 5f9dd164de..267bc8084b 100644 --- a/ext/hash/tests/whirlpool.phpt +++ b/ext/hash/tests/whirlpool.phpt @@ -1,7 +1,5 @@ --TEST-- -whirlpool ---SKIPIF-- -<?php extension_loaded('hash') or die('skip'); ?> +Hash: whirlpool algorithm --FILE-- <?php echo hash('whirlpool', ''), "\n"; |