summaryrefslogtreecommitdiff
path: root/ext/hash
diff options
context:
space:
mode:
Diffstat (limited to 'ext/hash')
-rw-r--r--ext/hash/config.m43
-rw-r--r--ext/hash/config.w323
-rw-r--r--ext/hash/hash.c881
-rw-r--r--ext/hash/hash.stub.php60
-rw-r--r--ext/hash/hash_adler32.c6
-rw-r--r--ext/hash/hash_arginfo.h203
-rw-r--r--ext/hash/hash_crc32.c14
-rw-r--r--ext/hash/hash_fnv.c30
-rw-r--r--ext/hash/hash_gost.c30
-rw-r--r--ext/hash/hash_haval.c37
-rw-r--r--ext/hash/hash_joaat.c23
-rw-r--r--ext/hash/hash_md.c384
-rw-r--r--ext/hash/hash_ripemd.c26
-rw-r--r--ext/hash/hash_sha.c371
-rw-r--r--ext/hash/hash_sha3.c102
-rw-r--r--ext/hash/hash_snefru.c21
-rw-r--r--ext/hash/hash_tiger.c21
-rw-r--r--ext/hash/hash_whirlpool.c24
-rw-r--r--ext/hash/php_hash.h41
-rw-r--r--ext/hash/php_hash_adler32.h3
-rw-r--r--ext/hash/php_hash_crc32.h3
-rw-r--r--ext/hash/php_hash_crc32_tables.h2
-rw-r--r--ext/hash/php_hash_fnv.h4
-rw-r--r--ext/hash/php_hash_gost.h5
-rw-r--r--ext/hash/php_hash_haval.h5
-rw-r--r--ext/hash/php_hash_joaat.h3
-rw-r--r--ext/hash/php_hash_md.h56
-rw-r--r--ext/hash/php_hash_ripemd.h6
-rw-r--r--ext/hash/php_hash_sha.h31
-rw-r--r--ext/hash/php_hash_sha3.h7
-rw-r--r--ext/hash/php_hash_snefru.h3
-rw-r--r--ext/hash/php_hash_snefru_tables.h2
-rw-r--r--ext/hash/php_hash_tiger.h5
-rw-r--r--ext/hash/php_hash_tiger_tables.h2
-rw-r--r--ext/hash/php_hash_whirlpool.h3
-rw-r--r--ext/hash/php_hash_whirlpool_tables.h2
-rw-r--r--ext/hash/sha3/generic32lc/KeccakHash.h2
-rw-r--r--ext/hash/sha3/generic32lc/KeccakP-1600-inplace32BI.c12
-rw-r--r--ext/hash/sha3/generic64lc/KeccakHash.h2
-rw-r--r--ext/hash/sha3/generic64lc/KeccakP-1600-opt64.c10
-rw-r--r--ext/hash/tests/fnv132.phpt348
-rw-r--r--ext/hash/tests/fnv164.phpt348
-rw-r--r--ext/hash/tests/fnv1a32.phpt614
-rw-r--r--ext/hash/tests/fnv1a64.phpt614
-rw-r--r--ext/hash/tests/hash-clone.phpt28
-rw-r--r--ext/hash/tests/hash_algos.phpt8
-rw-r--r--ext/hash/tests/hash_copy_001.phpt28
-rw-r--r--ext/hash/tests/hash_equals.phpt67
-rw-r--r--ext/hash/tests/hash_error.phpt40
-rw-r--r--ext/hash/tests/hash_file_basic.phpt8
-rw-r--r--ext/hash/tests/hash_file_basic1.phpt10
-rw-r--r--ext/hash/tests/hash_file_error.phpt39
-rw-r--r--ext/hash/tests/hash_hkdf_basic.phpt5
-rw-r--r--ext/hash/tests/hash_hkdf_edges.phpt19
-rw-r--r--ext/hash/tests/hash_hkdf_error.phpt118
-rw-r--r--ext/hash/tests/hash_hkdf_rfc5869.phpt103
-rw-r--r--ext/hash/tests/hash_hmac_basic.phpt8
-rw-r--r--ext/hash/tests/hash_hmac_error.phpt52
-rw-r--r--ext/hash/tests/hash_hmac_file_basic.phpt24
-rw-r--r--ext/hash/tests/hash_hmac_file_error.phpt64
-rw-r--r--ext/hash/tests/hash_init_error.phpt59
-rw-r--r--ext/hash/tests/hash_pbkdf2_basic.phpt8
-rw-r--r--ext/hash/tests/hash_pbkdf2_error.phpt92
-rw-r--r--ext/hash/tests/hash_serialize_001.phpt361
-rw-r--r--ext/hash/tests/hash_serialize_002.phpt116
-rw-r--r--ext/hash/tests/hash_serialize_003.phpt261
-rw-r--r--ext/hash/tests/hash_serialize_004.phpt45
-rw-r--r--ext/hash/tests/hash_update_stream_basic_001.phpt33
-rw-r--r--ext/hash/tests/haval.phpt24
-rw-r--r--ext/hash/tests/joaat.phpt22
-rw-r--r--ext/hash/tests/mhash_001.phpt20
-rw-r--r--ext/hash/tests/mhash_002.phpt14
-rw-r--r--ext/hash/tests/mhash_003.phpt24
-rw-r--r--ext/hash/tests/reuse.phpt12
-rw-r--r--ext/hash/tests/serialize-context.phpt13
75 files changed, 3301 insertions, 2796 deletions
diff --git a/ext/hash/config.m4 b/ext/hash/config.m4
index 03c4d83968..d84e89cc6b 100644
--- a/ext/hash/config.m4
+++ b/ext/hash/config.m4
@@ -11,9 +11,6 @@ if test "$PHP_MHASH" != "no"; then
AC_DEFINE(PHP_MHASH_BC, 1, [ ])
fi
-dnl Defined for BC.
-AC_DEFINE(HAVE_HASH_EXT,1,[Have HASH Extension])
-
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])
diff --git a/ext/hash/config.w32 b/ext/hash/config.w32
index 3ed785bfda..5d6be6b922 100644
--- a/ext/hash/config.w32
+++ b/ext/hash/config.w32
@@ -6,9 +6,6 @@ if (PHP_MHASH != 'no') {
AC_DEFINE('PHP_MHASH_BC', 1);
}
-// Defined for BC.
-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 ' +
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 856ae0e11b..40746ea003 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -25,9 +23,23 @@
#include "php_hash.h"
#include "ext/standard/info.h"
#include "ext/standard/file.h"
+#include "ext/standard/php_var.h"
+#include "ext/spl/spl_exceptions.h"
#include "zend_interfaces.h"
#include "zend_exceptions.h"
+#include "zend_smart_str.h"
+
+#include "hash_arginfo.h"
+
+#ifdef PHP_WIN32
+# define __alignof__ __alignof
+#else
+# ifndef HAVE_ALIGNOF
+# include <stddef.h>
+# define __alignof__(type) offsetof (struct { char c; type member;}, member)
+# endif
+#endif
HashTable php_hash_hashtable;
zend_class_entry *php_hashcontext_ce;
@@ -83,11 +95,11 @@ static struct mhash_bc_entry mhash_to_hash[MHASH_NUM_ALGOS] = {
/* Hash Registry Access */
-PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const char *algo, size_t algo_len) /* {{{ */
+PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(zend_string *algo) /* {{{ */
{
- char *lower = zend_str_tolower_dup(algo, algo_len);
- php_hash_ops *ops = zend_hash_str_find_ptr(&php_hash_hashtable, lower, algo_len);
- efree(lower);
+ zend_string *lower = zend_string_tolower(algo);
+ php_hash_ops *ops = zend_hash_find_ptr(&php_hash_hashtable, lower);
+ zend_string_release(lower);
return ops;
}
@@ -111,31 +123,254 @@ PHP_HASH_API int php_hash_copy(const void *ops, void *orig_context, void *dest_c
}
/* }}} */
+
+static inline size_t align_to(size_t pos, size_t alignment) {
+ size_t offset = pos & (alignment - 1);
+ return pos + (offset ? alignment - offset : 0);
+}
+
+static size_t parse_serialize_spec(
+ const char **specp, size_t *pos, size_t *sz, size_t *max_alignment) {
+ size_t count, alignment;
+ const char *spec = *specp;
+ /* parse size */
+ if (*spec == 's' || *spec == 'S') {
+ *sz = 2;
+ alignment = __alignof__(uint16_t); /* usually 2 */
+ } else if (*spec == 'l' || *spec == 'L') {
+ *sz = 4;
+ alignment = __alignof__(uint32_t); /* usually 4 */
+ } else if (*spec == 'q' || *spec == 'Q') {
+ *sz = 8;
+ alignment = __alignof__(uint64_t); /* usually 8 */
+ } else if (*spec == 'i' || *spec == 'I') {
+ *sz = sizeof(int);
+ alignment = __alignof__(int); /* usually 4 */
+ } else {
+ ZEND_ASSERT(*spec == 'b' || *spec == 'B');
+ *sz = 1;
+ alignment = 1;
+ }
+ /* process alignment */
+ *pos = align_to(*pos, alignment);
+ *max_alignment = *max_alignment < alignment ? alignment : *max_alignment;
+ /* parse count */
+ ++spec;
+ if (isdigit((unsigned char) *spec)) {
+ count = 0;
+ while (isdigit((unsigned char) *spec)) {
+ count = 10 * count + *spec - '0';
+ ++spec;
+ }
+ } else {
+ count = 1;
+ }
+ *specp = spec;
+ return count;
+}
+
+static uint64_t one_from_buffer(size_t sz, const unsigned char *buf) {
+ if (sz == 2) {
+ const uint16_t *x = (const uint16_t *) buf;
+ return *x;
+ } else if (sz == 4) {
+ const uint32_t *x = (const uint32_t *) buf;
+ return *x;
+ } else if (sz == 8) {
+ const uint64_t *x = (const uint64_t *) buf;
+ return *x;
+ } else {
+ ZEND_ASSERT(sz == 1);
+ return *buf;
+ }
+}
+
+static void one_to_buffer(size_t sz, unsigned char *buf, uint64_t val) {
+ if (sz == 2) {
+ uint16_t *x = (uint16_t *) buf;
+ *x = val;
+ } else if (sz == 4) {
+ uint32_t *x = (uint32_t *) buf;
+ *x = val;
+ } else if (sz == 8) {
+ uint64_t *x = (uint64_t *) buf;
+ *x = val;
+ } else {
+ ZEND_ASSERT(sz == 1);
+ *buf = val;
+ }
+}
+
+/* Serialize a hash context according to a `spec` string.
+ Spec contents:
+ b[COUNT] -- serialize COUNT bytes
+ s[COUNT] -- serialize COUNT 16-bit integers
+ l[COUNT] -- serialize COUNT 32-bit integers
+ q[COUNT] -- serialize COUNT 64-bit integers
+ i[COUNT] -- serialize COUNT `int`s
+ B[COUNT] -- skip COUNT bytes
+ S[COUNT], L[COUNT], etc. -- uppercase versions skip instead of read
+ . (must be last character) -- assert that the hash context has exactly
+ this size
+ Example: "llllllb64l16." is the spec for an MD5 context: 6 32-bit
+ integers, followed by 64 bytes, then 16 32-bit integers, and that's
+ exactly the size of the context.
+
+ The serialization result is an array. Each integer is serialized as a
+ 32-bit integer, except that a run of 2 or more bytes is encoded as a
+ string, and each 64-bit integer is serialized as two 32-bit integers, least
+ significant bits first. This allows 32-bit and 64-bit architectures to
+ interchange serialized HashContexts. */
+
+PHP_HASH_API int php_hash_serialize_spec(const php_hashcontext_object *hash, zval *zv, const char *spec) /* {{{ */
+{
+ size_t pos = 0, max_alignment = 1;
+ unsigned char *buf = (unsigned char *) hash->context;
+ zval tmp;
+ array_init(zv);
+ while (*spec != '\0' && *spec != '.') {
+ char spec_ch = *spec;
+ size_t sz, count = parse_serialize_spec(&spec, &pos, &sz, &max_alignment);
+ if (pos + count * sz > hash->ops->context_size) {
+ return FAILURE;
+ }
+ if (isupper((unsigned char) spec_ch)) {
+ pos += count * sz;
+ } else if (sz == 1 && count > 1) {
+ ZVAL_STRINGL(&tmp, (char *) buf + pos, count);
+ zend_hash_next_index_insert(Z_ARRVAL_P(zv), &tmp);
+ pos += count;
+ } else {
+ while (count > 0) {
+ uint64_t val = one_from_buffer(sz, buf + pos);
+ pos += sz;
+ ZVAL_LONG(&tmp, (int32_t) val);
+ zend_hash_next_index_insert(Z_ARRVAL_P(zv), &tmp);
+ if (sz == 8) {
+ ZVAL_LONG(&tmp, (int32_t) (val >> 32));
+ zend_hash_next_index_insert(Z_ARRVAL_P(zv), &tmp);
+ }
+ --count;
+ }
+ }
+ }
+ if (*spec == '.' && align_to(pos, max_alignment) != hash->ops->context_size) {
+ return FAILURE;
+ }
+ return SUCCESS;
+}
+/* }}} */
+
+/* Unserialize a hash context serialized by `php_hash_serialize_spec` with `spec`.
+ Returns SUCCESS on success and a negative error code on failure.
+ Codes: FAILURE (-1) == generic failure
+ -999 == spec wrong size for context
+ -1000 - POS == problem at byte offset POS */
+
+PHP_HASH_API int php_hash_unserialize_spec(php_hashcontext_object *hash, const zval *zv, const char *spec) /* {{{ */
+{
+ size_t pos = 0, max_alignment = 1, j = 0;
+ unsigned char *buf = (unsigned char *) hash->context;
+ zval *elt;
+ if (Z_TYPE_P(zv) != IS_ARRAY) {
+ return FAILURE;
+ }
+ while (*spec != '\0' && *spec != '.') {
+ char spec_ch = *spec;
+ size_t sz, count = parse_serialize_spec(&spec, &pos, &sz, &max_alignment);
+ if (pos + count * sz > hash->ops->context_size) {
+ return -999;
+ }
+ if (isupper((unsigned char) spec_ch)) {
+ pos += count * sz;
+ } else if (sz == 1 && count > 1) {
+ elt = zend_hash_index_find(Z_ARRVAL_P(zv), j);
+ if (!elt || Z_TYPE_P(elt) != IS_STRING || Z_STRLEN_P(elt) != count) {
+ return -1000 - pos;
+ }
+ ++j;
+ memcpy(buf + pos, Z_STRVAL_P(elt), count);
+ pos += count;
+ } else {
+ while (count > 0) {
+ uint64_t val;
+ elt = zend_hash_index_find(Z_ARRVAL_P(zv), j);
+ if (!elt || Z_TYPE_P(elt) != IS_LONG) {
+ return -1000 - pos;
+ }
+ ++j;
+ val = (uint32_t) Z_LVAL_P(elt);
+ if (sz == 8) {
+ elt = zend_hash_index_find(Z_ARRVAL_P(zv), j);
+ if (!elt || Z_TYPE_P(elt) != IS_LONG) {
+ return -1000 - pos;
+ }
+ ++j;
+ val += ((uint64_t) Z_LVAL_P(elt)) << 32;
+ }
+ one_to_buffer(sz, buf + pos, val);
+ pos += sz;
+ --count;
+ }
+ }
+ }
+ if (*spec == '.' && align_to(pos, max_alignment) != hash->ops->context_size) {
+ return -999;
+ }
+ return SUCCESS;
+}
+/* }}} */
+
+PHP_HASH_API int php_hash_serialize(const php_hashcontext_object *hash, zend_long *magic, zval *zv) /* {{{ */
+{
+ if (hash->ops->serialize_spec) {
+ *magic = PHP_HASH_SERIALIZE_MAGIC_SPEC;
+ return php_hash_serialize_spec(hash, zv, hash->ops->serialize_spec);
+ } else {
+ return FAILURE;
+ }
+}
+/* }}} */
+
+PHP_HASH_API int php_hash_unserialize(php_hashcontext_object *hash, zend_long magic, const zval *zv) /* {{{ */
+{
+ if (hash->ops->serialize_spec
+ && magic == PHP_HASH_SERIALIZE_MAGIC_SPEC) {
+ return php_hash_unserialize_spec(hash, zv, hash->ops->serialize_spec);
+ } else {
+ return FAILURE;
+ }
+}
+/* }}} */
+
/* Userspace */
static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_bool raw_output_default) /* {{{ */
{
- zend_string *digest;
- char *algo, *data;
- size_t algo_len, data_len;
+ zend_string *digest, *algo;
+ char *data;
+ size_t data_len;
zend_bool raw_output = raw_output_default;
const php_hash_ops *ops;
void *context;
php_stream *stream = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", &algo, &algo_len, &data, &data_len, &raw_output) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR(algo)
+ Z_PARAM_STRING(data, data_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(raw_output)
+ ZEND_PARSE_PARAMETERS_END();
- ops = php_hash_fetch_ops(algo, algo_len);
+ ops = php_hash_fetch_ops(algo);
if (!ops) {
- php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", algo);
- RETURN_FALSE;
+ zend_argument_value_error(1, "must be a valid hashing algorithm");
+ RETURN_THROWS();
}
if (isfilename) {
if (CHECK_NULL_PATH(data, data_len)) {
- php_error_docref(NULL, E_WARNING, "Invalid path");
- RETURN_FALSE;
+ zend_argument_type_error(1, "must be a valid path");
+ RETURN_THROWS();
}
stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, FG(default_context));
if (!stream) {
@@ -144,7 +379,7 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_
}
}
- context = emalloc(ops->context_size);
+ context = php_hash_alloc_context(ops);
ops->hash_init(context);
if (isfilename) {
@@ -181,8 +416,7 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_
}
/* }}} */
-/* {{{ proto string hash(string algo, string data[, bool raw_output = false])
-Generate a hash of a given input string
+/* {{{ Generate a hash of a given input string
Returns lowercase hexits by default */
PHP_FUNCTION(hash)
{
@@ -190,8 +424,7 @@ PHP_FUNCTION(hash)
}
/* }}} */
-/* {{{ proto string hash_file(string algo, string filename[, bool raw_output = false])
-Generate a hash of a given file
+/* {{{ Generate a hash of a given file
Returns lowercase hexits by default */
PHP_FUNCTION(hash_file)
{
@@ -236,34 +469,30 @@ static inline void php_hash_hmac_round(unsigned char *final, const php_hash_ops
static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_bool raw_output_default) /* {{{ */
{
- zend_string *digest;
- char *algo, *data, *key;
+ zend_string *digest, *algo;
+ char *data, *key;
unsigned char *K;
- size_t algo_len, data_len, key_len;
+ size_t data_len, key_len;
zend_bool raw_output = raw_output_default;
const php_hash_ops *ops;
void *context;
php_stream *stream = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|b", &algo, &algo_len, &data, &data_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sss|b", &algo, &data, &data_len,
&key, &key_len, &raw_output) == FAILURE) {
- return;
+ RETURN_THROWS();
}
- ops = php_hash_fetch_ops(algo, algo_len);
- if (!ops) {
- php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", algo);
- RETURN_FALSE;
- }
- else if (!ops->is_crypto) {
- php_error_docref(NULL, E_WARNING, "Non-cryptographic hashing algorithm: %s", algo);
- RETURN_FALSE;
+ ops = php_hash_fetch_ops(algo);
+ if (!ops || !ops->is_crypto) {
+ zend_argument_value_error(1, "must be a valid cryptographic hashing algorithm");
+ RETURN_THROWS();
}
if (isfilename) {
if (CHECK_NULL_PATH(data, data_len)) {
- php_error_docref(NULL, E_WARNING, "Invalid path");
- RETURN_FALSE;
+ zend_argument_type_error(2, "must be a valid path");
+ RETURN_THROWS();
}
stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, FG(default_context));
if (!stream) {
@@ -272,7 +501,7 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename,
}
}
- context = emalloc(ops->context_size);
+ context = php_hash_alloc_context(ops);
K = emalloc(ops->block_size);
digest = zend_string_alloc(ops->digest_size, 0);
@@ -323,8 +552,7 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename,
}
/* }}} */
-/* {{{ proto string hash_hmac(string algo, string data, string key[, bool raw_output = false])
-Generate a hash of a given input string with a key using HMAC
+/* {{{ Generate a hash of a given input string with a key using HMAC
Returns lowercase hexits by default */
PHP_FUNCTION(hash_hmac)
{
@@ -332,8 +560,7 @@ PHP_FUNCTION(hash_hmac)
}
/* }}} */
-/* {{{ proto string hash_hmac_file(string algo, string filename, string key[, bool raw_output = false])
-Generate a hash of a given file with a key using HMAC
+/* {{{ Generate a hash of a given file with a key using HMAC
Returns lowercase hexits by default */
PHP_FUNCTION(hash_hmac_file)
{
@@ -341,43 +568,41 @@ PHP_FUNCTION(hash_hmac_file)
}
/* }}} */
-/* {{{ proto HashContext hash_init(string algo[, int options, string key])
-Initialize a hashing context */
+/* {{{ 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;
- if (zend_parse_parameters(argc, "S|lS", &algo, &options, &key) == FAILURE) {
- RETURN_NULL();
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lS", &algo, &options, &key) == FAILURE) {
+ RETURN_THROWS();
}
- ops = php_hash_fetch_ops(ZSTR_VAL(algo), ZSTR_LEN(algo));
+ ops = php_hash_fetch_ops(algo);
if (!ops) {
- php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", ZSTR_VAL(algo));
- RETURN_FALSE;
+ zend_argument_value_error(1, "must be a valid hashing algorithm");
+ RETURN_THROWS();
}
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));
- RETURN_FALSE;
+ zend_argument_value_error(1, "must be a cryptographic hashing algorithm if HMAC is requested");
+ RETURN_THROWS();
}
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");
- RETURN_FALSE;
+ zend_argument_value_error(3, "cannot be empty when HMAC is requested");
+ RETURN_THROWS();
}
}
object_init_ex(return_value, php_hashcontext_ce);
hash = php_hashcontext_from_object(Z_OBJ_P(return_value));
- context = emalloc(ops->context_size);
+ context = php_hash_alloc_context(ops);
ops->hash_init(context);
hash->ops = ops;
@@ -412,15 +637,14 @@ PHP_FUNCTION(hash_init)
}
/* }}} */
-#define PHP_HASHCONTEXT_VERIFY(func, hash) { \
+#define PHP_HASHCONTEXT_VERIFY(hash) { \
if (!hash->context) { \
- php_error(E_WARNING, "%s(): supplied resource is not a valid Hash Context resource", func); \
- RETURN_NULL(); \
+ zend_argument_type_error(1, "must be a valid Hash Context resource"); \
+ RETURN_THROWS(); \
} \
}
-/* {{{ proto bool hash_update(HashContext context, string data)
-Pump data into the hashing algorithm */
+/* {{{ Pump data into the hashing algorithm */
PHP_FUNCTION(hash_update)
{
zval *zhash;
@@ -428,19 +652,18 @@ PHP_FUNCTION(hash_update)
zend_string *data;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "OS", &zhash, php_hashcontext_ce, &data) == FAILURE) {
- return;
+ RETURN_THROWS();
}
hash = php_hashcontext_from_object(Z_OBJ_P(zhash));
- PHP_HASHCONTEXT_VERIFY("hash_update", hash);
+ PHP_HASHCONTEXT_VERIFY(hash);
hash->ops->hash_update(hash->context, (unsigned char *) ZSTR_VAL(data), ZSTR_LEN(data));
RETURN_TRUE;
}
/* }}} */
-/* {{{ proto int hash_update_stream(HashContext context, resource handle[, int length])
-Pump data into the hashing algorithm from an open stream */
+/* {{{ Pump data into the hashing algorithm from an open stream */
PHP_FUNCTION(hash_update_stream)
{
zval *zhash, *zstream;
@@ -449,11 +672,11 @@ PHP_FUNCTION(hash_update_stream)
zend_long length = -1, didread = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Or|l", &zhash, php_hashcontext_ce, &zstream, &length) == FAILURE) {
- return;
+ RETURN_THROWS();
}
hash = php_hashcontext_from_object(Z_OBJ_P(zhash));
- PHP_HASHCONTEXT_VERIFY("hash_update_stream", hash);
+ PHP_HASHCONTEXT_VERIFY(hash);
php_stream_from_zval(stream, zstream);
while (length) {
@@ -477,24 +700,23 @@ PHP_FUNCTION(hash_update_stream)
}
/* }}} */
-/* {{{ proto bool hash_update_file(HashContext context, string filename[, resource context])
-Pump data into the hashing algorithm from a file */
+/* {{{ Pump data into the hashing algorithm from a file */
PHP_FUNCTION(hash_update_file)
{
zval *zhash, *zcontext = NULL;
php_hashcontext_object *hash;
- php_stream_context *context;
+ php_stream_context *context = NULL;
php_stream *stream;
zend_string *filename;
char buf[1024];
ssize_t n;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "OP|r", &zhash, php_hashcontext_ce, &filename, &zcontext) == FAILURE) {
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OP|r!", &zhash, php_hashcontext_ce, &filename, &zcontext) == FAILURE) {
+ RETURN_THROWS();
}
hash = php_hashcontext_from_object(Z_OBJ_P(zhash));
- PHP_HASHCONTEXT_VERIFY("hash_update_file", hash);
+ PHP_HASHCONTEXT_VERIFY(hash);
context = php_stream_context_from_zval(zcontext, 0);
stream = php_stream_open_wrapper_ex(ZSTR_VAL(filename), "rb", REPORT_ERRORS, NULL, context);
@@ -512,8 +734,7 @@ PHP_FUNCTION(hash_update_file)
}
/* }}} */
-/* {{{ proto string hash_final(HashContext context[, bool raw_output=false])
-Output resulting digest */
+/* {{{ Output resulting digest */
PHP_FUNCTION(hash_final)
{
zval *zhash;
@@ -523,11 +744,11 @@ PHP_FUNCTION(hash_final)
size_t digest_len;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &zhash, php_hashcontext_ce, &raw_output) == FAILURE) {
- return;
+ RETURN_THROWS();
}
hash = php_hashcontext_from_object(Z_OBJ_P(zhash));
- PHP_HASHCONTEXT_VERIFY("hash_final", hash);
+ PHP_HASHCONTEXT_VERIFY(hash);
digest_len = hash->ops->digest_size;
digest = zend_string_alloc(digest_len, 0);
@@ -541,7 +762,7 @@ PHP_FUNCTION(hash_final)
hash->key[i] ^= 0x6A;
}
- /* Feed this result into the outter hash */
+ /* Feed this result into the outer hash */
hash->ops->hash_init(hash->context);
hash->ops->hash_update(hash->context, hash->key, hash->ops->block_size);
hash->ops->hash_update(hash->context, (unsigned char *) ZSTR_VAL(digest), hash->ops->digest_size);
@@ -571,31 +792,35 @@ PHP_FUNCTION(hash_final)
}
/* }}} */
-/* {{{ proto HashContext hash_copy(HashContext context)
-Copy hash object */
+/* {{{ Copy hash object */
PHP_FUNCTION(hash_copy)
{
zval *zhash;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zhash, php_hashcontext_ce) == FAILURE) {
- return;
+ RETURN_THROWS();
}
- RETVAL_OBJ(Z_OBJ_HANDLER_P(zhash, clone_obj)(zhash));
+ RETVAL_OBJ(Z_OBJ_HANDLER_P(zhash, clone_obj)(Z_OBJ_P(zhash)));
if (php_hashcontext_from_object(Z_OBJ_P(return_value))->context == NULL) {
zval_ptr_dtor(return_value);
- RETURN_FALSE;
+
+ zend_throw_error(NULL, "Cannot copy hash");
+ RETURN_THROWS();
}
}
/* }}} */
-/* {{{ proto array hash_algos(void)
-Return a list of registered hashing algorithms */
+/* {{{ Return a list of registered hashing algorithms */
PHP_FUNCTION(hash_algos)
{
zend_string *str;
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
+
array_init(return_value);
ZEND_HASH_FOREACH_STR_KEY(&php_hash_hashtable, str) {
add_next_index_str(return_value, zend_string_copy(str));
@@ -603,13 +828,16 @@ PHP_FUNCTION(hash_algos)
}
/* }}} */
-/* {{{ proto array hash_hmac_algos(void)
-Return a list of registered hashing algorithms suitable for hash_hmac() */
+/* {{{ Return a list of registered hashing algorithms suitable for hash_hmac() */
PHP_FUNCTION(hash_hmac_algos)
{
zend_string *str;
const php_hash_ops *ops;
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
+
array_init(return_value);
ZEND_HASH_FOREACH_STR_KEY_PTR(&php_hash_hashtable, str, ops) {
if (ops->is_crypto) {
@@ -619,8 +847,7 @@ PHP_FUNCTION(hash_hmac_algos)
}
/* }}} */
-/* {{{ proto string hash_hkdf(string algo, string ikm [, int length = 0, string info = '', string salt = ''])
-RFC5869 HMAC-based key derivation function */
+/* {{{ RFC5869 HMAC-based key derivation function */
PHP_FUNCTION(hash_hkdf)
{
zend_string *returnval, *ikm, *algo, *info = NULL, *salt = NULL;
@@ -632,36 +859,31 @@ PHP_FUNCTION(hash_hkdf)
void *context;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|lSS", &algo, &ikm, &length, &info, &salt) == FAILURE) {
- return;
+ RETURN_THROWS();
}
- 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));
- RETURN_FALSE;
- }
-
- if (!ops->is_crypto) {
- php_error_docref(NULL, E_WARNING, "Non-cryptographic hashing algorithm: %s", ZSTR_VAL(algo));
- RETURN_FALSE;
+ ops = php_hash_fetch_ops(algo);
+ if (!ops || !ops->is_crypto) {
+ zend_argument_value_error(1, "must be a valid cryptographic hashing algorithm");
+ RETURN_THROWS();
}
if (ZSTR_LEN(ikm) == 0) {
- php_error_docref(NULL, E_WARNING, "Input keying material cannot be empty");
- RETURN_FALSE;
+ zend_argument_value_error(2, "cannot be empty");
+ RETURN_THROWS();
}
if (length < 0) {
- php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0: " ZEND_LONG_FMT, length);
- RETURN_FALSE;
+ zend_argument_value_error(3, "must be greater than or equal to 0");
+ RETURN_THROWS();
} else if (length == 0) {
length = ops->digest_size;
} 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;
+ zend_argument_value_error(3, "must be less than or equal to %zd", ops->digest_size * 255);
+ RETURN_THROWS();
}
- context = emalloc(ops->context_size);
+ context = php_hash_alloc_context(ops);
// Extract
ops->hash_init(context);
@@ -717,50 +939,45 @@ PHP_FUNCTION(hash_hkdf)
RETURN_STR(returnval);
}
-/* {{{ proto string hash_pbkdf2(string algo, string password, string salt, int iterations [, int length = 0, bool raw_output = false])
-Generate a PBKDF2 hash of the given password and salt
+/* {{{ Generate a PBKDF2 hash of the given password and salt
Returns lowercase hexits by default */
PHP_FUNCTION(hash_pbkdf2)
{
- zend_string *returnval;
- char *algo, *salt, *pass = NULL;
+ zend_string *returnval, *algo;
+ char *salt, *pass = NULL;
unsigned char *computed_salt, *digest, *temp, *result, *K1, *K2 = NULL;
zend_long loops, i, j, iterations, digest_length = 0, length = 0;
- size_t algo_len, pass_len, salt_len = 0;
+ size_t pass_len, salt_len = 0;
zend_bool raw_output = 0;
const php_hash_ops *ops;
void *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "sssl|lb", &algo, &algo_len, &pass, &pass_len, &salt, &salt_len, &iterations, &length, &raw_output) == FAILURE) {
- return;
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sssl|lb", &algo, &pass, &pass_len, &salt, &salt_len, &iterations, &length, &raw_output) == FAILURE) {
+ RETURN_THROWS();
}
- ops = php_hash_fetch_ops(algo, algo_len);
- if (!ops) {
- php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", algo);
- RETURN_FALSE;
+ ops = php_hash_fetch_ops(algo);
+ if (!ops || !ops->is_crypto) {
+ zend_argument_value_error(1, "must be a valid cryptographic hashing algorithm");
+ RETURN_THROWS();
}
- else if (!ops->is_crypto) {
- php_error_docref(NULL, E_WARNING, "Non-cryptographic hashing algorithm: %s", algo);
- RETURN_FALSE;
+
+ if (salt_len > INT_MAX - 4) {
+ zend_argument_value_error(3, "must be less than or equal to INT_MAX - 4 bytes");
+ RETURN_THROWS();
}
if (iterations <= 0) {
- php_error_docref(NULL, E_WARNING, "Iterations must be a positive integer: " ZEND_LONG_FMT, iterations);
- RETURN_FALSE;
+ zend_argument_value_error(4, "must be greater than 0");
+ RETURN_THROWS();
}
if (length < 0) {
- php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0: " ZEND_LONG_FMT, length);
- RETURN_FALSE;
- }
-
- if (salt_len > INT_MAX - 4) {
- php_error_docref(NULL, E_WARNING, "Supplied salt is too long, max of INT_MAX - 4 bytes: %zd supplied", salt_len);
- RETURN_FALSE;
+ zend_argument_value_error(5, "must be greater than or equal to 0");
+ RETURN_THROWS();
}
- context = emalloc(ops->context_size);
+ context = php_hash_alloc_context(ops);
ops->hash_init(context);
K1 = emalloc(ops->block_size);
@@ -846,8 +1063,7 @@ PHP_FUNCTION(hash_pbkdf2)
}
/* }}} */
-/* {{{ proto bool hash_equals(string known_string, string user_string)
- Compares two strings using the same time whether they're equal or not.
+/* {{{ Compares two strings using the same time whether they're equal or not.
A difference in length will leak */
PHP_FUNCTION(hash_equals)
{
@@ -857,18 +1073,18 @@ PHP_FUNCTION(hash_equals)
size_t j;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &known_zval, &user_zval) == FAILURE) {
- return;
+ RETURN_THROWS();
}
/* We only allow comparing string to prevent unexpected results. */
if (Z_TYPE_P(known_zval) != IS_STRING) {
- php_error_docref(NULL, E_WARNING, "Expected known_string to be a string, %s given", zend_zval_type_name(known_zval));
- RETURN_FALSE;
+ zend_argument_type_error(1, "must be of type string, %s given", zend_zval_type_name(known_zval));
+ RETURN_THROWS();
}
if (Z_TYPE_P(user_zval) != IS_STRING) {
- php_error_docref(NULL, E_WARNING, "Expected user_string to be a string, %s given", zend_zval_type_name(user_zval));
- RETURN_FALSE;
+ zend_argument_type_error(2, "must be of type string, %s given", zend_zval_type_name(user_zval));
+ RETURN_THROWS();
}
if (Z_STRLEN_P(known_zval) != Z_STRLEN_P(user_zval)) {
@@ -887,18 +1103,13 @@ PHP_FUNCTION(hash_equals)
}
/* }}} */
-/* {{{ proto HashContext::__construct() */
-static PHP_METHOD(HashContext, __construct) {
+/* {{{ */
+PHP_METHOD(HashContext, __construct) {
/* Normally unreachable as private/final */
zend_throw_exception(zend_ce_error, "Illegal call to private/final constructor", 0);
}
/* }}} */
-static const zend_function_entry php_hashcontext_methods[] = {
- PHP_ME(HashContext, __construct, NULL, ZEND_ACC_PRIVATE)
- PHP_FE_END
-};
-
/* Module Housekeeping */
#define PHP_HASH_HAVAL_REGISTER(p,b) php_hash_register_algo("haval" #b "," #p , &php_hash_##p##haval##b##_ops);
@@ -949,15 +1160,14 @@ static void mhash_init(INIT_FUNC_ARGS)
/* TODO: this cause #69823 zend_register_internal_module(&mhash_module_entry); */
}
-/* {{{ proto string mhash(int hash, string data [, string key])
- Hash data with hash */
+/* {{{ Hash data with hash */
PHP_FUNCTION(mhash)
{
zval *z_algorithm;
zend_long algorithm;
if (zend_parse_parameters(1, "z", &z_algorithm) == FAILURE) {
- return;
+ RETURN_THROWS();
}
algorithm = zval_get_long(z_algorithm);
@@ -980,14 +1190,13 @@ PHP_FUNCTION(mhash)
}
/* }}} */
-/* {{{ proto string mhash_get_hash_name(int hash)
- Gets the name of hash */
+/* {{{ Gets the name of hash */
PHP_FUNCTION(mhash_get_hash_name)
{
zend_long algorithm;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &algorithm) == FAILURE) {
- return;
+ RETURN_THROWS();
}
if (algorithm >= 0 && algorithm < MHASH_NUM_ALGOS) {
@@ -1000,32 +1209,30 @@ PHP_FUNCTION(mhash_get_hash_name)
}
/* }}} */
-/* {{{ proto int mhash_count(void)
- Gets the number of available hashes */
+/* {{{ Gets the number of available hashes */
PHP_FUNCTION(mhash_count)
{
if (zend_parse_parameters_none() == FAILURE) {
- return;
+ RETURN_THROWS();
}
RETURN_LONG(MHASH_NUM_ALGOS - 1);
}
/* }}} */
-/* {{{ proto int mhash_get_block_size(int hash)
- Gets the block size of hash */
+/* {{{ Gets the block size of hash */
PHP_FUNCTION(mhash_get_block_size)
{
zend_long algorithm;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &algorithm) == FAILURE) {
- return;
+ RETURN_THROWS();
}
RETVAL_FALSE;
if (algorithm >= 0 && algorithm < MHASH_NUM_ALGOS) {
struct mhash_bc_entry algorithm_lookup = mhash_to_hash[algorithm];
if (algorithm_lookup.mhash_name) {
- const php_hash_ops *ops = php_hash_fetch_ops(algorithm_lookup.hash_name, strlen(algorithm_lookup.hash_name));
+ const php_hash_ops *ops = zend_hash_str_find_ptr(&php_hash_hashtable, algorithm_lookup.hash_name, strlen(algorithm_lookup.hash_name));
if (ops) {
RETVAL_LONG(ops->digest_size);
}
@@ -1036,8 +1243,7 @@ PHP_FUNCTION(mhash_get_block_size)
#define SALT_SIZE 8
-/* {{{ proto string mhash_keygen_s2k(int hash, string input_password, string salt, int bytes)
- Generates a key using hash functions */
+/* {{{ Generates a key using hash functions */
PHP_FUNCTION(mhash_keygen_s2k)
{
zend_long algorithm, l_bytes;
@@ -1047,13 +1253,13 @@ PHP_FUNCTION(mhash_keygen_s2k)
char padded_salt[SALT_SIZE];
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lssl", &algorithm, &password, &password_len, &salt, &salt_len, &l_bytes) == FAILURE) {
- return;
+ RETURN_THROWS();
}
bytes = (int)l_bytes;
if (bytes <= 0){
- php_error_docref(NULL, E_WARNING, "the byte parameter must be greater than 0");
- RETURN_FALSE;
+ zend_argument_value_error(4, "must be a greater than 0");
+ RETURN_THROWS();
}
salt_len = MIN(salt_len, SALT_SIZE);
@@ -1068,7 +1274,7 @@ PHP_FUNCTION(mhash_keygen_s2k)
if (algorithm >= 0 && algorithm < MHASH_NUM_ALGOS) {
struct mhash_bc_entry algorithm_lookup = mhash_to_hash[algorithm];
if (algorithm_lookup.mhash_name) {
- const php_hash_ops *ops = php_hash_fetch_ops(algorithm_lookup.hash_name, strlen(algorithm_lookup.hash_name));
+ const php_hash_ops *ops = zend_hash_str_find_ptr(&php_hash_hashtable, algorithm_lookup.hash_name, strlen(algorithm_lookup.hash_name));
if (ops) {
unsigned char null = '\0';
void *context;
@@ -1081,7 +1287,7 @@ PHP_FUNCTION(mhash_keygen_s2k)
times++;
}
- context = emalloc(ops->context_size);
+ context = php_hash_alloc_context(ops);
ops->hash_init(context);
key = ecalloc(1, times * block_size);
@@ -1131,11 +1337,7 @@ static zend_object* php_hashcontext_create(zend_class_entry *ce) {
static void php_hashcontext_dtor(zend_object *obj) {
php_hashcontext_object *hash = php_hashcontext_from_object(obj);
- /* Just in case the algo has internally allocated resources */
if (hash->context) {
- unsigned char *dummy = emalloc(hash->ops->digest_size);
- hash->ops->hash_final(dummy, hash->context);
- efree(dummy);
efree(hash->context);
hash->context = NULL;
}
@@ -1149,16 +1351,16 @@ static void php_hashcontext_dtor(zend_object *obj) {
/* }}} */
/* {{{ php_hashcontext_clone */
-static zend_object *php_hashcontext_clone(zval *pzv) {
- php_hashcontext_object *oldobj = php_hashcontext_from_object(Z_OBJ_P(pzv));
- zend_object *znew = php_hashcontext_create(Z_OBJCE_P(pzv));
+static zend_object *php_hashcontext_clone(zend_object *zobj) {
+ php_hashcontext_object *oldobj = php_hashcontext_from_object(zobj);
+ zend_object *znew = php_hashcontext_create(zobj->ce);
php_hashcontext_object *newobj = php_hashcontext_from_object(znew);
- zend_objects_clone_members(znew, Z_OBJ_P(pzv));
+ zend_objects_clone_members(znew, zobj);
newobj->ops = oldobj->ops;
newobj->options = oldobj->options;
- newobj->context = emalloc(newobj->ops->context_size);
+ newobj->context = php_hash_alloc_context(newobj->ops);
newobj->ops->hash_init(newobj->context);
if (SUCCESS != newobj->ops->hash_copy(newobj->ops, oldobj->context, newobj->context)) {
@@ -1176,8 +1378,142 @@ static zend_object *php_hashcontext_clone(zval *pzv) {
}
/* }}} */
-/* {{{ PHP_MINIT_FUNCTION
- */
+/* Serialization format: 5-element array
+ Index 0: hash algorithm (string)
+ Index 1: options (long, 0)
+ Index 2: hash-determined serialization of context state (usually array)
+ Index 3: magic number defining layout of context state (long, usually 2)
+ Index 4: properties (array)
+
+ HashContext serializations are not necessarily portable between architectures or
+ PHP versions. If the format of a serialized hash context changes, that should
+ be reflected in either a different value of `magic` or a different format of
+ the serialized context state. Most context states are unparsed and parsed using
+ a spec string, such as "llb128.", using the format defined by
+ `php_hash_serialize_spec`/`php_hash_unserialize_spec`. Some hash algorithms must
+ also check the unserialized state for validity, to ensure that using an
+ unserialized context is safe from memory errors.
+
+ Currently HASH_HMAC contexts cannot be serialized, because serializing them
+ would require serializing the HMAC key in plaintext. */
+
+/* {{{ Serialize the object */
+PHP_METHOD(HashContext, __serialize)
+{
+ zval *object = ZEND_THIS;
+ php_hashcontext_object *hash = php_hashcontext_from_object(Z_OBJ_P(object));
+ zend_long magic = 0;
+ zval tmp;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
+
+ array_init(return_value);
+
+ if (!hash->ops->hash_serialize) {
+ goto serialize_failure;
+ } else if (hash->options & PHP_HASH_HMAC) {
+ zend_throw_exception(NULL, "HashContext with HASH_HMAC option cannot be serialized", 0);
+ RETURN_THROWS();
+ }
+
+ ZVAL_STRING(&tmp, hash->ops->algo);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &tmp);
+
+ ZVAL_LONG(&tmp, hash->options);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &tmp);
+
+ if (hash->ops->hash_serialize(hash, &magic, &tmp) != SUCCESS) {
+ goto serialize_failure;
+ }
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &tmp);
+
+ ZVAL_LONG(&tmp, magic);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &tmp);
+
+ /* members */
+ ZVAL_ARR(&tmp, zend_std_get_properties(&hash->std));
+ Z_TRY_ADDREF(tmp);
+ zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &tmp);
+
+ return;
+
+serialize_failure:
+ zend_throw_exception_ex(NULL, 0, "HashContext for algorithm \"%s\" cannot be serialized", hash->ops->algo);
+ RETURN_THROWS();
+}
+/* }}} */
+
+/* {{{ unserialize the object */
+PHP_METHOD(HashContext, __unserialize)
+{
+ zval *object = ZEND_THIS;
+ php_hashcontext_object *hash = php_hashcontext_from_object(Z_OBJ_P(object));
+ HashTable *data;
+ zval *algo_zv, *magic_zv, *options_zv, *hash_zv, *members_zv;
+ zend_long magic, options;
+ int unserialize_result;
+ const php_hash_ops *ops;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "h", &data) == FAILURE) {
+ RETURN_THROWS();
+ }
+
+ if (hash->context) {
+ zend_throw_exception(NULL, "HashContext::__unserialize called on initialized object", 0);
+ RETURN_THROWS();
+ }
+
+ algo_zv = zend_hash_index_find(data, 0);
+ options_zv = zend_hash_index_find(data, 1);
+ hash_zv = zend_hash_index_find(data, 2);
+ magic_zv = zend_hash_index_find(data, 3);
+ members_zv = zend_hash_index_find(data, 4);
+
+ if (!algo_zv || Z_TYPE_P(algo_zv) != IS_STRING
+ || !magic_zv || Z_TYPE_P(magic_zv) != IS_LONG
+ || !options_zv || Z_TYPE_P(options_zv) != IS_LONG
+ || !hash_zv
+ || !members_zv || Z_TYPE_P(members_zv) != IS_ARRAY) {
+ zend_throw_exception(NULL, "Incomplete or ill-formed serialization data", 0);
+ RETURN_THROWS();
+ }
+
+ magic = Z_LVAL_P(magic_zv);
+ options = Z_LVAL_P(options_zv);
+ if (options & PHP_HASH_HMAC) {
+ zend_throw_exception(NULL, "HashContext with HASH_HMAC option cannot be serialized", 0);
+ RETURN_THROWS();
+ }
+
+ ops = php_hash_fetch_ops(Z_STR_P(algo_zv));
+ if (!ops) {
+ zend_throw_exception(NULL, "Unknown hash algorithm", 0);
+ RETURN_THROWS();
+ } else if (!ops->hash_unserialize) {
+ zend_throw_exception_ex(NULL, 0, "Hash algorithm \"%s\" cannot be unserialized", ops->algo);
+ RETURN_THROWS();
+ }
+
+ hash->ops = ops;
+ hash->context = php_hash_alloc_context(ops);
+ ops->hash_init(hash->context);
+ hash->options = options;
+
+ unserialize_result = ops->hash_unserialize(hash, magic, hash_zv);
+ if (unserialize_result != SUCCESS) {
+ zend_throw_exception_ex(NULL, 0, "Incomplete or ill-formed serialization data (\"%s\" code %d)", ops->algo, unserialize_result);
+ /* free context */
+ php_hashcontext_dtor(Z_OBJ_P(object));
+ RETURN_THROWS();
+ }
+
+ object_properties_load(&hash->std, Z_ARRVAL_P(members_zv));
+}
+/* }}} */
+
+/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(hash)
{
zend_class_entry ce;
@@ -1243,12 +1579,10 @@ PHP_MINIT_FUNCTION(hash)
REGISTER_LONG_CONSTANT("HASH_HMAC", PHP_HASH_HMAC, CONST_CS | CONST_PERSISTENT);
- INIT_CLASS_ENTRY(ce, "HashContext", php_hashcontext_methods);
+ INIT_CLASS_ENTRY(ce, "HashContext", class_HashContext_methods);
php_hashcontext_ce = zend_register_internal_class(&ce);
php_hashcontext_ce->ce_flags |= ZEND_ACC_FINAL;
php_hashcontext_ce->create_object = php_hashcontext_create;
- php_hashcontext_ce->serialize = zend_class_serialize_deny;
- php_hashcontext_ce->unserialize = zend_class_unserialize_deny;
memcpy(&php_hashcontext_handlers, &std_object_handlers,
sizeof(zend_object_handlers));
@@ -1264,8 +1598,7 @@ PHP_MINIT_FUNCTION(hash)
}
/* }}} */
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
+/* {{{ PHP_MSHUTDOWN_FUNCTION */
PHP_MSHUTDOWN_FUNCTION(hash)
{
zend_hash_destroy(&php_hash_hashtable);
@@ -1274,8 +1607,7 @@ PHP_MSHUTDOWN_FUNCTION(hash)
}
/* }}} */
-/* {{{ PHP_MINFO_FUNCTION
- */
+/* {{{ PHP_MINFO_FUNCTION */
PHP_MINFO_FUNCTION(hash)
{
char buffer[2048];
@@ -1302,194 +1634,11 @@ PHP_MINFO_FUNCTION(hash)
}
/* }}} */
-/* {{{ arginfo */
-#ifdef PHP_HASH_MD5_NOT_IN_CORE
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_md5, 0, 0, 1)
- ZEND_ARG_INFO(0, str)
- ZEND_ARG_INFO(0, raw_output)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_md5_file, 0, 0, 1)
- ZEND_ARG_INFO(0, filename)
- ZEND_ARG_INFO(0, raw_output)
-ZEND_END_ARG_INFO()
-#endif
-
-#ifdef PHP_HASH_SHA1_NOT_IN_CORE
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_sha1, 0, 0, 1)
- ZEND_ARG_INFO(0, str)
- ZEND_ARG_INFO(0, raw_output)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_sha1_file, 0, 0, 1)
- ZEND_ARG_INFO(0, filename)
- ZEND_ARG_INFO(0, raw_output)
-ZEND_END_ARG_INFO()
-#endif
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash, 0, 0, 2)
- ZEND_ARG_INFO(0, algo)
- ZEND_ARG_INFO(0, data)
- ZEND_ARG_INFO(0, raw_output)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_file, 0, 0, 2)
- ZEND_ARG_INFO(0, algo)
- ZEND_ARG_INFO(0, filename)
- ZEND_ARG_INFO(0, raw_output)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_hmac, 0, 0, 3)
- ZEND_ARG_INFO(0, algo)
- ZEND_ARG_INFO(0, data)
- ZEND_ARG_INFO(0, key)
- ZEND_ARG_INFO(0, raw_output)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_hmac_file, 0, 0, 3)
- ZEND_ARG_INFO(0, algo)
- ZEND_ARG_INFO(0, filename)
- ZEND_ARG_INFO(0, key)
- ZEND_ARG_INFO(0, raw_output)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_init, 0, 0, 1)
- ZEND_ARG_INFO(0, algo)
- ZEND_ARG_INFO(0, options)
- ZEND_ARG_INFO(0, key)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_hash_update, 0)
- ZEND_ARG_INFO(0, context)
- ZEND_ARG_INFO(0, data)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_update_stream, 0, 0, 2)
- ZEND_ARG_INFO(0, context)
- ZEND_ARG_INFO(0, handle)
- ZEND_ARG_INFO(0, length)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_update_file, 0, 0, 2)
- ZEND_ARG_INFO(0, context)
- ZEND_ARG_INFO(0, filename)
- ZEND_ARG_INFO(0, stream_context)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_final, 0, 0, 1)
- ZEND_ARG_INFO(0, context)
- ZEND_ARG_INFO(0, raw_output)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_hash_copy, 0)
- ZEND_ARG_INFO(0, context)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_hash_algos, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_pbkdf2, 0, 0, 4)
- ZEND_ARG_INFO(0, algo)
- ZEND_ARG_INFO(0, password)
- ZEND_ARG_INFO(0, salt)
- ZEND_ARG_INFO(0, iterations)
- ZEND_ARG_INFO(0, length)
- ZEND_ARG_INFO(0, raw_output)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_hash_equals, 0)
- ZEND_ARG_INFO(0, known_string)
- ZEND_ARG_INFO(0, user_string)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_hkdf, 0, 0, 2)
- ZEND_ARG_INFO(0, ikm)
- ZEND_ARG_INFO(0, algo)
- ZEND_ARG_INFO(0, length)
- ZEND_ARG_INFO(0, string)
- ZEND_ARG_INFO(0, salt)
-ZEND_END_ARG_INFO()
-
-/* BC Land */
-#ifdef PHP_MHASH_BC
-ZEND_BEGIN_ARG_INFO(arginfo_mhash_get_block_size, 0)
- ZEND_ARG_INFO(0, hash)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_mhash_get_hash_name, 0)
- ZEND_ARG_INFO(0, hash)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_mhash_keygen_s2k, 0)
- ZEND_ARG_INFO(0, hash)
- ZEND_ARG_INFO(0, input_password)
- ZEND_ARG_INFO(0, salt)
- ZEND_ARG_INFO(0, bytes)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_mhash_count, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_mhash, 0, 0, 2)
- ZEND_ARG_INFO(0, hash)
- ZEND_ARG_INFO(0, data)
- ZEND_ARG_INFO(0, key)
-ZEND_END_ARG_INFO()
-#endif
-
-/* }}} */
-
-/* {{{ hash_functions[]
- */
-static const zend_function_entry hash_functions[] = {
- PHP_FE(hash, arginfo_hash)
- PHP_FE(hash_file, arginfo_hash_file)
-
- PHP_FE(hash_hmac, arginfo_hash_hmac)
- PHP_FE(hash_hmac_file, arginfo_hash_hmac_file)
-
- PHP_FE(hash_init, arginfo_hash_init)
- PHP_FE(hash_update, arginfo_hash_update)
- PHP_FE(hash_update_stream, arginfo_hash_update_stream)
- PHP_FE(hash_update_file, arginfo_hash_update_file)
- PHP_FE(hash_final, arginfo_hash_final)
- PHP_FE(hash_copy, arginfo_hash_copy)
-
- PHP_FE(hash_algos, arginfo_hash_algos)
- PHP_FE(hash_hmac_algos, arginfo_hash_algos)
- PHP_FE(hash_pbkdf2, arginfo_hash_pbkdf2)
- PHP_FE(hash_equals, arginfo_hash_equals)
- PHP_FE(hash_hkdf, arginfo_hash_hkdf)
-
- /* BC Land */
-#ifdef PHP_HASH_MD5_NOT_IN_CORE
- PHP_NAMED_FE(md5, php_if_md5, arginfo_hash_md5)
- PHP_NAMED_FE(md5_file, php_if_md5_file, arginfo_hash_md5_file)
-#endif /* PHP_HASH_MD5_NOT_IN_CORE */
-
-#ifdef PHP_HASH_SHA1_NOT_IN_CORE
- PHP_NAMED_FE(sha1, php_if_sha1, arginfo_hash_sha1)
- PHP_NAMED_FE(sha1_file, php_if_sha1_file, arginfo_hash_sha1_file)
-#endif /* PHP_HASH_SHA1_NOT_IN_CORE */
-
-#ifdef PHP_MHASH_BC
- PHP_FE(mhash_keygen_s2k, arginfo_mhash_keygen_s2k)
- PHP_FE(mhash_get_block_size, arginfo_mhash_get_block_size)
- PHP_FE(mhash_get_hash_name, arginfo_mhash_get_hash_name)
- PHP_FE(mhash_count, arginfo_mhash_count)
- PHP_FE(mhash, arginfo_mhash)
-#endif
-
- PHP_FE_END
-};
-/* }}} */
-
-/* {{{ hash_module_entry
- */
+/* {{{ hash_module_entry */
zend_module_entry hash_module_entry = {
STANDARD_MODULE_HEADER,
PHP_HASH_EXTNAME,
- hash_functions,
+ ext_functions,
PHP_MINIT(hash),
PHP_MSHUTDOWN(hash),
NULL, /* RINIT */
diff --git a/ext/hash/hash.stub.php b/ext/hash/hash.stub.php
new file mode 100644
index 0000000000..f8788ed61e
--- /dev/null
+++ b/ext/hash/hash.stub.php
@@ -0,0 +1,60 @@
+<?php
+
+/** @generate-function-entries */
+
+function hash(string $algo, string $data, bool $raw_output = false): string|false {}
+
+function hash_file(string $algo, string $filename, bool $raw_output = false): string|false {}
+
+function hash_hmac(string $algo, string $data, string $key, bool $raw_output = false): string|false {}
+
+function hash_hmac_file(string $algo, string $data, string $key, bool $raw_output = false): string|false {}
+
+function hash_init(string $algo, int $options = 0, string $key = ""): HashContext {}
+
+function hash_update(HashContext $context, string $data): bool {}
+
+/** @param resource $handle */
+function hash_update_stream(HashContext $context, $handle, int $length = -1): int {}
+
+/** @param resource $stream_context */
+function hash_update_file(HashContext $context, string $filename, $stream_context = null): bool {}
+
+function hash_final(HashContext $context, bool $raw_output = false): string {}
+
+function hash_copy(HashContext $context): HashContext {}
+
+function hash_algos(): array {}
+
+function hash_hmac_algos(): array {}
+
+function hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $raw_output = false): string {}
+
+/**
+ * @param $known_string no type juggling is performed
+ * @param $user_string no type juggling is performed
+ */
+function hash_equals(string $known_string, string $user_string): bool {}
+
+function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = '', string $salt = ''): string {}
+
+#ifdef PHP_MHASH_BC
+function mhash_get_block_size(int $hash): int|false {}
+
+function mhash_get_hash_name(int $hash): string|false {}
+
+function mhash_keygen_s2k(int $hash, string $input_password, string $salt, int $bytes): string|false {}
+
+function mhash_count(): int {}
+
+function mhash(int $hash, string $data, string $key = UNKNOWN): string|false {}
+#endif
+
+final class HashContext
+{
+ private function __construct() {}
+
+ public function __serialize(): array {}
+
+ public function __unserialize(array $serialized): void {}
+}
diff --git a/ext/hash/hash_adler32.c b/ext/hash/hash_adler32.c
index 12bc44e446..d45012f8e6 100644
--- a/ext/hash/hash_adler32.c
+++ b/ext/hash/hash_adler32.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -61,10 +59,14 @@ PHP_HASH_API int PHP_ADLER32Copy(const php_hash_ops *ops, PHP_ADLER32_CTX *orig_
}
const php_hash_ops php_hash_adler32_ops = {
+ "adler32",
(php_hash_init_func_t) PHP_ADLER32Init,
(php_hash_update_func_t) PHP_ADLER32Update,
(php_hash_final_func_t) PHP_ADLER32Final,
(php_hash_copy_func_t) PHP_ADLER32Copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_ADLER32_SPEC,
4, /* what to say here? */
4,
sizeof(PHP_ADLER32_CTX),
diff --git a/ext/hash/hash_arginfo.h b/ext/hash/hash_arginfo.h
new file mode 100644
index 0000000000..c877c88e5c
--- /dev/null
+++ b/ext/hash/hash_arginfo.h
@@ -0,0 +1,203 @@
+/* This is a generated file, edit the .stub.php file instead.
+ * Stub hash: d4caa0bf70c25a8436049197e822a6c85e4e4643 */
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
+ ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash_file, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
+ ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash_hmac, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
+ ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false")
+ZEND_END_ARG_INFO()
+
+#define arginfo_hash_hmac_file arginfo_hash_hmac
+
+ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_hash_init, 0, 1, HashContext, 0)
+ ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 0, "\"\"")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_update, 0, 2, _IS_BOOL, 0)
+ ZEND_ARG_OBJ_INFO(0, context, HashContext, 0)
+ ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_update_stream, 0, 2, IS_LONG, 0)
+ ZEND_ARG_OBJ_INFO(0, context, HashContext, 0)
+ ZEND_ARG_INFO(0, handle)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "-1")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_update_file, 0, 2, _IS_BOOL, 0)
+ ZEND_ARG_OBJ_INFO(0, context, HashContext, 0)
+ ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
+ ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, stream_context, "null")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_final, 0, 1, IS_STRING, 0)
+ ZEND_ARG_OBJ_INFO(0, context, HashContext, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_hash_copy, 0, 1, HashContext, 0)
+ ZEND_ARG_OBJ_INFO(0, context, HashContext, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_algos, 0, 0, IS_ARRAY, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_hash_hmac_algos arginfo_hash_algos
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_pbkdf2, 0, 4, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, iterations, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_equals, 0, 2, _IS_BOOL, 0)
+ ZEND_ARG_TYPE_INFO(0, known_string, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, user_string, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_hkdf, 0, 2, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, ikm, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, info, IS_STRING, 0, "\'\'")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, salt, IS_STRING, 0, "\'\'")
+ZEND_END_ARG_INFO()
+
+#if defined(PHP_MHASH_BC)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash_get_block_size, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
+ ZEND_ARG_TYPE_INFO(0, hash, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+#endif
+
+#if defined(PHP_MHASH_BC)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash_get_hash_name, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
+ ZEND_ARG_TYPE_INFO(0, hash, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+#endif
+
+#if defined(PHP_MHASH_BC)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash_keygen_s2k, 0, 4, MAY_BE_STRING|MAY_BE_FALSE)
+ ZEND_ARG_TYPE_INFO(0, hash, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, input_password, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, bytes, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+#endif
+
+#if defined(PHP_MHASH_BC)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mhash_count, 0, 0, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+#endif
+
+#if defined(PHP_MHASH_BC)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
+ ZEND_ARG_TYPE_INFO(0, hash, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+#endif
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_HashContext___construct, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_class_HashContext___serialize arginfo_hash_algos
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_HashContext___unserialize, 0, 1, IS_VOID, 0)
+ ZEND_ARG_TYPE_INFO(0, serialized, IS_ARRAY, 0)
+ZEND_END_ARG_INFO()
+
+
+ZEND_FUNCTION(hash);
+ZEND_FUNCTION(hash_file);
+ZEND_FUNCTION(hash_hmac);
+ZEND_FUNCTION(hash_hmac_file);
+ZEND_FUNCTION(hash_init);
+ZEND_FUNCTION(hash_update);
+ZEND_FUNCTION(hash_update_stream);
+ZEND_FUNCTION(hash_update_file);
+ZEND_FUNCTION(hash_final);
+ZEND_FUNCTION(hash_copy);
+ZEND_FUNCTION(hash_algos);
+ZEND_FUNCTION(hash_hmac_algos);
+ZEND_FUNCTION(hash_pbkdf2);
+ZEND_FUNCTION(hash_equals);
+ZEND_FUNCTION(hash_hkdf);
+#if defined(PHP_MHASH_BC)
+ZEND_FUNCTION(mhash_get_block_size);
+#endif
+#if defined(PHP_MHASH_BC)
+ZEND_FUNCTION(mhash_get_hash_name);
+#endif
+#if defined(PHP_MHASH_BC)
+ZEND_FUNCTION(mhash_keygen_s2k);
+#endif
+#if defined(PHP_MHASH_BC)
+ZEND_FUNCTION(mhash_count);
+#endif
+#if defined(PHP_MHASH_BC)
+ZEND_FUNCTION(mhash);
+#endif
+ZEND_METHOD(HashContext, __construct);
+ZEND_METHOD(HashContext, __serialize);
+ZEND_METHOD(HashContext, __unserialize);
+
+
+static const zend_function_entry ext_functions[] = {
+ ZEND_FE(hash, arginfo_hash)
+ ZEND_FE(hash_file, arginfo_hash_file)
+ ZEND_FE(hash_hmac, arginfo_hash_hmac)
+ ZEND_FE(hash_hmac_file, arginfo_hash_hmac_file)
+ ZEND_FE(hash_init, arginfo_hash_init)
+ ZEND_FE(hash_update, arginfo_hash_update)
+ ZEND_FE(hash_update_stream, arginfo_hash_update_stream)
+ ZEND_FE(hash_update_file, arginfo_hash_update_file)
+ ZEND_FE(hash_final, arginfo_hash_final)
+ ZEND_FE(hash_copy, arginfo_hash_copy)
+ ZEND_FE(hash_algos, arginfo_hash_algos)
+ ZEND_FE(hash_hmac_algos, arginfo_hash_hmac_algos)
+ ZEND_FE(hash_pbkdf2, arginfo_hash_pbkdf2)
+ ZEND_FE(hash_equals, arginfo_hash_equals)
+ ZEND_FE(hash_hkdf, arginfo_hash_hkdf)
+#if defined(PHP_MHASH_BC)
+ ZEND_FE(mhash_get_block_size, arginfo_mhash_get_block_size)
+#endif
+#if defined(PHP_MHASH_BC)
+ ZEND_FE(mhash_get_hash_name, arginfo_mhash_get_hash_name)
+#endif
+#if defined(PHP_MHASH_BC)
+ ZEND_FE(mhash_keygen_s2k, arginfo_mhash_keygen_s2k)
+#endif
+#if defined(PHP_MHASH_BC)
+ ZEND_FE(mhash_count, arginfo_mhash_count)
+#endif
+#if defined(PHP_MHASH_BC)
+ ZEND_FE(mhash, arginfo_mhash)
+#endif
+ ZEND_FE_END
+};
+
+
+static const zend_function_entry class_HashContext_methods[] = {
+ ZEND_ME(HashContext, __construct, arginfo_class_HashContext___construct, ZEND_ACC_PRIVATE)
+ ZEND_ME(HashContext, __serialize, arginfo_class_HashContext___serialize, ZEND_ACC_PUBLIC)
+ ZEND_ME(HashContext, __unserialize, arginfo_class_HashContext___unserialize, ZEND_ACC_PUBLIC)
+ ZEND_FE_END
+};
diff --git a/ext/hash/hash_crc32.c b/ext/hash/hash_crc32.c
index 95f3600dca..de270522d7 100644
--- a/ext/hash/hash_crc32.c
+++ b/ext/hash/hash_crc32.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -80,10 +78,14 @@ PHP_HASH_API int PHP_CRC32Copy(const php_hash_ops *ops, PHP_CRC32_CTX *orig_cont
}
const php_hash_ops php_hash_crc32_ops = {
+ "crc32",
(php_hash_init_func_t) PHP_CRC32Init,
(php_hash_update_func_t) PHP_CRC32Update,
(php_hash_final_func_t) PHP_CRC32LEFinal,
(php_hash_copy_func_t) PHP_CRC32Copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_CRC32_SPEC,
4, /* what to say here? */
4,
sizeof(PHP_CRC32_CTX),
@@ -91,10 +93,14 @@ const php_hash_ops php_hash_crc32_ops = {
};
const php_hash_ops php_hash_crc32b_ops = {
+ "crc32b",
(php_hash_init_func_t) PHP_CRC32Init,
(php_hash_update_func_t) PHP_CRC32BUpdate,
(php_hash_final_func_t) PHP_CRC32BEFinal,
(php_hash_copy_func_t) PHP_CRC32Copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_CRC32_SPEC,
4, /* what to say here? */
4,
sizeof(PHP_CRC32_CTX),
@@ -102,10 +108,14 @@ const php_hash_ops php_hash_crc32b_ops = {
};
const php_hash_ops php_hash_crc32c_ops = {
+ "crc32c",
(php_hash_init_func_t) PHP_CRC32Init,
(php_hash_update_func_t) PHP_CRC32CUpdate,
(php_hash_final_func_t) PHP_CRC32BEFinal,
(php_hash_copy_func_t) PHP_CRC32Copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_CRC32_SPEC,
4, /* what to say here? */
4,
sizeof(PHP_CRC32_CTX),
diff --git a/ext/hash/hash_fnv.c b/ext/hash/hash_fnv.c
index 0ebe867b49..2ee81b9c86 100644
--- a/ext/hash/hash_fnv.c
+++ b/ext/hash/hash_fnv.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -23,10 +21,14 @@
#include "php_hash_fnv.h"
const php_hash_ops php_hash_fnv132_ops = {
+ "fnv132",
(php_hash_init_func_t) PHP_FNV132Init,
(php_hash_update_func_t) PHP_FNV132Update,
(php_hash_final_func_t) PHP_FNV132Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_FNV132_SPEC,
4,
4,
sizeof(PHP_FNV132_CTX),
@@ -34,10 +36,14 @@ const php_hash_ops php_hash_fnv132_ops = {
};
const php_hash_ops php_hash_fnv1a32_ops = {
+ "fnv1a32",
(php_hash_init_func_t) PHP_FNV132Init,
(php_hash_update_func_t) PHP_FNV1a32Update,
- (php_hash_final_func_t) PHP_FNV132Final,
- (php_hash_copy_func_t) php_hash_copy,
+ (php_hash_final_func_t) PHP_FNV132Final,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_FNV132_SPEC,
4,
4,
sizeof(PHP_FNV132_CTX),
@@ -45,10 +51,14 @@ const php_hash_ops php_hash_fnv1a32_ops = {
};
const php_hash_ops php_hash_fnv164_ops = {
+ "fnv164",
(php_hash_init_func_t) PHP_FNV164Init,
(php_hash_update_func_t) PHP_FNV164Update,
(php_hash_final_func_t) PHP_FNV164Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_FNV164_SPEC,
8,
4,
sizeof(PHP_FNV164_CTX),
@@ -56,10 +66,14 @@ const php_hash_ops php_hash_fnv164_ops = {
};
const php_hash_ops php_hash_fnv1a64_ops = {
+ "fnv1a64",
(php_hash_init_func_t) PHP_FNV164Init,
(php_hash_update_func_t) PHP_FNV1a64Update,
- (php_hash_final_func_t) PHP_FNV164Final,
- (php_hash_copy_func_t) php_hash_copy,
+ (php_hash_final_func_t) PHP_FNV164Final,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_FNV164_SPEC,
8,
4,
sizeof(PHP_FNV164_CTX),
diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c
index ded6d1c6a7..46ea032c32 100644
--- a/ext/hash/hash_gost.c
+++ b/ext/hash/hash_gost.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -291,8 +289,7 @@ PHP_HASH_API void PHP_GOSTFinal(unsigned char digest[32], PHP_GOST_CTX *context)
GostTransform(context, context->buffer);
}
- l[0] = context->count[0];
- l[1] = context->count[1];
+ memcpy(l, context->count, sizeof(context->count));
Gost(context, l);
memcpy(l, &context->state[8], sizeof(l));
Gost(context, l);
@@ -307,11 +304,28 @@ PHP_HASH_API void PHP_GOSTFinal(unsigned char digest[32], PHP_GOST_CTX *context)
ZEND_SECURE_ZERO(context, sizeof(*context));
}
+static int php_gost_unserialize(php_hashcontext_object *hash, zend_long magic, const zval *zv)
+{
+ PHP_GOST_CTX *ctx = (PHP_GOST_CTX *) hash->context;
+ int r = FAILURE;
+ if (magic == PHP_HASH_SERIALIZE_MAGIC_SPEC
+ && (r = php_hash_unserialize_spec(hash, zv, PHP_GOST_SPEC)) == SUCCESS
+ && ctx->length < sizeof(ctx->buffer)) {
+ return SUCCESS;
+ } else {
+ return r != SUCCESS ? r : -2000;
+ }
+}
+
const php_hash_ops php_hash_gost_ops = {
+ "gost",
(php_hash_init_func_t) PHP_GOSTInit,
(php_hash_update_func_t) PHP_GOSTUpdate,
(php_hash_final_func_t) PHP_GOSTFinal,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_gost_unserialize,
+ PHP_GOST_SPEC,
32,
32,
sizeof(PHP_GOST_CTX),
@@ -319,10 +333,14 @@ const php_hash_ops php_hash_gost_ops = {
};
const php_hash_ops php_hash_gost_crypto_ops = {
+ "gost-crypto",
(php_hash_init_func_t) PHP_GOSTInitCrypto,
(php_hash_update_func_t) PHP_GOSTUpdate,
(php_hash_final_func_t) PHP_GOSTFinal,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_gost_unserialize,
+ PHP_GOST_SPEC,
32,
32,
sizeof(PHP_GOST_CTX),
diff --git a/ext/hash/hash_haval.c b/ext/hash/hash_haval.c
index af2991e667..84ff242bd9 100644
--- a/ext/hash/hash_haval.c
+++ b/ext/hash/hash_haval.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -137,8 +135,7 @@ static void Decode(uint32_t *output, const unsigned char *input, unsigned int le
#define ROTR(x,n) (((x) >> (n)) | ((x) << (32 - (n))))
-/* {{{ PHP_3HAVALTransform
- */
+/* {{{ PHP_3HAVALTransform */
static void PHP_3HAVALTransform(uint32_t state[8], const unsigned char block[128])
{
uint32_t E[8];
@@ -171,8 +168,7 @@ static void PHP_3HAVALTransform(uint32_t state[8], const unsigned char block[128
}
/* }}} */
-/* {{{ PHP_4HAVALTransform
- */
+/* {{{ PHP_4HAVALTransform */
static void PHP_4HAVALTransform(uint32_t state[8], const unsigned char block[128])
{
uint32_t E[8];
@@ -208,8 +204,7 @@ static void PHP_4HAVALTransform(uint32_t state[8], const unsigned char block[128
}
/* }}} */
-/* {{{ PHP_5HAVALTransform
- */
+/* {{{ PHP_5HAVALTransform */
static void PHP_5HAVALTransform(uint32_t state[8], const unsigned char block[128])
{
uint32_t E[8];
@@ -249,10 +244,14 @@ static void PHP_5HAVALTransform(uint32_t state[8], const unsigned char block[128
#define PHP_HASH_HAVAL_INIT(p,b) \
const php_hash_ops php_hash_##p##haval##b##_ops = { \
+ "haval" #b "," #p, \
(php_hash_init_func_t) PHP_##p##HAVAL##b##Init, \
(php_hash_update_func_t) PHP_HAVALUpdate, \
(php_hash_final_func_t) PHP_HAVAL##b##Final, \
- (php_hash_copy_func_t) php_hash_copy, \
+ php_hash_copy, \
+ php_hash_serialize, \
+ php_hash_unserialize, \
+ PHP_HAVAL_SPEC, \
((b) / 8), 128, sizeof(PHP_HAVAL_CTX), 1 }; \
PHP_HASH_API void PHP_##p##HAVAL##b##Init(PHP_HAVAL_CTX *context) \
{ int i; context->count[0] = context->count[1] = 0; \
@@ -278,9 +277,8 @@ PHP_HASH_HAVAL_INIT(5,192)
PHP_HASH_HAVAL_INIT(5,224)
PHP_HASH_HAVAL_INIT(5,256)
-/* {{{ PHP_HAVALUpdate
- */
-PHP_HASH_API void PHP_HAVALUpdate(PHP_HAVAL_CTX *context, const unsigned char *input, unsigned int inputLen)
+/* {{{ PHP_HAVALUpdate */
+PHP_HASH_API void PHP_HAVALUpdate(PHP_HAVAL_CTX *context, const unsigned char *input, size_t inputLen)
{
unsigned int i, index, partLen;
@@ -316,8 +314,7 @@ PHP_HASH_API void PHP_HAVALUpdate(PHP_HAVAL_CTX *context, const unsigned char *i
#define PHP_HASH_HAVAL_VERSION 0x01
-/* {{{ PHP_HAVAL128Final
- */
+/* {{{ PHP_HAVAL128Final */
PHP_HASH_API void PHP_HAVAL128Final(unsigned char *digest, PHP_HAVAL_CTX * context)
{
unsigned char bits[10];
@@ -370,8 +367,7 @@ PHP_HASH_API void PHP_HAVAL128Final(unsigned char *digest, PHP_HAVAL_CTX * conte
}
/* }}} */
-/* {{{ PHP_HAVAL160Final
- */
+/* {{{ PHP_HAVAL160Final */
PHP_HASH_API void PHP_HAVAL160Final(unsigned char *digest, PHP_HAVAL_CTX * context)
{
unsigned char bits[10];
@@ -424,8 +420,7 @@ PHP_HASH_API void PHP_HAVAL160Final(unsigned char *digest, PHP_HAVAL_CTX * conte
}
/* }}} */
-/* {{{ PHP_HAVAL192Final
- */
+/* {{{ PHP_HAVAL192Final */
PHP_HASH_API void PHP_HAVAL192Final(unsigned char *digest, PHP_HAVAL_CTX * context)
{
unsigned char bits[10];
@@ -464,8 +459,7 @@ PHP_HASH_API void PHP_HAVAL192Final(unsigned char *digest, PHP_HAVAL_CTX * conte
}
/* }}} */
-/* {{{ PHP_HAVAL224Final
- */
+/* {{{ PHP_HAVAL224Final */
PHP_HASH_API void PHP_HAVAL224Final(unsigned char *digest, PHP_HAVAL_CTX * context)
{
unsigned char bits[10];
@@ -505,8 +499,7 @@ PHP_HASH_API void PHP_HAVAL224Final(unsigned char *digest, PHP_HAVAL_CTX * conte
}
/* }}} */
-/* {{{ PHP_HAVAL256Final
- */
+/* {{{ PHP_HAVAL256Final */
PHP_HASH_API void PHP_HAVAL256Final(unsigned char *digest, PHP_HAVAL_CTX * context)
{
unsigned char bits[10];
diff --git a/ext/hash/hash_joaat.c b/ext/hash/hash_joaat.c
index fe04ed9cf2..5d5a2e53b9 100644
--- a/ext/hash/hash_joaat.c
+++ b/ext/hash/hash_joaat.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -24,10 +22,14 @@
#include "php_hash_joaat.h"
const php_hash_ops php_hash_joaat_ops = {
+ "joaat",
(php_hash_init_func_t) PHP_JOAATInit,
(php_hash_update_func_t) PHP_JOAATUpdate,
(php_hash_final_func_t) PHP_JOAATFinal,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_JOAAT_SPEC,
4,
4,
sizeof(PHP_JOAAT_CTX),
@@ -46,17 +48,22 @@ PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *i
PHP_HASH_API void PHP_JOAATFinal(unsigned char digest[4], PHP_JOAAT_CTX * context)
{
+ uint32_t hval = context->state;
+ hval += (hval << 3);
+ hval ^= (hval >> 11);
+ hval += (hval << 15);
+
#ifdef WORDS_BIGENDIAN
- memcpy(digest, &context->state, 4);
+ memcpy(digest, &hval, 4);
#else
int i = 0;
- unsigned char *c = (unsigned char *) &context->state;
+ unsigned char *c = (unsigned char *) &hval;
for (i = 0; i < 4; i++) {
digest[i] = c[3 - i];
}
#endif
- context->state = 0;
+ context->state = 0;
}
/*
@@ -81,9 +88,5 @@ joaat_buf(void *buf, size_t len, uint32_t hval)
hval ^= (hval >> 6);
}
- hval += (hval << 3);
- hval ^= (hval >> 11);
- hval += (hval << 15);
-
return hval;
}
diff --git a/ext/hash/hash_md.c b/ext/hash/hash_md.c
index 497c7d9d8d..94fafbbf79 100644
--- a/ext/hash/hash_md.c
+++ b/ext/hash/hash_md.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -20,10 +18,14 @@
#include "php_hash_md.h"
const php_hash_ops php_hash_md5_ops = {
+ "md5",
(php_hash_init_func_t) PHP_MD5Init,
(php_hash_update_func_t) PHP_MD5Update,
(php_hash_final_func_t) PHP_MD5Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_MD5_SPEC,
16,
64,
sizeof(PHP_MD5_CTX),
@@ -31,21 +33,31 @@ const php_hash_ops php_hash_md5_ops = {
};
const php_hash_ops php_hash_md4_ops = {
+ "md4",
(php_hash_init_func_t) PHP_MD4Init,
(php_hash_update_func_t) PHP_MD4Update,
(php_hash_final_func_t) PHP_MD4Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_MD4_SPEC,
16,
64,
sizeof(PHP_MD4_CTX),
1
};
+static int php_md2_unserialize(php_hashcontext_object *hash, zend_long magic, const zval *zv);
+
const php_hash_ops php_hash_md2_ops = {
+ "md2",
(php_hash_init_func_t) PHP_MD2Init,
(php_hash_update_func_t) PHP_MD2Update,
(php_hash_final_func_t) PHP_MD2Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_md2_unserialize,
+ PHP_MD2_SPEC,
16,
16,
sizeof(PHP_MD2_CTX),
@@ -92,355 +104,6 @@ static void Decode(uint32_t *output, const unsigned char *input, unsigned int le
}
/* }}} */
-#ifdef PHP_HASH_MD5_NOT_IN_CORE
-
-/* MD5 */
-
-PHP_HASH_API void make_digest(char *md5str, unsigned char *digest)
-{
- php_hash_bin2hex(md5str, digest, 16);
- md5str[32] = '\0';
-}
-
-/* {{{ proto string md5(string str, [ bool raw_output])
- Calculate the md5 hash of a string */
-PHP_NAMED_FUNCTION(php_if_md5)
-{
- char *arg;
- size_t arg_len;
- zend_bool raw_output = 0;
- PHP_MD5_CTX context;
- unsigned char digest[16];
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
- return;
- }
-
- PHP_MD5Init(&context);
- PHP_MD5Update(&context, arg, arg_len);
- PHP_MD5Final(digest, &context);
- if (raw_output) {
- RETURN_STRINGL(digest, 16);
- } else {
- RETVAL_NEW_STR(zend_string_alloc(32, 0));
- make_digest(Z_STRVAL_P(return_value), digest);
- }
-
-}
-/* }}} */
-
-/* {{{ proto string md5_file(string filename [, bool raw_output])
- Calculate the md5 hash of given filename */
-PHP_NAMED_FUNCTION(php_if_md5_file)
-{
- char *arg;
- size_t arg_len;
- zend_bool raw_output = 0;
- unsigned char buf[1024];
- unsigned char digest[16];
- PHP_MD5_CTX context;
- int n;
- php_stream *stream;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
- return;
- }
-
- stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS, NULL);
- if (!stream) {
- RETURN_FALSE;
- }
-
- PHP_MD5Init(&context);
-
- while ((n = php_stream_read(stream, buf, sizeof(buf))) > 0) {
- PHP_MD5Update(&context, buf, n);
- }
-
- PHP_MD5Final(digest, &context);
-
- php_stream_close(stream);
-
- if (n<0) {
- RETURN_FALSE;
- }
-
- if (raw_output) {
- RETURN_STRINGL(digest, 16);
- } else {
- RETVAL_NEW_STR(zend_string_alloc(32, 0));
- make_digest(Z_STRVAL_P(return_value), digest);
- }
-}
-/* }}} */
-
-/*
- * The remaining code is the reference MD5 code (md5c.c) from rfc1321
- */
-/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
- */
-
-/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
- rights reserved.
-
- License to copy and use this software is granted provided that it
- is identified as the "RSA Data Security, Inc. MD5 Message-Digest
- Algorithm" in all material mentioning or referencing this software
- or this function.
-
- License is also granted to make and use derivative works provided
- that such works are identified as "derived from the RSA Data
- Security, Inc. MD5 Message-Digest Algorithm" in all material
- mentioning or referencing the derived work.
-
- RSA Data Security, Inc. makes no representations concerning either
- the merchantability of this software or the suitability of this
- software for any particular purpose. It is provided "as is"
- without express or implied warranty of any kind.
-
- These notices must be retained in any copies of any part of this
- documentation and/or software.
- */
-
-/* Constants for MD5Transform routine.
- */
-
-#define S11 7
-#define S12 12
-#define S13 17
-#define S14 22
-#define S21 5
-#define S22 9
-#define S23 14
-#define S24 20
-#define S31 4
-#define S32 11
-#define S33 16
-#define S34 23
-#define S41 6
-#define S42 10
-#define S43 15
-#define S44 21
-
-static void MD5Transform(uint32_t[4], const unsigned char[64]);
-
-/* F, G, H and I are basic MD5 functions.
- */
-#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
-#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
-#define H(x, y, z) ((x) ^ (y) ^ (z))
-#define I(x, y, z) ((y) ^ ((x) | (~z)))
-
-/* ROTATE_LEFT rotates x left n bits.
- */
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
-
-/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
- Rotation is separate from addition to prevent recomputation.
- */
-#define FF(a, b, c, d, x, s, ac) { \
- (a) += F ((b), (c), (d)) + (x) + (uint32_t)(ac); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- }
-#define GG(a, b, c, d, x, s, ac) { \
- (a) += G ((b), (c), (d)) + (x) + (uint32_t)(ac); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- }
-#define HH(a, b, c, d, x, s, ac) { \
- (a) += H ((b), (c), (d)) + (x) + (uint32_t)(ac); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- }
-#define II(a, b, c, d, x, s, ac) { \
- (a) += I ((b), (c), (d)) + (x) + (uint32_t)(ac); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- }
-
-/* {{{ PHP_MD5Init
- * MD5 initialization. Begins an MD5 operation, writing a new context.
- */
-PHP_HASH_API void PHP_MD5Init(PHP_MD5_CTX * context)
-{
- context->count[0] = context->count[1] = 0;
- /* Load magic initialization constants.
- */
- context->state[0] = 0x67452301;
- context->state[1] = 0xefcdab89;
- context->state[2] = 0x98badcfe;
- context->state[3] = 0x10325476;
-}
-/* }}} */
-
-/* {{{ PHP_MD5Update
- MD5 block update operation. Continues an MD5 message-digest
- operation, processing another message block, and updating the
- context.
- */
-PHP_HASH_API void PHP_MD5Update(PHP_MD5_CTX * context, const unsigned char *input,
- size_t inputLen)
-{
- unsigned int i, index, partLen;
-
- /* Compute number of bytes mod 64 */
- index = (unsigned int) ((context->count[0] >> 3) & 0x3F);
-
- /* Update number of bits */
- if ((context->count[0] += ((uint32_t) inputLen << 3))
- < ((uint32_t) inputLen << 3))
- context->count[1]++;
- context->count[1] += ((uint32_t) inputLen >> 29);
-
- partLen = 64 - index;
-
- /* Transform as many times as possible.
- */
- if (inputLen >= partLen) {
- memcpy
- ((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen);
- MD5Transform(context->state, context->buffer);
-
- for (i = partLen; i + 63 < inputLen; i += 64)
- MD5Transform(context->state, &input[i]);
-
- index = 0;
- } else
- i = 0;
-
- /* Buffer remaining input */
- memcpy
- ((unsigned char*) & context->buffer[index], (unsigned char*) & input[i],
- inputLen - i);
-}
-/* }}} */
-
-/* {{{ PHP_MD5Final
- MD5 finalization. Ends an MD5 message-digest operation, writing the
- the message digest and zeroizing the context.
- */
-PHP_HASH_API void PHP_MD5Final(unsigned char digest[16], PHP_MD5_CTX * context)
-{
- unsigned char bits[8];
- unsigned int index, padLen;
-
- /* Save number of bits */
- Encode(bits, context->count, 8);
-
- /* Pad out to 56 mod 64.
- */
- index = (unsigned int) ((context->count[0] >> 3) & 0x3f);
- padLen = (index < 56) ? (56 - index) : (120 - index);
- PHP_MD5Update(context, PADDING, padLen);
-
- /* Append length (before padding) */
- PHP_MD5Update(context, bits, 8);
-
- /* Store state in digest */
- Encode(digest, context->state, 16);
-
- /* Zeroize sensitive information.
- */
- ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
-}
-/* }}} */
-
-/* {{{ MD5Transform
- * MD5 basic transformation. Transforms state based on block.
- */
-static void MD5Transform(state, block)
-uint32_t state[4];
-const unsigned char block[64];
-{
- uint32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
-
- Decode(x, block, 64);
-
- /* Round 1 */
- FF(a, b, c, d, x[0], S11, 0xd76aa478); /* 1 */
- FF(d, a, b, c, x[1], S12, 0xe8c7b756); /* 2 */
- FF(c, d, a, b, x[2], S13, 0x242070db); /* 3 */
- FF(b, c, d, a, x[3], S14, 0xc1bdceee); /* 4 */
- FF(a, b, c, d, x[4], S11, 0xf57c0faf); /* 5 */
- FF(d, a, b, c, x[5], S12, 0x4787c62a); /* 6 */
- FF(c, d, a, b, x[6], S13, 0xa8304613); /* 7 */
- FF(b, c, d, a, x[7], S14, 0xfd469501); /* 8 */
- FF(a, b, c, d, x[8], S11, 0x698098d8); /* 9 */
- FF(d, a, b, c, x[9], S12, 0x8b44f7af); /* 10 */
- FF(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
- FF(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
- FF(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
- FF(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
- FF(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
- FF(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
-
- /* Round 2 */
- GG(a, b, c, d, x[1], S21, 0xf61e2562); /* 17 */
- GG(d, a, b, c, x[6], S22, 0xc040b340); /* 18 */
- GG(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
- GG(b, c, d, a, x[0], S24, 0xe9b6c7aa); /* 20 */
- GG(a, b, c, d, x[5], S21, 0xd62f105d); /* 21 */
- GG(d, a, b, c, x[10], S22, 0x2441453); /* 22 */
- GG(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
- GG(b, c, d, a, x[4], S24, 0xe7d3fbc8); /* 24 */
- GG(a, b, c, d, x[9], S21, 0x21e1cde6); /* 25 */
- GG(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
- GG(c, d, a, b, x[3], S23, 0xf4d50d87); /* 27 */
- GG(b, c, d, a, x[8], S24, 0x455a14ed); /* 28 */
- GG(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
- GG(d, a, b, c, x[2], S22, 0xfcefa3f8); /* 30 */
- GG(c, d, a, b, x[7], S23, 0x676f02d9); /* 31 */
- GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
-
- /* Round 3 */
- HH(a, b, c, d, x[5], S31, 0xfffa3942); /* 33 */
- HH(d, a, b, c, x[8], S32, 0x8771f681); /* 34 */
- HH(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
- HH(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
- HH(a, b, c, d, x[1], S31, 0xa4beea44); /* 37 */
- HH(d, a, b, c, x[4], S32, 0x4bdecfa9); /* 38 */
- HH(c, d, a, b, x[7], S33, 0xf6bb4b60); /* 39 */
- HH(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
- HH(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
- HH(d, a, b, c, x[0], S32, 0xeaa127fa); /* 42 */
- HH(c, d, a, b, x[3], S33, 0xd4ef3085); /* 43 */
- HH(b, c, d, a, x[6], S34, 0x4881d05); /* 44 */
- HH(a, b, c, d, x[9], S31, 0xd9d4d039); /* 45 */
- HH(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
- HH(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
- HH(b, c, d, a, x[2], S34, 0xc4ac5665); /* 48 */
-
- /* Round 4 */
- II(a, b, c, d, x[0], S41, 0xf4292244); /* 49 */
- II(d, a, b, c, x[7], S42, 0x432aff97); /* 50 */
- II(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
- II(b, c, d, a, x[5], S44, 0xfc93a039); /* 52 */
- II(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
- II(d, a, b, c, x[3], S42, 0x8f0ccc92); /* 54 */
- II(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
- II(b, c, d, a, x[1], S44, 0x85845dd1); /* 56 */
- II(a, b, c, d, x[8], S41, 0x6fa87e4f); /* 57 */
- II(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
- II(c, d, a, b, x[6], S43, 0xa3014314); /* 59 */
- II(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
- II(a, b, c, d, x[4], S41, 0xf7537e82); /* 61 */
- II(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
- II(c, d, a, b, x[2], S43, 0x2ad7d2bb); /* 63 */
- II(b, c, d, a, x[9], S44, 0xeb86d391); /* 64 */
-
- state[0] += a;
- state[1] += b;
- state[2] += c;
- state[3] += d;
-
- /* Zeroize sensitive information. */
- ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
-}
-/* }}} */
-
-#endif /* PHP_HASH_MD5_NOT_IN_CORE */
-
/* MD4 */
#define MD4_F(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
@@ -691,3 +354,16 @@ PHP_HASH_API void PHP_MD2Final(unsigned char output[16], PHP_MD2_CTX *context)
memcpy(output, context->state, 16);
}
+
+static int php_md2_unserialize(php_hashcontext_object *hash, zend_long magic, const zval *zv)
+{
+ PHP_MD2_CTX *ctx = (PHP_MD2_CTX *) hash->context;
+ int r = FAILURE;
+ if (magic == PHP_HASH_SERIALIZE_MAGIC_SPEC
+ && (r = php_hash_unserialize_spec(hash, zv, PHP_MD2_SPEC)) == SUCCESS
+ && (unsigned char) ctx->in_buffer < sizeof(ctx->buffer)) {
+ return SUCCESS;
+ } else {
+ return r != SUCCESS ? r : -2000;
+ }
+}
diff --git a/ext/hash/hash_ripemd.c b/ext/hash/hash_ripemd.c
index 083e6a9955..db1d1dc02b 100644
--- a/ext/hash/hash_ripemd.c
+++ b/ext/hash/hash_ripemd.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -24,10 +22,14 @@
#include "php_hash_ripemd.h"
const php_hash_ops php_hash_ripemd128_ops = {
+ "ripemd128",
(php_hash_init_func_t) PHP_RIPEMD128Init,
(php_hash_update_func_t) PHP_RIPEMD128Update,
(php_hash_final_func_t) PHP_RIPEMD128Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_RIPEMD128_SPEC,
16,
64,
sizeof(PHP_RIPEMD128_CTX),
@@ -35,10 +37,14 @@ const php_hash_ops php_hash_ripemd128_ops = {
};
const php_hash_ops php_hash_ripemd160_ops = {
+ "ripemd160",
(php_hash_init_func_t) PHP_RIPEMD160Init,
(php_hash_update_func_t) PHP_RIPEMD160Update,
(php_hash_final_func_t) PHP_RIPEMD160Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_RIPEMD160_SPEC,
20,
64,
sizeof(PHP_RIPEMD160_CTX),
@@ -46,10 +52,14 @@ const php_hash_ops php_hash_ripemd160_ops = {
};
const php_hash_ops php_hash_ripemd256_ops = {
+ "ripemd256",
(php_hash_init_func_t) PHP_RIPEMD256Init,
(php_hash_update_func_t) PHP_RIPEMD256Update,
(php_hash_final_func_t) PHP_RIPEMD256Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_RIPEMD256_SPEC,
32,
64,
sizeof(PHP_RIPEMD256_CTX),
@@ -57,10 +67,14 @@ const php_hash_ops php_hash_ripemd256_ops = {
};
const php_hash_ops php_hash_ripemd320_ops = {
+ "ripemd320",
(php_hash_init_func_t) PHP_RIPEMD320Init,
(php_hash_update_func_t) PHP_RIPEMD320Update,
(php_hash_final_func_t) PHP_RIPEMD320Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_RIPEMD320_SPEC,
40,
64,
sizeof(PHP_RIPEMD320_CTX),
diff --git a/ext/hash/hash_sha.c b/ext/hash/hash_sha.c
index 4e0e1c1797..4ea5b768d7 100644
--- a/ext/hash/hash_sha.c
+++ b/ext/hash/hash_sha.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -65,350 +63,31 @@ static void SHADecode32(uint32_t *output, const unsigned char *input, unsigned i
/* }}} */
const php_hash_ops php_hash_sha1_ops = {
+ "sha1",
(php_hash_init_func_t) PHP_SHA1Init,
(php_hash_update_func_t) PHP_SHA1Update,
(php_hash_final_func_t) PHP_SHA1Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_SHA1_SPEC,
20,
64,
sizeof(PHP_SHA1_CTX),
1
};
-#ifdef PHP_HASH_SHA1_NOT_IN_CORE
-
-PHP_HASH_API void make_sha1_digest(char *sha1str, unsigned char *digest)
-{
- php_hash_bin2hex(sha1str, digest, 20);
- sha1str[40] = '\0';
-}
-
-/* {{{ proto string sha1(string str [, bool raw_output])
- Calculate the sha1 hash of a string */
-PHP_FUNCTION(sha1)
-{
- char *arg;
- size_t arg_len;
- zend_bool raw_output = 0;
- PHP_SHA1_CTX context;
- unsigned char digest[20];
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
- return;
- }
-
- PHP_SHA1Init(&context);
- PHP_SHA1Update(&context, arg, arg_len);
- PHP_SHA1Final(digest, &context);
- if (raw_output) {
- RETURN_STRINGL(digest, 20);
- } else {
- RETVAL_NEW_STR(zend_string_alloc(40, 0));
- make_sha1_digest(Z_STRVAL_P(return_value), digest);
- }
-
-}
-
-/* }}} */
-
-/* {{{ proto string sha1_file(string filename [, bool raw_output])
- Calculate the sha1 hash of given filename */
-PHP_FUNCTION(sha1_file)
-{
- char *arg;
- size_t arg_len;
- zend_bool raw_output = 0;
- unsigned char buf[1024];
- unsigned char digest[20];
- PHP_SHA1_CTX context;
- int n;
- php_stream *stream;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
- return;
- }
-
- stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS, NULL);
- if (!stream) {
- RETURN_FALSE;
- }
-
- PHP_SHA1Init(&context);
-
- while ((n = php_stream_read(stream, buf, sizeof(buf))) > 0) {
- PHP_SHA1Update(&context, buf, n);
- }
-
- PHP_SHA1Final(digest, &context);
-
- php_stream_close(stream);
-
- if (n<0) {
- RETURN_FALSE;
- }
-
- if (raw_output) {
- RETURN_STRINGL(digest, 20);
- } else {
- RETVAL_NEW_STR(zend_string_alloc(40, 0));
- make_sha1_digest(Z_STRVAL_P(return_value), digest);
- }
-}
-/* }}} */
-
-/* F, G, H and I are basic SHA1 functions.
- */
-#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
-#define G(x, y, z) ((x) ^ (y) ^ (z))
-#define H(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
-#define I(x, y, z) ((x) ^ (y) ^ (z))
-
-/* ROTATE_LEFT rotates x left n bits.
- */
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
-
-/* W[i]
- */
-#define W(i) ( tmp=x[(i-3)&15]^x[(i-8)&15]^x[(i-14)&15]^x[i&15], \
- (x[i&15]=ROTATE_LEFT(tmp, 1)) )
-
-/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
- */
-#define FF(a, b, c, d, e, w) { \
- (e) += F ((b), (c), (d)) + (w) + (uint32_t)(0x5A827999); \
- (e) += ROTATE_LEFT ((a), 5); \
- (b) = ROTATE_LEFT((b), 30); \
- }
-#define GG(a, b, c, d, e, w) { \
- (e) += G ((b), (c), (d)) + (w) + (uint32_t)(0x6ED9EBA1); \
- (e) += ROTATE_LEFT ((a), 5); \
- (b) = ROTATE_LEFT((b), 30); \
- }
-#define HH(a, b, c, d, e, w) { \
- (e) += H ((b), (c), (d)) + (w) + (uint32_t)(0x8F1BBCDC); \
- (e) += ROTATE_LEFT ((a), 5); \
- (b) = ROTATE_LEFT((b), 30); \
- }
-#define II(a, b, c, d, e, w) { \
- (e) += I ((b), (c), (d)) + (w) + (uint32_t)(0xCA62C1D6); \
- (e) += ROTATE_LEFT ((a), 5); \
- (b) = ROTATE_LEFT((b), 30); \
- }
-
-
-/* {{{ PHP_SHA1Init
- * SHA1 initialization. Begins an SHA1 operation, writing a new context.
- */
-PHP_HASH_API void PHP_SHA1Init(PHP_SHA1_CTX * context)
-{
- context->count[0] = context->count[1] = 0;
- /* Load magic initialization constants.
- */
- context->state[0] = 0x67452301;
- context->state[1] = 0xefcdab89;
- context->state[2] = 0x98badcfe;
- context->state[3] = 0x10325476;
- context->state[4] = 0xc3d2e1f0;
-}
-/* }}} */
-
-/* {{{ SHA1Transform
- * SHA1 basic transformation. Transforms state based on block.
- */
-static void SHA1Transform(uint32_t state[5], const unsigned char block[64])
-{
- uint32_t a = state[0], b = state[1], c = state[2];
- uint32_t d = state[3], e = state[4], x[16], tmp;
-
- SHADecode32(x, block, 64);
-
- /* Round 1 */
- FF(a, b, c, d, e, x[0]); /* 1 */
- FF(e, a, b, c, d, x[1]); /* 2 */
- FF(d, e, a, b, c, x[2]); /* 3 */
- FF(c, d, e, a, b, x[3]); /* 4 */
- FF(b, c, d, e, a, x[4]); /* 5 */
- FF(a, b, c, d, e, x[5]); /* 6 */
- FF(e, a, b, c, d, x[6]); /* 7 */
- FF(d, e, a, b, c, x[7]); /* 8 */
- FF(c, d, e, a, b, x[8]); /* 9 */
- FF(b, c, d, e, a, x[9]); /* 10 */
- FF(a, b, c, d, e, x[10]); /* 11 */
- FF(e, a, b, c, d, x[11]); /* 12 */
- FF(d, e, a, b, c, x[12]); /* 13 */
- FF(c, d, e, a, b, x[13]); /* 14 */
- FF(b, c, d, e, a, x[14]); /* 15 */
- FF(a, b, c, d, e, x[15]); /* 16 */
- FF(e, a, b, c, d, W(16)); /* 17 */
- FF(d, e, a, b, c, W(17)); /* 18 */
- FF(c, d, e, a, b, W(18)); /* 19 */
- FF(b, c, d, e, a, W(19)); /* 20 */
-
- /* Round 2 */
- GG(a, b, c, d, e, W(20)); /* 21 */
- GG(e, a, b, c, d, W(21)); /* 22 */
- GG(d, e, a, b, c, W(22)); /* 23 */
- GG(c, d, e, a, b, W(23)); /* 24 */
- GG(b, c, d, e, a, W(24)); /* 25 */
- GG(a, b, c, d, e, W(25)); /* 26 */
- GG(e, a, b, c, d, W(26)); /* 27 */
- GG(d, e, a, b, c, W(27)); /* 28 */
- GG(c, d, e, a, b, W(28)); /* 29 */
- GG(b, c, d, e, a, W(29)); /* 30 */
- GG(a, b, c, d, e, W(30)); /* 31 */
- GG(e, a, b, c, d, W(31)); /* 32 */
- GG(d, e, a, b, c, W(32)); /* 33 */
- GG(c, d, e, a, b, W(33)); /* 34 */
- GG(b, c, d, e, a, W(34)); /* 35 */
- GG(a, b, c, d, e, W(35)); /* 36 */
- GG(e, a, b, c, d, W(36)); /* 37 */
- GG(d, e, a, b, c, W(37)); /* 38 */
- GG(c, d, e, a, b, W(38)); /* 39 */
- GG(b, c, d, e, a, W(39)); /* 40 */
-
- /* Round 3 */
- HH(a, b, c, d, e, W(40)); /* 41 */
- HH(e, a, b, c, d, W(41)); /* 42 */
- HH(d, e, a, b, c, W(42)); /* 43 */
- HH(c, d, e, a, b, W(43)); /* 44 */
- HH(b, c, d, e, a, W(44)); /* 45 */
- HH(a, b, c, d, e, W(45)); /* 46 */
- HH(e, a, b, c, d, W(46)); /* 47 */
- HH(d, e, a, b, c, W(47)); /* 48 */
- HH(c, d, e, a, b, W(48)); /* 49 */
- HH(b, c, d, e, a, W(49)); /* 50 */
- HH(a, b, c, d, e, W(50)); /* 51 */
- HH(e, a, b, c, d, W(51)); /* 52 */
- HH(d, e, a, b, c, W(52)); /* 53 */
- HH(c, d, e, a, b, W(53)); /* 54 */
- HH(b, c, d, e, a, W(54)); /* 55 */
- HH(a, b, c, d, e, W(55)); /* 56 */
- HH(e, a, b, c, d, W(56)); /* 57 */
- HH(d, e, a, b, c, W(57)); /* 58 */
- HH(c, d, e, a, b, W(58)); /* 59 */
- HH(b, c, d, e, a, W(59)); /* 60 */
-
- /* Round 4 */
- II(a, b, c, d, e, W(60)); /* 61 */
- II(e, a, b, c, d, W(61)); /* 62 */
- II(d, e, a, b, c, W(62)); /* 63 */
- II(c, d, e, a, b, W(63)); /* 64 */
- II(b, c, d, e, a, W(64)); /* 65 */
- II(a, b, c, d, e, W(65)); /* 66 */
- II(e, a, b, c, d, W(66)); /* 67 */
- II(d, e, a, b, c, W(67)); /* 68 */
- II(c, d, e, a, b, W(68)); /* 69 */
- II(b, c, d, e, a, W(69)); /* 70 */
- II(a, b, c, d, e, W(70)); /* 71 */
- II(e, a, b, c, d, W(71)); /* 72 */
- II(d, e, a, b, c, W(72)); /* 73 */
- II(c, d, e, a, b, W(73)); /* 74 */
- II(b, c, d, e, a, W(74)); /* 75 */
- II(a, b, c, d, e, W(75)); /* 76 */
- II(e, a, b, c, d, W(76)); /* 77 */
- II(d, e, a, b, c, W(77)); /* 78 */
- II(c, d, e, a, b, W(78)); /* 79 */
- II(b, c, d, e, a, W(79)); /* 80 */
-
- state[0] += a;
- state[1] += b;
- state[2] += c;
- state[3] += d;
- state[4] += e;
-
- /* Zeroize sensitive information. */
- ZEND_SECURE_ZERO((unsigned char*) x, sizeof(x));
-}
-/* }}} */
-
-/* {{{ PHP_SHA1Update
- SHA1 block update operation. Continues an SHA1 message-digest
- operation, processing another message block, and updating the
- context.
- */
-PHP_HASH_API void PHP_SHA1Update(PHP_SHA1_CTX * context, const unsigned char *input,
- size_t inputLen)
-{
- unsigned int i, index, partLen;
-
- /* Compute number of bytes mod 64 */
- index = (unsigned int) ((context->count[0] >> 3) & 0x3F);
-
- /* Update number of bits */
- if ((context->count[0] += ((uint32_t) inputLen << 3))
- < ((uint32_t) inputLen << 3))
- context->count[1]++;
- context->count[1] += ((uint32_t) inputLen >> 29);
-
- partLen = 64 - index;
-
- /* Transform as many times as possible.
- */
- if (inputLen >= partLen) {
- memcpy
- ((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen);
- SHA1Transform(context->state, context->buffer);
-
- for (i = partLen; i + 63 < inputLen; i += 64)
- SHA1Transform(context->state, &input[i]);
-
- index = 0;
- } else
- i = 0;
-
- /* Buffer remaining input */
- memcpy
- ((unsigned char*) & context->buffer[index], (unsigned char*) & input[i],
- inputLen - i);
-}
-/* }}} */
-
-/* {{{ PHP_SHA1Final
- SHA1 finalization. Ends an SHA1 message-digest operation, writing the
- the message digest and zeroizing the context.
- */
-PHP_HASH_API void PHP_SHA1Final(unsigned char digest[20], PHP_SHA1_CTX * context)
-{
- unsigned char bits[8];
- unsigned int index, padLen;
-
- /* Save number of bits */
- bits[7] = context->count[0] & 0xFF;
- bits[6] = (context->count[0] >> 8) & 0xFF;
- bits[5] = (context->count[0] >> 16) & 0xFF;
- bits[4] = (context->count[0] >> 24) & 0xFF;
- bits[3] = context->count[1] & 0xFF;
- bits[2] = (context->count[1] >> 8) & 0xFF;
- bits[1] = (context->count[1] >> 16) & 0xFF;
- bits[0] = (context->count[1] >> 24) & 0xFF;
-
- /* Pad out to 56 mod 64.
- */
- index = (unsigned int) ((context->count[0] >> 3) & 0x3f);
- padLen = (index < 56) ? (56 - index) : (120 - index);
- PHP_SHA1Update(context, PADDING, padLen);
-
- /* Append length (before padding) */
- PHP_SHA1Update(context, bits, 8);
-
- /* Store state in digest */
- SHAEncode32(digest, context->state, 20);
-
- /* Zeroize sensitive information.
- */
- ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context));
-}
-/* }}} */
-
-#endif /* PHP_HASH_SHA1_NOT_IN_CORE */
-
/* sha224/sha256 */
const php_hash_ops php_hash_sha256_ops = {
+ "sha256",
(php_hash_init_func_t) PHP_SHA256Init,
(php_hash_update_func_t) PHP_SHA256Update,
(php_hash_final_func_t) PHP_SHA256Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_SHA256_SPEC,
32,
64,
sizeof(PHP_SHA256_CTX),
@@ -416,10 +95,14 @@ const php_hash_ops php_hash_sha256_ops = {
};
const php_hash_ops php_hash_sha224_ops = {
+ "sha224",
(php_hash_init_func_t) PHP_SHA224Init,
(php_hash_update_func_t) PHP_SHA224Update,
(php_hash_final_func_t) PHP_SHA224Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_SHA224_SPEC,
28,
64,
sizeof(PHP_SHA224_CTX),
@@ -907,10 +590,14 @@ PHP_HASH_API void PHP_SHA384Final(unsigned char digest[48], PHP_SHA384_CTX * con
/* }}} */
const php_hash_ops php_hash_sha384_ops = {
+ "sha384",
(php_hash_init_func_t) PHP_SHA384Init,
(php_hash_update_func_t) PHP_SHA384Update,
(php_hash_final_func_t) PHP_SHA384Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_SHA384_SPEC,
48,
128,
sizeof(PHP_SHA384_CTX),
@@ -1080,10 +767,14 @@ PHP_HASH_API void PHP_SHA512_224Final(unsigned char digest[28], PHP_SHA512_CTX *
/* }}} */
const php_hash_ops php_hash_sha512_ops = {
+ "sha512",
(php_hash_init_func_t) PHP_SHA512Init,
(php_hash_update_func_t) PHP_SHA512Update,
(php_hash_final_func_t) PHP_SHA512Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_SHA512_SPEC,
64,
128,
sizeof(PHP_SHA512_CTX),
@@ -1091,10 +782,14 @@ const php_hash_ops php_hash_sha512_ops = {
};
const php_hash_ops php_hash_sha512_256_ops = {
+ "sha512/256",
(php_hash_init_func_t) PHP_SHA512_256Init,
(php_hash_update_func_t) PHP_SHA512_256Update,
(php_hash_final_func_t) PHP_SHA512_256Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_SHA512_SPEC,
32,
128,
sizeof(PHP_SHA512_CTX),
@@ -1102,10 +797,14 @@ const php_hash_ops php_hash_sha512_256_ops = {
};
const php_hash_ops php_hash_sha512_224_ops = {
+ "sha512/224",
(php_hash_init_func_t) PHP_SHA512_224Init,
(php_hash_update_func_t) PHP_SHA512_224Update,
(php_hash_final_func_t) PHP_SHA512_224Final,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_hash_unserialize,
+ PHP_SHA512_SPEC,
28,
128,
sizeof(PHP_SHA512_CTX),
diff --git a/ext/hash/hash_sha3.c b/ext/hash/hash_sha3.c
index 77cec630d8..52bd495f9d 100644
--- a/ext/hash/hash_sha3.c
+++ b/ext/hash/hash_sha3.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -51,14 +49,14 @@ static inline uint64_t load64(const unsigned char* x) {
return ret;
}
static inline void store64(unsigned char* x, uint64_t val) {
- char i;
+ size_t i;
for (i = 0; i < 8; ++i) {
x[i] = val & 0xFF;
val >>= 8;
}
}
static inline void xor64(unsigned char* x, uint64_t val) {
- char i;
+ size_t i;
for (i = 0; i < 8; ++i) {
x[i] ^= val & 0xFF;
val >>= 8;
@@ -203,6 +201,22 @@ static void PHP_SHA3_Final(unsigned char* digest,
ZEND_SECURE_ZERO(ctx, sizeof(PHP_SHA3_CTX));
}
+static int php_sha3_unserialize(php_hashcontext_object *hash,
+ zend_long magic,
+ const zval *zv,
+ size_t block_size)
+{
+ PHP_SHA3_CTX *ctx = (PHP_SHA3_CTX *) hash->context;
+ int r = FAILURE;
+ if (magic == PHP_HASH_SERIALIZE_MAGIC_SPEC
+ && (r = php_hash_unserialize_spec(hash, zv, PHP_SHA3_SPEC)) == SUCCESS
+ && ctx->pos < block_size) {
+ return SUCCESS;
+ } else {
+ return r != SUCCESS ? r : -2000;
+ }
+}
+
// ==========================================================================
#define DECLARE_SHA3_OPS(bits) \
@@ -221,11 +235,20 @@ void PHP_SHA3##bits##Final(unsigned char* digest, \
(1600 - (2 * bits)) >> 3, \
bits >> 3); \
} \
+static int php_sha3##bits##_unserialize(php_hashcontext_object *hash, \
+ zend_long magic, \
+ const zval *zv) { \
+ return php_sha3_unserialize(hash, magic, zv, (1600 - (2 * bits)) >> 3); \
+} \
const php_hash_ops php_hash_sha3_##bits##_ops = { \
+ "sha3-" #bits, \
(php_hash_init_func_t) PHP_SHA3##bits##Init, \
(php_hash_update_func_t) PHP_SHA3##bits##Update, \
(php_hash_final_func_t) PHP_SHA3##bits##Final, \
php_hash_copy, \
+ php_hash_serialize, \
+ php_sha3##bits##_unserialize, \
+ PHP_SHA3_SPEC, \
bits >> 3, \
(1600 - (2 * bits)) >> 3, \
sizeof(PHP_SHA3_##bits##_CTX), \
@@ -239,41 +262,84 @@ const php_hash_ops php_hash_sha3_##bits##_ops = { \
#define SUCCESS SHA3_SUCCESS /* Avoid conflict between KeccacHash.h and zend_types.h */
#include "KeccakHash.h"
+/* KECCAK SERIALIZATION
+
+ Keccak_HashInstance consists of:
+ KeccakWidth1600_SpongeInstance {
+ unsigned char state[200];
+ unsigned int rate; -- fixed for digest size
+ unsigned int byteIOIndex; -- in range [0, rate/8)
+ int squeezing; -- 0 normally, 1 only during finalize
+ } sponge;
+ unsigned int fixedOutputLength; -- fixed for digest size
+ unsigned char delimitedSuffix; -- fixed for digest size
+
+ NB If the external sha3/ library is updated, the serialization code
+ may need to be updated.
+
+ The simpler SHA3 code's serialization states are not interchangeable with
+ Keccak. Furthermore, the Keccak sponge state is sensitive to architecture
+ -- 32-bit and 64-bit implementations produce different states. It does not
+ appear that the state is sensitive to endianness. */
+
+#if Keccak_HashInstance_ImplType == 64
+/* corresponds to sha3/generic64lc */
+# define PHP_HASH_SERIALIZE_MAGIC_KECCAK 100
+#elif Keccak_HashInstance_ImplType == 32
+/* corresponds to sha3/generic32lc */
+# define PHP_HASH_SERIALIZE_MAGIC_KECCAK 101
+#else
+# error "Unknown Keccak_HashInstance_ImplType"
+#endif
+#define PHP_KECCAK_SPEC "b200IiIIB"
-// ==========================================================================
+static int php_keccak_serialize(const php_hashcontext_object *hash, zend_long *magic, zval *zv)
+{
+ *magic = PHP_HASH_SERIALIZE_MAGIC_KECCAK;
+ return php_hash_serialize_spec(hash, zv, PHP_KECCAK_SPEC);
+}
-static int hash_sha3_copy(const void *ops, void *orig_context, void *dest_context)
+static int php_keccak_unserialize(php_hashcontext_object *hash, zend_long magic, const zval *zv)
{
- PHP_SHA3_CTX* orig = (PHP_SHA3_CTX*)orig_context;
- PHP_SHA3_CTX* dest = (PHP_SHA3_CTX*)dest_context;
- memcpy(dest->hashinstance, orig->hashinstance, sizeof(Keccak_HashInstance));
- return SUCCESS;
+ Keccak_HashInstance *ctx = (Keccak_HashInstance *) hash->context;
+ int r = FAILURE;
+ if (magic == PHP_HASH_SERIALIZE_MAGIC_KECCAK
+ && (r = php_hash_unserialize_spec(hash, zv, PHP_KECCAK_SPEC)) == SUCCESS
+ && ctx->sponge.byteIOIndex < ctx->sponge.rate / 8) {
+ return SUCCESS;
+ } else {
+ return r != SUCCESS ? r : -2000;
+ }
}
+// ==========================================================================
+
#define DECLARE_SHA3_OPS(bits) \
void PHP_SHA3##bits##Init(PHP_SHA3_##bits##_CTX* ctx) { \
- ctx->hashinstance = emalloc(sizeof(Keccak_HashInstance)); \
- Keccak_HashInitialize_SHA3_##bits((Keccak_HashInstance *)ctx->hashinstance); \
+ ZEND_ASSERT(sizeof(Keccak_HashInstance) <= sizeof(PHP_SHA3_##bits##_CTX)); \
+ Keccak_HashInitialize_SHA3_##bits((Keccak_HashInstance *)ctx); \
} \
void PHP_SHA3##bits##Update(PHP_SHA3_##bits##_CTX* ctx, \
const unsigned char* input, \
size_t inputLen) { \
- Keccak_HashUpdate((Keccak_HashInstance *)ctx->hashinstance, input, inputLen * 8); \
+ Keccak_HashUpdate((Keccak_HashInstance *)ctx, input, inputLen * 8); \
} \
void PHP_SHA3##bits##Final(unsigned char* digest, \
PHP_SHA3_##bits##_CTX* ctx) { \
- Keccak_HashFinal((Keccak_HashInstance *)ctx->hashinstance, digest); \
- efree(ctx->hashinstance); \
- ctx->hashinstance = NULL; \
+ Keccak_HashFinal((Keccak_HashInstance *)ctx, digest); \
} \
const php_hash_ops php_hash_sha3_##bits##_ops = { \
+ "sha3-" #bits, \
(php_hash_init_func_t) PHP_SHA3##bits##Init, \
(php_hash_update_func_t) PHP_SHA3##bits##Update, \
(php_hash_final_func_t) PHP_SHA3##bits##Final, \
- hash_sha3_copy, \
+ php_hash_copy, \
+ php_keccak_serialize, \
+ php_keccak_unserialize, \
+ PHP_KECCAK_SPEC, \
bits >> 3, \
(1600 - (2 * bits)) >> 3, \
- sizeof(PHP_SHA3_##bits##_CTX), \
+ sizeof(PHP_SHA3_CTX), \
1 \
}
diff --git a/ext/hash/hash_snefru.c b/ext/hash/hash_snefru.c
index 867556acc5..292bfef2cb 100644
--- a/ext/hash/hash_snefru.c
+++ b/ext/hash/hash_snefru.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -191,11 +189,28 @@ PHP_HASH_API void PHP_SNEFRUFinal(unsigned char digest[32], PHP_SNEFRU_CTX *cont
ZEND_SECURE_ZERO(context, sizeof(*context));
}
+static int php_snefru_unserialize(php_hashcontext_object *hash, zend_long magic, const zval *zv)
+{
+ PHP_SNEFRU_CTX *ctx = (PHP_SNEFRU_CTX *) hash->context;
+ int r = FAILURE;
+ if (magic == PHP_HASH_SERIALIZE_MAGIC_SPEC
+ && (r = php_hash_unserialize_spec(hash, zv, PHP_SNEFRU_SPEC)) == SUCCESS
+ && ctx->length < sizeof(ctx->buffer)) {
+ return SUCCESS;
+ } else {
+ return r != SUCCESS ? r : -2000;
+ }
+}
+
const php_hash_ops php_hash_snefru_ops = {
+ "snefru",
(php_hash_init_func_t) PHP_SNEFRUInit,
(php_hash_update_func_t) PHP_SNEFRUUpdate,
(php_hash_final_func_t) PHP_SNEFRUFinal,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_snefru_unserialize,
+ PHP_SNEFRU_SPEC,
32,
32,
sizeof(PHP_SNEFRU_CTX),
diff --git a/ext/hash/hash_tiger.c b/ext/hash/hash_tiger.c
index 4d126f0d8f..8e0f365dc4 100644
--- a/ext/hash/hash_tiger.c
+++ b/ext/hash/hash_tiger.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -241,12 +239,29 @@ PHP_HASH_API void PHP_TIGER192Final(unsigned char digest[24], PHP_TIGER_CTX *con
ZEND_SECURE_ZERO(context, sizeof(*context));
}
+static int php_tiger_unserialize(php_hashcontext_object *hash, zend_long magic, const zval *zv)
+{
+ PHP_TIGER_CTX *ctx = (PHP_TIGER_CTX *) hash->context;
+ int r = FAILURE;
+ if (magic == PHP_HASH_SERIALIZE_MAGIC_SPEC
+ && (r = php_hash_unserialize_spec(hash, zv, PHP_TIGER_SPEC)) == SUCCESS
+ && ctx->length < sizeof(ctx->buffer)) {
+ return SUCCESS;
+ } else {
+ return r != SUCCESS ? r : -2000;
+ }
+}
+
#define PHP_HASH_TIGER_OPS(p, b) \
const php_hash_ops php_hash_##p##tiger##b##_ops = { \
+ "tiger" #b "," #p, \
(php_hash_init_func_t) PHP_##p##TIGERInit, \
(php_hash_update_func_t) PHP_TIGERUpdate, \
(php_hash_final_func_t) PHP_TIGER##b##Final, \
- (php_hash_copy_func_t) php_hash_copy, \
+ php_hash_copy, \
+ php_hash_serialize, \
+ php_tiger_unserialize, \
+ PHP_TIGER_SPEC, \
b/8, \
64, \
sizeof(PHP_TIGER_CTX), \
diff --git a/ext/hash/hash_whirlpool.c b/ext/hash/hash_whirlpool.c
index 3bd9bd13da..8d5cbb7737 100644
--- a/ext/hash/hash_whirlpool.c
+++ b/ext/hash/hash_whirlpool.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -431,11 +429,31 @@ PHP_HASH_API void PHP_WHIRLPOOLFinal(unsigned char digest[64], PHP_WHIRLPOOL_CTX
ZEND_SECURE_ZERO(context, sizeof(*context));
}
+static int php_whirlpool_unserialize(php_hashcontext_object *hash, zend_long magic, const zval *zv)
+{
+ PHP_WHIRLPOOL_CTX *ctx = (PHP_WHIRLPOOL_CTX *) hash->context;
+ int r = FAILURE;
+ if (magic == PHP_HASH_SERIALIZE_MAGIC_SPEC
+ && (r = php_hash_unserialize_spec(hash, zv, PHP_WHIRLPOOL_SPEC)) == SUCCESS
+ && ctx->buffer.pos >= 0
+ && ctx->buffer.pos < (int) sizeof(ctx->buffer.data)
+ && ctx->buffer.bits >= ctx->buffer.pos * 8
+ && ctx->buffer.bits < ctx->buffer.pos * 8 + 8) {
+ return SUCCESS;
+ } else {
+ return r != SUCCESS ? r : -2000;
+ }
+}
+
const php_hash_ops php_hash_whirlpool_ops = {
+ "whirlpool",
(php_hash_init_func_t) PHP_WHIRLPOOLInit,
(php_hash_update_func_t) PHP_WHIRLPOOLUpdate,
(php_hash_final_func_t) PHP_WHIRLPOOLFinal,
- (php_hash_copy_func_t) php_hash_copy,
+ php_hash_copy,
+ php_hash_serialize,
+ php_whirlpool_unserialize,
+ PHP_WHIRLPOOL_SPEC,
64,
64,
sizeof(PHP_WHIRLPOOL_CTX),
diff --git a/ext/hash/php_hash.h b/ext/hash/php_hash.h
index 8e919e2a6f..33cc6a473a 100644
--- a/ext/hash/php_hash.h
+++ b/ext/hash/php_hash.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -27,18 +25,28 @@
#define PHP_HASH_HMAC 0x0001
+#define PHP_HASH_SERIALIZE_MAGIC_SPEC 2
+
#define L64 INT64_C
+typedef struct _php_hashcontext_object php_hashcontext_object;
+
typedef void (*php_hash_init_func_t)(void *context);
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);
+typedef int (*php_hash_serialize_func_t)(const php_hashcontext_object *hash, zend_long *magic, zval *zv);
+typedef int (*php_hash_unserialize_func_t)(php_hashcontext_object *hash, zend_long magic, const zval *zv);
typedef struct _php_hash_ops {
+ const char *algo;
php_hash_init_func_t hash_init;
php_hash_update_func_t hash_update;
php_hash_final_func_t hash_final;
php_hash_copy_func_t hash_copy;
+ php_hash_serialize_func_t hash_serialize;
+ php_hash_unserialize_func_t hash_unserialize;
+ const char *serialize_spec;
size_t digest_size;
size_t block_size;
@@ -46,7 +54,7 @@ typedef struct _php_hash_ops {
unsigned is_crypto: 1;
} php_hash_ops;
-typedef struct _php_hashcontext_object {
+struct _php_hashcontext_object {
const php_hash_ops *ops;
void *context;
@@ -54,7 +62,7 @@ typedef struct _php_hashcontext_object {
unsigned char *key;
zend_object std;
-} php_hashcontext_object;
+};
static inline php_hashcontext_object *php_hashcontext_from_object(zend_object *obj) {
return ((php_hashcontext_object*)(obj + 1)) - 1;
@@ -129,24 +137,19 @@ extern zend_module_entry hash_module_entry;
# define PHP_HASH_API
#endif
-PHP_FUNCTION(hash);
-PHP_FUNCTION(hash_file);
-PHP_FUNCTION(hash_hkdf);
-PHP_FUNCTION(hash_hmac);
-PHP_FUNCTION(hash_hmac_file);
-PHP_FUNCTION(hash_init);
-PHP_FUNCTION(hash_update);
-PHP_FUNCTION(hash_update_stream);
-PHP_FUNCTION(hash_update_file);
-PHP_FUNCTION(hash_final);
-PHP_FUNCTION(hash_algos);
-PHP_FUNCTION(hash_pbkdf2);
-PHP_FUNCTION(hash_equals);
-
extern PHP_HASH_API zend_class_entry *php_hashcontext_ce;
-PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const char *algo, size_t algo_len);
+PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(zend_string *algo);
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);
+PHP_HASH_API int php_hash_serialize(const php_hashcontext_object *context, zend_long *magic, zval *zv);
+PHP_HASH_API int php_hash_unserialize(php_hashcontext_object *context, zend_long magic, const zval *zv);
+PHP_HASH_API int php_hash_serialize_spec(const php_hashcontext_object *context, zval *zv, const char *spec);
+PHP_HASH_API int php_hash_unserialize_spec(php_hashcontext_object *hash, const zval *zv, const char *spec);
+
+static inline void *php_hash_alloc_context(const php_hash_ops *ops) {
+ /* Zero out context memory so serialization doesn't expose internals */
+ return ecalloc(1, ops->context_size);
+}
static inline void php_hash_bin2hex(char *out, const unsigned char *in, size_t in_len)
{
diff --git a/ext/hash/php_hash_adler32.h b/ext/hash/php_hash_adler32.h
index 63f32ab536..049f16b28e 100644
--- a/ext/hash/php_hash_adler32.h
+++ b/ext/hash/php_hash_adler32.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -24,6 +22,7 @@
typedef struct {
uint32_t state;
} PHP_ADLER32_CTX;
+#define PHP_ADLER32_SPEC "l."
PHP_HASH_API void PHP_ADLER32Init(PHP_ADLER32_CTX *context);
PHP_HASH_API void PHP_ADLER32Update(PHP_ADLER32_CTX *context, const unsigned char *input, size_t len);
diff --git a/ext/hash/php_hash_crc32.h b/ext/hash/php_hash_crc32.h
index 6308b005e3..4c1b0fedc9 100644
--- a/ext/hash/php_hash_crc32.h
+++ b/ext/hash/php_hash_crc32.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -24,6 +22,7 @@
typedef struct {
uint32_t state;
} PHP_CRC32_CTX;
+#define PHP_CRC32_SPEC "l."
PHP_HASH_API void PHP_CRC32Init(PHP_CRC32_CTX *context);
PHP_HASH_API void PHP_CRC32Update(PHP_CRC32_CTX *context, const unsigned char *input, size_t len);
diff --git a/ext/hash/php_hash_crc32_tables.h b/ext/hash/php_hash_crc32_tables.h
index 8e2feccc01..6b342c83da 100644
--- a/ext/hash/php_hash_crc32_tables.h
+++ b/ext/hash/php_hash_crc32_tables.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
diff --git a/ext/hash/php_hash_fnv.h b/ext/hash/php_hash_fnv.h
index f00a469423..6728b2e902 100644
--- a/ext/hash/php_hash_fnv.h
+++ b/ext/hash/php_hash_fnv.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -46,10 +44,12 @@ enum php_fnv_type {
typedef struct {
uint32_t state;
} PHP_FNV132_CTX;
+#define PHP_FNV132_SPEC "l."
typedef struct {
uint64_t state;
} PHP_FNV164_CTX;
+#define PHP_FNV164_SPEC "q."
PHP_HASH_API void PHP_FNV132Init(PHP_FNV132_CTX *context);
diff --git a/ext/hash/php_hash_gost.h b/ext/hash/php_hash_gost.h
index 3837eeb263..eb9441faa6 100644
--- a/ext/hash/php_hash_gost.h
+++ b/ext/hash/php_hash_gost.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -24,11 +22,12 @@
/* GOST context */
typedef struct {
uint32_t state[16];
- size_t count[2];
+ uint32_t count[2];
unsigned char length;
unsigned char buffer[32];
const uint32_t (*tables)[4][256];
} PHP_GOST_CTX;
+#define PHP_GOST_SPEC "l16l2bb32"
PHP_HASH_API void PHP_GOSTInit(PHP_GOST_CTX *);
PHP_HASH_API void PHP_GOSTUpdate(PHP_GOST_CTX *, const unsigned char *, size_t);
diff --git a/ext/hash/php_hash_haval.h b/ext/hash/php_hash_haval.h
index 1188b79cc3..43802b4183 100644
--- a/ext/hash/php_hash_haval.h
+++ b/ext/hash/php_hash_haval.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -30,11 +28,12 @@ typedef struct {
short output;
void (*Transform)(uint32_t state[8], const unsigned char block[128]);
} PHP_HAVAL_CTX;
+#define PHP_HAVAL_SPEC "l8l2b128"
#define PHP_HASH_HAVAL_INIT_DECL(p,b) PHP_HASH_API void PHP_##p##HAVAL##b##Init(PHP_HAVAL_CTX *); \
PHP_HASH_API void PHP_HAVAL##b##Final(unsigned char*, PHP_HAVAL_CTX *);
-PHP_HASH_API void PHP_HAVALUpdate(PHP_HAVAL_CTX *, const unsigned char *, unsigned int);
+PHP_HASH_API void PHP_HAVALUpdate(PHP_HAVAL_CTX *, const unsigned char *, size_t);
PHP_HASH_HAVAL_INIT_DECL(3,128)
PHP_HASH_HAVAL_INIT_DECL(3,160)
diff --git a/ext/hash/php_hash_joaat.h b/ext/hash/php_hash_joaat.h
index b9e7e7a7ee..b0df8a67b3 100644
--- a/ext/hash/php_hash_joaat.h
+++ b/ext/hash/php_hash_joaat.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -22,6 +20,7 @@
typedef struct {
uint32_t state;
} PHP_JOAAT_CTX;
+#define PHP_JOAAT_SPEC "l."
PHP_HASH_API void PHP_JOAATInit(PHP_JOAAT_CTX *context);
PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, size_t inputLen);
diff --git a/ext/hash/php_hash_md.h b/ext/hash/php_hash_md.h
index 0073488c14..2a677fe54d 100644
--- a/ext/hash/php_hash_md.h
+++ b/ext/hash/php_hash_md.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -20,64 +18,15 @@
#ifndef PHP_HASH_MD_H
#define PHP_HASH_MD_H
-/* When SHA is removed from Core,
- the ext/standard/sha1.c file can be removed
- and the ext/standard/sha1.h file can be reduced to:
- #define PHP_HASH_SHA1_NOT_IN_CORE
- #include "ext/hash/php_hash_sha.h"
- Don't forget to remove md5() and md5_file() entries from basic_functions.c
- */
-
#include "ext/standard/md5.h"
-#ifdef PHP_HASH_MD5_NOT_IN_CORE
-/* MD5.H - header file for MD5C.C
- */
-
-/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
- rights reserved.
-
- License to copy and use this software is granted provided that it
- is identified as the "RSA Data Security, Inc. MD5 Message-Digest
- Algorithm" in all material mentioning or referencing this software
- or this function.
-
- License is also granted to make and use derivative works provided
- that such works are identified as "derived from the RSA Data
- Security, Inc. MD5 Message-Digest Algorithm" in all material
- mentioning or referencing the derived work.
-
- RSA Data Security, Inc. makes no representations concerning either
- the merchantability of this software or the suitability of this
- software for any particular purpose. It is provided "as is"
- without express or implied warranty of any kind.
-
- These notices must be retained in any copies of any part of this
- documentation and/or software.
- */
-
-/* MD5 context. */
-typedef struct {
- uint32_t state[4]; /* state (ABCD) */
- uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
- unsigned char buffer[64]; /* input buffer */
-} PHP_MD5_CTX;
-
-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 *, size_t);
-PHP_HASH_API void PHP_MD5Final(unsigned char[16], PHP_MD5_CTX *);
-
-PHP_NAMED_FUNCTION(php_if_md5);
-PHP_NAMED_FUNCTION(php_if_md5_file);
-#endif /* PHP_HASH_MD5_NOT_IN_CORE */
-
/* MD4 context */
typedef struct {
uint32_t state[4];
uint32_t count[2];
unsigned char buffer[64];
} PHP_MD4_CTX;
+#define PHP_MD4_SPEC "l4l2b64."
PHP_HASH_API void PHP_MD4Init(PHP_MD4_CTX *);
PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX *context, const unsigned char *, size_t);
@@ -88,8 +37,9 @@ typedef struct {
unsigned char state[48];
unsigned char checksum[16];
unsigned char buffer[16];
- char in_buffer;
+ unsigned char in_buffer;
} PHP_MD2_CTX;
+#define PHP_MD2_SPEC "b48b16b16b."
PHP_HASH_API void PHP_MD2Init(PHP_MD2_CTX *context);
PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *, size_t);
diff --git a/ext/hash/php_hash_ripemd.h b/ext/hash/php_hash_ripemd.h
index e8f1678166..dd9913b85b 100644
--- a/ext/hash/php_hash_ripemd.h
+++ b/ext/hash/php_hash_ripemd.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -26,24 +24,28 @@ typedef struct {
uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
} PHP_RIPEMD128_CTX;
+#define PHP_RIPEMD128_SPEC "l4l2b64."
typedef struct {
uint32_t state[5]; /* state (ABCD) */
uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
} PHP_RIPEMD160_CTX;
+#define PHP_RIPEMD160_SPEC "l5l2b64."
typedef struct {
uint32_t state[8]; /* state (ABCD) */
uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
} PHP_RIPEMD256_CTX;
+#define PHP_RIPEMD256_SPEC "l8l2b64."
typedef struct {
uint32_t state[10]; /* state (ABCD) */
uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
} PHP_RIPEMD320_CTX;
+#define PHP_RIPEMD320_SPEC "l10l2b64."
PHP_HASH_API void PHP_RIPEMD128Init(PHP_RIPEMD128_CTX *);
PHP_HASH_API void PHP_RIPEMD128Update(PHP_RIPEMD128_CTX *, const unsigned char *, size_t);
diff --git a/ext/hash/php_hash_sha.h b/ext/hash/php_hash_sha.h
index 4903f8d8b2..16da927363 100644
--- a/ext/hash/php_hash_sha.h
+++ b/ext/hash/php_hash_sha.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -20,40 +18,16 @@
#ifndef PHP_HASH_SHA_H
#define PHP_HASH_SHA_H
-/* When SHA is removed from Core,
- the ext/standard/sha1.c file can be removed
- and the ext/standard/sha1.h file can be reduced to:
- #define PHP_HASH_SHA1_NOT_IN_CORE
- #include "ext/hash/php_hash_sha.h"
- Don't forget to remove sha1() and sha1_file() from basic_functions.c
- */
#include "ext/standard/sha1.h"
#include "ext/standard/basic_functions.h"
-#ifdef PHP_HASH_SHA1_NOT_IN_CORE
-
-/* SHA1 context. */
-typedef struct {
- uint32_t state[5]; /* state (ABCD) */
- uint32_t count[2]; /* number of bits, modulo 2^64 */
- unsigned char buffer[64]; /* input buffer */
-} PHP_SHA1_CTX;
-
-PHP_HASH_API void PHP_SHA1Init(PHP_SHA1_CTX *);
-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);
-PHP_FUNCTION(sha1_file);
-
-#endif /* PHP_HASH_SHA1_NOT_IN_CORE */
-
/* SHA224 context. */
typedef struct {
uint32_t state[8]; /* state */
uint32_t count[2]; /* number of bits, modulo 2^64 */
unsigned char buffer[64]; /* input buffer */
} PHP_SHA224_CTX;
+#define PHP_SHA224_SPEC "l8l2b64."
PHP_HASH_API void PHP_SHA224Init(PHP_SHA224_CTX *);
PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX *, const unsigned char *, size_t);
@@ -65,6 +39,7 @@ typedef struct {
uint32_t count[2]; /* number of bits, modulo 2^64 */
unsigned char buffer[64]; /* input buffer */
} PHP_SHA256_CTX;
+#define PHP_SHA256_SPEC "l8l2b64."
PHP_HASH_API void PHP_SHA256Init(PHP_SHA256_CTX *);
PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX *, const unsigned char *, size_t);
@@ -76,6 +51,7 @@ typedef struct {
uint64_t count[2]; /* number of bits, modulo 2^128 */
unsigned char buffer[128]; /* input buffer */
} PHP_SHA384_CTX;
+#define PHP_SHA384_SPEC "q8q2b128."
PHP_HASH_API void PHP_SHA384Init(PHP_SHA384_CTX *);
PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX *, const unsigned char *, size_t);
@@ -87,6 +63,7 @@ typedef struct {
uint64_t count[2]; /* number of bits, modulo 2^128 */
unsigned char buffer[128]; /* input buffer */
} PHP_SHA512_CTX;
+#define PHP_SHA512_SPEC "q8q2b128."
PHP_HASH_API void PHP_SHA512Init(PHP_SHA512_CTX *);
PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX *, const unsigned char *, size_t);
diff --git a/ext/hash/php_hash_sha3.h b/ext/hash/php_hash_sha3.h
index 0608f4005e..f75191f339 100644
--- a/ext/hash/php_hash_sha3.h
+++ b/ext/hash/php_hash_sha3.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -26,9 +24,12 @@ typedef struct {
unsigned char state[200]; // 5 * 5 * sizeof(uint64)
uint32_t pos;
#else
- void *hashinstance;
+ unsigned char state[224]; // this must fit a Keccak_HashInstance
#endif
} PHP_SHA3_CTX;
+#ifdef HAVE_SLOW_HASH3
+#define PHP_SHA3_SPEC "b200l."
+#endif
typedef PHP_SHA3_CTX PHP_SHA3_224_CTX;
typedef PHP_SHA3_CTX PHP_SHA3_256_CTX;
diff --git a/ext/hash/php_hash_snefru.h b/ext/hash/php_hash_snefru.h
index 2040fbfc94..0f339e9309 100644
--- a/ext/hash/php_hash_snefru.h
+++ b/ext/hash/php_hash_snefru.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -32,6 +30,7 @@ typedef struct {
unsigned char length;
unsigned char buffer[32];
} PHP_SNEFRU_CTX;
+#define PHP_SNEFRU_SPEC "l16l2bb32"
PHP_HASH_API void PHP_SNEFRUInit(PHP_SNEFRU_CTX *);
PHP_HASH_API void PHP_SNEFRUUpdate(PHP_SNEFRU_CTX *, const unsigned char *, size_t);
diff --git a/ext/hash/php_hash_snefru_tables.h b/ext/hash/php_hash_snefru_tables.h
index 20d385443d..bed4befae3 100644
--- a/ext/hash/php_hash_snefru_tables.h
+++ b/ext/hash/php_hash_snefru_tables.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
diff --git a/ext/hash/php_hash_tiger.h b/ext/hash/php_hash_tiger.h
index b80e4e3254..d30276ddea 100644
--- a/ext/hash/php_hash_tiger.h
+++ b/ext/hash/php_hash_tiger.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -24,9 +22,10 @@ typedef struct {
uint64_t state[3];
uint64_t passed;
unsigned char buffer[64];
+ uint32_t length;
unsigned int passes:1;
- size_t length;
} PHP_TIGER_CTX;
+#define PHP_TIGER_SPEC "q3qb64l"
PHP_HASH_API void PHP_3TIGERInit(PHP_TIGER_CTX *context);
PHP_HASH_API void PHP_4TIGERInit(PHP_TIGER_CTX *context);
diff --git a/ext/hash/php_hash_tiger_tables.h b/ext/hash/php_hash_tiger_tables.h
index 3dbdc0a4c6..d5e94badc7 100644
--- a/ext/hash/php_hash_tiger_tables.h
+++ b/ext/hash/php_hash_tiger_tables.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
diff --git a/ext/hash/php_hash_whirlpool.h b/ext/hash/php_hash_whirlpool.h
index 3a2e98cff2..fbd5948a48 100644
--- a/ext/hash/php_hash_whirlpool.h
+++ b/ext/hash/php_hash_whirlpool.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -29,6 +27,7 @@ typedef struct {
unsigned char data[64];
} buffer;
} PHP_WHIRLPOOL_CTX;
+#define PHP_WHIRLPOOL_SPEC "q8b32iib64."
PHP_HASH_API void PHP_WHIRLPOOLInit(PHP_WHIRLPOOL_CTX *);
PHP_HASH_API void PHP_WHIRLPOOLUpdate(PHP_WHIRLPOOL_CTX *, const unsigned char *, size_t);
diff --git a/ext/hash/php_hash_whirlpool_tables.h b/ext/hash/php_hash_whirlpool_tables.h
index 2127ccca59..a42d20a8b6 100644
--- a/ext/hash/php_hash_whirlpool_tables.h
+++ b/ext/hash/php_hash_whirlpool_tables.h
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
diff --git a/ext/hash/sha3/generic32lc/KeccakHash.h b/ext/hash/sha3/generic32lc/KeccakHash.h
index ec35d3dab2..d53ac1c587 100644
--- a/ext/hash/sha3/generic32lc/KeccakHash.h
+++ b/ext/hash/sha3/generic32lc/KeccakHash.h
@@ -108,6 +108,8 @@ HashReturn Keccak_HashFinal(Keccak_HashInstance *hashInstance, BitSequence *hash
*/
HashReturn Keccak_HashSqueeze(Keccak_HashInstance *hashInstance, BitSequence *data, DataLength databitlen);
+#define Keccak_HashInstance_ImplType 32
+
#endif
#endif
diff --git a/ext/hash/sha3/generic32lc/KeccakP-1600-inplace32BI.c b/ext/hash/sha3/generic32lc/KeccakP-1600-inplace32BI.c
index b566291220..74ade78eb5 100644
--- a/ext/hash/sha3/generic32lc/KeccakP-1600-inplace32BI.c
+++ b/ext/hash/sha3/generic32lc/KeccakP-1600-inplace32BI.c
@@ -17,6 +17,14 @@ http://creativecommons.org/publicdomain/zero/1.0/
#include "brg_endian.h"
#include "KeccakP-1600-SnP.h"
#include "SnP-Relaned.h"
+#ifdef __has_feature
+# if __has_feature(undefined_behavior_sanitizer)
+# define ALLOW_MISALIGNED_ACCESS __attribute__((no_sanitize("alignment")))
+# endif
+#endif
+#ifndef ALLOW_MISALIGNED_ACCESS
+# define ALLOW_MISALIGNED_ACCESS
+#endif
typedef unsigned char UINT8;
typedef unsigned int UINT32;
@@ -162,6 +170,7 @@ void KeccakP1600_AddBytesInLane(void *state, unsigned int lanePosition, const un
/* ---------------------------------------------------------------- */
+ALLOW_MISALIGNED_ACCESS
void KeccakP1600_AddLanes(void *state, const unsigned char *data, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
@@ -217,6 +226,7 @@ void KeccakP1600_OverwriteBytesInLane(void *state, unsigned int lanePosition, co
/* ---------------------------------------------------------------- */
+ALLOW_MISALIGNED_ACCESS
void KeccakP1600_OverwriteLanes(void *state, const unsigned char *data, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
@@ -304,6 +314,7 @@ void KeccakP1600_ExtractBytesInLane(const void *state, unsigned int lanePosition
/* ---------------------------------------------------------------- */
+ALLOW_MISALIGNED_ACCESS
void KeccakP1600_ExtractLanes(const void *state, unsigned char *data, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
@@ -378,6 +389,7 @@ void KeccakP1600_ExtractAndAddBytesInLane(const void *state, unsigned int lanePo
/* ---------------------------------------------------------------- */
+ALLOW_MISALIGNED_ACCESS
void KeccakP1600_ExtractAndAddLanes(const void *state, const unsigned char *input, unsigned char *output, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
diff --git a/ext/hash/sha3/generic64lc/KeccakHash.h b/ext/hash/sha3/generic64lc/KeccakHash.h
index ec35d3dab2..6afe6c8c9a 100644
--- a/ext/hash/sha3/generic64lc/KeccakHash.h
+++ b/ext/hash/sha3/generic64lc/KeccakHash.h
@@ -108,6 +108,8 @@ HashReturn Keccak_HashFinal(Keccak_HashInstance *hashInstance, BitSequence *hash
*/
HashReturn Keccak_HashSqueeze(Keccak_HashInstance *hashInstance, BitSequence *data, DataLength databitlen);
+#define Keccak_HashInstance_ImplType 64
+
#endif
#endif
diff --git a/ext/hash/sha3/generic64lc/KeccakP-1600-opt64.c b/ext/hash/sha3/generic64lc/KeccakP-1600-opt64.c
index 40853ff997..fa708ad833 100644
--- a/ext/hash/sha3/generic64lc/KeccakP-1600-opt64.c
+++ b/ext/hash/sha3/generic64lc/KeccakP-1600-opt64.c
@@ -17,6 +17,14 @@ http://creativecommons.org/publicdomain/zero/1.0/
#include <stdlib.h>
#include "brg_endian.h"
#include "KeccakP-1600-opt64-config.h"
+#ifdef __has_feature
+# if __has_feature(undefined_behavior_sanitizer)
+# define ALLOW_MISALIGNED_ACCESS __attribute__((no_sanitize("alignment")))
+# endif
+#endif
+#ifndef ALLOW_MISALIGNED_ACCESS
+# define ALLOW_MISALIGNED_ACCESS
+#endif
typedef unsigned char UINT8;
typedef unsigned long long int UINT64;
@@ -114,6 +122,7 @@ void KeccakP1600_AddBytesInLane(void *state, unsigned int lanePosition, const un
/* ---------------------------------------------------------------- */
+ALLOW_MISALIGNED_ACCESS
void KeccakP1600_AddLanes(void *state, const unsigned char *data, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
@@ -462,6 +471,7 @@ void KeccakP1600_ExtractAndAddBytes(const void *state, const unsigned char *inpu
/* ---------------------------------------------------------------- */
+ALLOW_MISALIGNED_ACCESS
size_t KeccakF1600_FastLoop_Absorb(void *state, unsigned int laneCount, const unsigned char *data, size_t dataByteLen)
{
size_t originalDataByteLen = dataByteLen;
diff --git a/ext/hash/tests/fnv132.phpt b/ext/hash/tests/fnv132.phpt
index 914ce46f35..37618819bd 100644
--- a/ext/hash/tests/fnv132.phpt
+++ b/ext/hash/tests/fnv132.phpt
@@ -4,192 +4,192 @@ Hash: FNV132 algorithm
<?php
function R10($t) {
- return str_repeat($t, 10);
+ return str_repeat($t, 10);
}
function R500($t) {
- return str_repeat($t, 500);
+ return str_repeat($t, 500);
}
$tests = array(
- array( "", "811c9dc5" ),
- array( "a", "050c5d7e" ),
- array( "b", "050c5d7d" ),
- array( "c", "050c5d7c" ),
- array( "d", "050c5d7b" ),
- array( "e", "050c5d7a" ),
- array( "f", "050c5d79" ),
- array( "fo", "6b772514" ),
- array( "foo", "408f5e13" ),
- array( "foob", "b4b1178b" ),
- array( "fooba", "fdc80fb0" ),
- array( "foobar", "31f0b262" ),
- array( "\0", "050c5d1f" ),
- array( "a\0", "70772d5a" ),
- array( "b\0", "6f772bc7" ),
- array( "c\0", "6e772a34" ),
- array( "d\0", "6d7728a1" ),
- array( "e\0", "6c77270e" ),
- array( "f\0", "6b77257b" ),
- array( "fo\0", "408f5e7c" ),
- array( "foo\0", "b4b117e9" ),
- array( "foob\0", "fdc80fd1" ),
- array( "fooba\0", "31f0b210" ),
- array( "foobar\0", "ffe8d046" ),
- array( "ch", "6e772a5c" ),
- array( "cho", "4197aebb" ),
- array( "chon", "fcc8100f" ),
- array( "chong", "fdf147fa" ),
- array( "chongo", "bcd44ee1" ),
- array( "chongo ", "23382c13" ),
- array( "chongo w", "846d619e" ),
- array( "chongo wa", "1630abdb" ),
- array( "chongo was", "c99e89b2" ),
- array( "chongo was ", "1692c316" ),
- array( "chongo was h", "9f091bca" ),
- array( "chongo was he", "2556be9b" ),
- array( "chongo was her", "628e0e73" ),
- array( "chongo was here", "98a0bf6c" ),
- array( "chongo was here!", "b10d5725" ),
- array( "chongo was here!\n", "dd002f35" ),
- array( "ch\0", "4197aed4" ),
- array( "cho\0", "fcc81061" ),
- array( "chon\0", "fdf1479d" ),
- array( "chong\0", "bcd44e8e" ),
- array( "chongo\0", "23382c33" ),
- array( "chongo \0", "846d61e9" ),
- array( "chongo w\0", "1630abba" ),
- array( "chongo wa\0", "c99e89c1" ),
- array( "chongo was\0", "1692c336" ),
- array( "chongo was \0", "9f091ba2" ),
- array( "chongo was h\0", "2556befe" ),
- array( "chongo was he\0", "628e0e01" ),
- array( "chongo was her\0", "98a0bf09" ),
- array( "chongo was here\0", "b10d5704" ),
- array( "chongo was here!\0", "dd002f3f" ),
- array( "chongo was here!\n\0", "1c4a506f" ),
- array( "cu", "6e772a41" ),
- array( "cur", "26978421" ),
- array( "curd", "e184ff97" ),
- array( "curds", "9b5e5ac6" ),
- array( "curds ", "5b88e592" ),
- array( "curds a", "aa8164b7" ),
- array( "curds an", "20b18c7b" ),
- array( "curds and", "f28025c5" ),
- array( "curds and ", "84bb753f" ),
- array( "curds and w", "3219925a" ),
- array( "curds and wh", "384163c6" ),
- array( "curds and whe", "54f010d7" ),
- array( "curds and whey", "8cea820c" ),
- array( "curds and whey\n", "e12ab8ee" ),
- array( "cu\0", "26978453" ),
- array( "cur\0", "e184fff3" ),
- array( "curd\0", "9b5e5ab5" ),
- array( "curds\0", "5b88e5b2" ),
- array( "curds \0", "aa8164d6" ),
- array( "curds a\0", "20b18c15" ),
- array( "curds an\0", "f28025a1" ),
- array( "curds and\0", "84bb751f" ),
- array( "curds and \0", "3219922d" ),
- array( "curds and w\0", "384163ae" ),
- array( "curds and wh\0", "54f010b2" ),
- array( "curds and whe\0", "8cea8275" ),
- array( "curds and whey\0", "e12ab8e4" ),
- array( "curds and whey\n\0", "64411eaa" ),
- array( "line 1\nline 2\nline 3", "31ae8f83" ),
- array( "chongo <Landon Curt Noll> /\\../\\", "995fa9c4" ),
- array( "chongo <Landon Curt Noll> /\\../\\\0", "35983f8c" ),
- array( "chongo (Landon Curt Noll) /\\../\\", "5036a251" ),
- array( "chongo (Landon Curt Noll) /\\../\\\0", "97018583" ),
- array( "http://antwrp.gsfc.nasa.gov/apod/astropix.html", "b4448d60" ),
- array( "http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash", "025dfe59" ),
- array( "http://epod.usra.edu/", "c5eab3af" ),
- array( "http://exoplanet.eu/", "7d21ba1e" ),
- array( "http://hvo.wr.usgs.gov/cam3/", "7704cddb" ),
- array( "http://hvo.wr.usgs.gov/cams/HMcam/", "d0071bfe" ),
- array( "http://hvo.wr.usgs.gov/kilauea/update/deformation.html", "0ff3774c" ),
- array( "http://hvo.wr.usgs.gov/kilauea/update/images.html", "b0fea0ea" ),
- array( "http://hvo.wr.usgs.gov/kilauea/update/maps.html", "58177303" ),
- array( "http://hvo.wr.usgs.gov/volcanowatch/current_issue.html", "4f599cda" ),
- array( "http://neo.jpl.nasa.gov/risk/", "3e590a47" ),
- array( "http://norvig.com/21-days.html", "965595f8" ),
- array( "http://primes.utm.edu/curios/home.php", "c37f178d" ),
- array( "http://slashdot.org/", "9711dd26" ),
- array( "http://tux.wr.usgs.gov/Maps/155.25-19.5.html", "23c99b7f" ),
- array( "http://volcano.wr.usgs.gov/kilaueastatus.php", "6e568b17" ),
- array( "http://www.avo.alaska.edu/activity/Redoubt.php", "43f0245b" ),
- array( "http://www.dilbert.com/fast/", "bcb7a001" ),
- array( "http://www.fourmilab.ch/gravitation/orbits/", "12e6dffe" ),
- array( "http://www.fpoa.net/", "0792f2d6" ),
- array( "http://www.ioccc.org/index.html", "b966936b" ),
- array( "http://www.isthe.com/cgi-bin/number.cgi", "46439ac5" ),
- array( "http://www.isthe.com/chongo/bio.html", "728d49af" ),
- array( "http://www.isthe.com/chongo/index.html", "d33745c9" ),
- array( "http://www.isthe.com/chongo/src/calc/lucas-calc", "bc382a57" ),
- array( "http://www.isthe.com/chongo/tech/astro/venus2004.html", "4bda1d31" ),
- array( "http://www.isthe.com/chongo/tech/astro/vita.html", "ce35ccae" ),
- array( "http://www.isthe.com/chongo/tech/comp/c/expert.html", "3b6eed94" ),
- array( "http://www.isthe.com/chongo/tech/comp/calc/index.html", "445c9c58" ),
- array( "http://www.isthe.com/chongo/tech/comp/fnv/index.html", "3db8bf9d" ),
- array( "http://www.isthe.com/chongo/tech/math/number/howhigh.html", "2dee116d" ),
- array( "http://www.isthe.com/chongo/tech/math/number/number.html", "c18738da" ),
- array( "http://www.isthe.com/chongo/tech/math/prime/mersenne.html", "5b156176" ),
- array( "http://www.isthe.com/chongo/tech/math/prime/mersenne.html#largest", "2aa7d593" ),
- array( "http://www.lavarnd.org/cgi-bin/corpspeak.cgi", "b2409658" ),
- array( "http://www.lavarnd.org/cgi-bin/haiku.cgi", "e1489528" ),
- array( "http://www.lavarnd.org/cgi-bin/rand-none.cgi", "fe1ee07e" ),
- array( "http://www.lavarnd.org/cgi-bin/randdist.cgi", "e8842315" ),
- array( "http://www.lavarnd.org/index.html", "3a6a63a2" ),
- array( "http://www.lavarnd.org/what/nist-test.html", "06d2c18c" ),
- array( "http://www.macosxhints.com/", "f8ef7225" ),
- array( "http://www.mellis.com/", "843d3300" ),
- array( "http://www.nature.nps.gov/air/webcams/parks/havoso2alert/havoalert.cfm", "bb24f7ae" ),
- array( "http://www.nature.nps.gov/air/webcams/parks/havoso2alert/timelines_24.cfm", "878c0ec9" ),
- array( "http://www.paulnoll.com/", "b557810f" ),
- array( "http://www.pepysdiary.com/", "57423246" ),
- array( "http://www.sciencenews.org/index/home/activity/view", "87f7505e" ),
- array( "http://www.skyandtelescope.com/", "bb809f20" ),
- array( "http://www.sput.nl/~rob/sirius.html", "8932abb5" ),
- array( "http://www.systemexperts.com/", "0a9b3aa0" ),
- array( "http://www.tq-international.com/phpBB3/index.php", "b8682a24" ),
- array( "http://www.travelquesttours.com/index.htm", "a7ac1c56" ),
- array( "http://www.wunderground.com/global/stations/89606.html", "11409252" ),
- array( R10("21701"), "a987f517" ),
- array( R10("M21701"), "f309e7ed" ),
- array( R10("2^21701-1"), "c9e8f417" ),
- array( R10("\x54\xc5"), "7f447bdd" ),
- array( R10("\xc5\x54"), "b929adc5" ),
- array( R10("23209"), "57022879" ),
- array( R10("M23209"), "dcfd2c49" ),
- array( R10("2^23209-1"), "6edafff5" ),
- array( R10("\x5a\xa9"), "f04fb1f1" ),
- array( R10("\xa9\x5a"), "fb7de8b9" ),
- array( R10("391581216093"), "c5f1d7e9" ),
- array( R10("391581*2^216093-1"), "32c1f439" ),
- array( R10("\x05\xf9\x9d\x03\x4c\x81"), "7fd3eb7d" ),
- array( R10("FEDCBA9876543210"), "81597da5" ),
- array( R10("\xfe\xdc\xba\x98\x76\x54\x32\x10"), "05eb7a25" ),
- array( R10("EFCDAB8967452301"), "9c0fa1b5" ),
- array( R10("\xef\xcd\xab\x89\x67\x45\x23\x01"), "53ccb1c5" ),
- array( R10("0123456789ABCDEF"), "fabece15" ),
- array( R10("\x01\x23\x45\x67\x89\xab\xcd\xef"), "4ad745a5" ),
- array( R10("1032547698BADCFE"), "e5bdc495" ),
- array( R10("\x10\x32\x54\x76\x98\xba\xdc\xfe"), "23b3c0a5" ),
- array( R500("\x00"), "fa823dd5" ),
- array( R500("\x07"), "0c6c58b9" ),
- array( R500("~"), "e2dbccd5" ),
- array( R500("\x7f"), "db7f50f9" ),
+ array( "", "811c9dc5" ),
+ array( "a", "050c5d7e" ),
+ array( "b", "050c5d7d" ),
+ array( "c", "050c5d7c" ),
+ array( "d", "050c5d7b" ),
+ array( "e", "050c5d7a" ),
+ array( "f", "050c5d79" ),
+ array( "fo", "6b772514" ),
+ array( "foo", "408f5e13" ),
+ array( "foob", "b4b1178b" ),
+ array( "fooba", "fdc80fb0" ),
+ array( "foobar", "31f0b262" ),
+ array( "\0", "050c5d1f" ),
+ array( "a\0", "70772d5a" ),
+ array( "b\0", "6f772bc7" ),
+ array( "c\0", "6e772a34" ),
+ array( "d\0", "6d7728a1" ),
+ array( "e\0", "6c77270e" ),
+ array( "f\0", "6b77257b" ),
+ array( "fo\0", "408f5e7c" ),
+ array( "foo\0", "b4b117e9" ),
+ array( "foob\0", "fdc80fd1" ),
+ array( "fooba\0", "31f0b210" ),
+ array( "foobar\0", "ffe8d046" ),
+ array( "ch", "6e772a5c" ),
+ array( "cho", "4197aebb" ),
+ array( "chon", "fcc8100f" ),
+ array( "chong", "fdf147fa" ),
+ array( "chongo", "bcd44ee1" ),
+ array( "chongo ", "23382c13" ),
+ array( "chongo w", "846d619e" ),
+ array( "chongo wa", "1630abdb" ),
+ array( "chongo was", "c99e89b2" ),
+ array( "chongo was ", "1692c316" ),
+ array( "chongo was h", "9f091bca" ),
+ array( "chongo was he", "2556be9b" ),
+ array( "chongo was her", "628e0e73" ),
+ array( "chongo was here", "98a0bf6c" ),
+ array( "chongo was here!", "b10d5725" ),
+ array( "chongo was here!\n", "dd002f35" ),
+ array( "ch\0", "4197aed4" ),
+ array( "cho\0", "fcc81061" ),
+ array( "chon\0", "fdf1479d" ),
+ array( "chong\0", "bcd44e8e" ),
+ array( "chongo\0", "23382c33" ),
+ array( "chongo \0", "846d61e9" ),
+ array( "chongo w\0", "1630abba" ),
+ array( "chongo wa\0", "c99e89c1" ),
+ array( "chongo was\0", "1692c336" ),
+ array( "chongo was \0", "9f091ba2" ),
+ array( "chongo was h\0", "2556befe" ),
+ array( "chongo was he\0", "628e0e01" ),
+ array( "chongo was her\0", "98a0bf09" ),
+ array( "chongo was here\0", "b10d5704" ),
+ array( "chongo was here!\0", "dd002f3f" ),
+ array( "chongo was here!\n\0", "1c4a506f" ),
+ array( "cu", "6e772a41" ),
+ array( "cur", "26978421" ),
+ array( "curd", "e184ff97" ),
+ array( "curds", "9b5e5ac6" ),
+ array( "curds ", "5b88e592" ),
+ array( "curds a", "aa8164b7" ),
+ array( "curds an", "20b18c7b" ),
+ array( "curds and", "f28025c5" ),
+ array( "curds and ", "84bb753f" ),
+ array( "curds and w", "3219925a" ),
+ array( "curds and wh", "384163c6" ),
+ array( "curds and whe", "54f010d7" ),
+ array( "curds and whey", "8cea820c" ),
+ array( "curds and whey\n", "e12ab8ee" ),
+ array( "cu\0", "26978453" ),
+ array( "cur\0", "e184fff3" ),
+ array( "curd\0", "9b5e5ab5" ),
+ array( "curds\0", "5b88e5b2" ),
+ array( "curds \0", "aa8164d6" ),
+ array( "curds a\0", "20b18c15" ),
+ array( "curds an\0", "f28025a1" ),
+ array( "curds and\0", "84bb751f" ),
+ array( "curds and \0", "3219922d" ),
+ array( "curds and w\0", "384163ae" ),
+ array( "curds and wh\0", "54f010b2" ),
+ array( "curds and whe\0", "8cea8275" ),
+ array( "curds and whey\0", "e12ab8e4" ),
+ array( "curds and whey\n\0", "64411eaa" ),
+ array( "line 1\nline 2\nline 3", "31ae8f83" ),
+ array( "chongo <Landon Curt Noll> /\\../\\", "995fa9c4" ),
+ array( "chongo <Landon Curt Noll> /\\../\\\0", "35983f8c" ),
+ array( "chongo (Landon Curt Noll) /\\../\\", "5036a251" ),
+ array( "chongo (Landon Curt Noll) /\\../\\\0", "97018583" ),
+ array( "http://antwrp.gsfc.nasa.gov/apod/astropix.html", "b4448d60" ),
+ array( "http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash", "025dfe59" ),
+ array( "http://epod.usra.edu/", "c5eab3af" ),
+ array( "http://exoplanet.eu/", "7d21ba1e" ),
+ array( "http://hvo.wr.usgs.gov/cam3/", "7704cddb" ),
+ array( "http://hvo.wr.usgs.gov/cams/HMcam/", "d0071bfe" ),
+ array( "http://hvo.wr.usgs.gov/kilauea/update/deformation.html", "0ff3774c" ),
+ array( "http://hvo.wr.usgs.gov/kilauea/update/images.html", "b0fea0ea" ),
+ array( "http://hvo.wr.usgs.gov/kilauea/update/maps.html", "58177303" ),
+ array( "http://hvo.wr.usgs.gov/volcanowatch/current_issue.html", "4f599cda" ),
+ array( "http://neo.jpl.nasa.gov/risk/", "3e590a47" ),
+ array( "http://norvig.com/21-days.html", "965595f8" ),
+ array( "http://primes.utm.edu/curios/home.php", "c37f178d" ),
+ array( "http://slashdot.org/", "9711dd26" ),
+ array( "http://tux.wr.usgs.gov/Maps/155.25-19.5.html", "23c99b7f" ),
+ array( "http://volcano.wr.usgs.gov/kilaueastatus.php", "6e568b17" ),
+ array( "http://www.avo.alaska.edu/activity/Redoubt.php", "43f0245b" ),
+ array( "http://www.dilbert.com/fast/", "bcb7a001" ),
+ array( "http://www.fourmilab.ch/gravitation/orbits/", "12e6dffe" ),
+ array( "http://www.fpoa.net/", "0792f2d6" ),
+ array( "http://www.ioccc.org/index.html", "b966936b" ),
+ array( "http://www.isthe.com/cgi-bin/number.cgi", "46439ac5" ),
+ array( "http://www.isthe.com/chongo/bio.html", "728d49af" ),
+ array( "http://www.isthe.com/chongo/index.html", "d33745c9" ),
+ array( "http://www.isthe.com/chongo/src/calc/lucas-calc", "bc382a57" ),
+ array( "http://www.isthe.com/chongo/tech/astro/venus2004.html", "4bda1d31" ),
+ array( "http://www.isthe.com/chongo/tech/astro/vita.html", "ce35ccae" ),
+ array( "http://www.isthe.com/chongo/tech/comp/c/expert.html", "3b6eed94" ),
+ array( "http://www.isthe.com/chongo/tech/comp/calc/index.html", "445c9c58" ),
+ array( "http://www.isthe.com/chongo/tech/comp/fnv/index.html", "3db8bf9d" ),
+ array( "http://www.isthe.com/chongo/tech/math/number/howhigh.html", "2dee116d" ),
+ array( "http://www.isthe.com/chongo/tech/math/number/number.html", "c18738da" ),
+ array( "http://www.isthe.com/chongo/tech/math/prime/mersenne.html", "5b156176" ),
+ array( "http://www.isthe.com/chongo/tech/math/prime/mersenne.html#largest", "2aa7d593" ),
+ array( "http://www.lavarnd.org/cgi-bin/corpspeak.cgi", "b2409658" ),
+ array( "http://www.lavarnd.org/cgi-bin/haiku.cgi", "e1489528" ),
+ array( "http://www.lavarnd.org/cgi-bin/rand-none.cgi", "fe1ee07e" ),
+ array( "http://www.lavarnd.org/cgi-bin/randdist.cgi", "e8842315" ),
+ array( "http://www.lavarnd.org/index.html", "3a6a63a2" ),
+ array( "http://www.lavarnd.org/what/nist-test.html", "06d2c18c" ),
+ array( "http://www.macosxhints.com/", "f8ef7225" ),
+ array( "http://www.mellis.com/", "843d3300" ),
+ array( "http://www.nature.nps.gov/air/webcams/parks/havoso2alert/havoalert.cfm", "bb24f7ae" ),
+ array( "http://www.nature.nps.gov/air/webcams/parks/havoso2alert/timelines_24.cfm", "878c0ec9" ),
+ array( "http://www.paulnoll.com/", "b557810f" ),
+ array( "http://www.pepysdiary.com/", "57423246" ),
+ array( "http://www.sciencenews.org/index/home/activity/view", "87f7505e" ),
+ array( "http://www.skyandtelescope.com/", "bb809f20" ),
+ array( "http://www.sput.nl/~rob/sirius.html", "8932abb5" ),
+ array( "http://www.systemexperts.com/", "0a9b3aa0" ),
+ array( "http://www.tq-international.com/phpBB3/index.php", "b8682a24" ),
+ array( "http://www.travelquesttours.com/index.htm", "a7ac1c56" ),
+ array( "http://www.wunderground.com/global/stations/89606.html", "11409252" ),
+ array( R10("21701"), "a987f517" ),
+ array( R10("M21701"), "f309e7ed" ),
+ array( R10("2^21701-1"), "c9e8f417" ),
+ array( R10("\x54\xc5"), "7f447bdd" ),
+ array( R10("\xc5\x54"), "b929adc5" ),
+ array( R10("23209"), "57022879" ),
+ array( R10("M23209"), "dcfd2c49" ),
+ array( R10("2^23209-1"), "6edafff5" ),
+ array( R10("\x5a\xa9"), "f04fb1f1" ),
+ array( R10("\xa9\x5a"), "fb7de8b9" ),
+ array( R10("391581216093"), "c5f1d7e9" ),
+ array( R10("391581*2^216093-1"), "32c1f439" ),
+ array( R10("\x05\xf9\x9d\x03\x4c\x81"), "7fd3eb7d" ),
+ array( R10("FEDCBA9876543210"), "81597da5" ),
+ array( R10("\xfe\xdc\xba\x98\x76\x54\x32\x10"), "05eb7a25" ),
+ array( R10("EFCDAB8967452301"), "9c0fa1b5" ),
+ array( R10("\xef\xcd\xab\x89\x67\x45\x23\x01"), "53ccb1c5" ),
+ array( R10("0123456789ABCDEF"), "fabece15" ),
+ array( R10("\x01\x23\x45\x67\x89\xab\xcd\xef"), "4ad745a5" ),
+ array( R10("1032547698BADCFE"), "e5bdc495" ),
+ array( R10("\x10\x32\x54\x76\x98\xba\xdc\xfe"), "23b3c0a5" ),
+ array( R500("\x00"), "fa823dd5" ),
+ array( R500("\x07"), "0c6c58b9" ),
+ array( R500("~"), "e2dbccd5" ),
+ array( R500("\x7f"), "db7f50f9" ),
);
$i = 0;
$pass = true;
foreach($tests as $test) {
- $result = hash('fnv132', $test[0]);
- if ($result != $test[1]) {
- echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n";
+ $result = hash('fnv132', $test[0]);
+ if ($result != $test[1]) {
+ echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n";
$pass = false;
- }
- $i++;
+ }
+ $i++;
}
if($pass) {
diff --git a/ext/hash/tests/fnv164.phpt b/ext/hash/tests/fnv164.phpt
index 8ff7304a7b..9795524a69 100644
--- a/ext/hash/tests/fnv164.phpt
+++ b/ext/hash/tests/fnv164.phpt
@@ -4,192 +4,192 @@ Hash: FNV164 algorithm
<?php
function R10($t) {
- return str_repeat($t, 10);
+ return str_repeat($t, 10);
}
function R500($t) {
- return str_repeat($t, 500);
+ return str_repeat($t, 500);
}
$tests = array(
- array( "", "cbf29ce484222325" ),
- array( "a", "af63bd4c8601b7be" ),
- array( "b", "af63bd4c8601b7bd" ),
- array( "c", "af63bd4c8601b7bc" ),
- array( "d", "af63bd4c8601b7bb" ),
- array( "e", "af63bd4c8601b7ba" ),
- array( "f", "af63bd4c8601b7b9" ),
- array( "fo", "08326207b4eb2f34" ),
- array( "foo", "d8cbc7186ba13533" ),
- array( "foob", "0378817ee2ed65cb" ),
- array( "fooba", "d329d59b9963f790" ),
- array( "foobar", "340d8765a4dda9c2" ),
- array( "\0", "af63bd4c8601b7df" ),
- array( "a\0", "08326707b4eb37da" ),
- array( "b\0", "08326607b4eb3627" ),
- array( "c\0", "08326507b4eb3474" ),
- array( "d\0", "08326407b4eb32c1" ),
- array( "e\0", "08326307b4eb310e" ),
- array( "f\0", "08326207b4eb2f5b" ),
- array( "fo\0", "d8cbc7186ba1355c" ),
- array( "foo\0", "0378817ee2ed65a9" ),
- array( "foob\0", "d329d59b9963f7f1" ),
- array( "fooba\0", "340d8765a4dda9b0" ),
- array( "foobar\0", "50a6d3b724a774a6" ),
- array( "ch", "08326507b4eb341c" ),
- array( "cho", "d8d5c8186ba98bfb" ),
- array( "chon", "1ccefc7ef118dbef" ),
- array( "chong", "0c92fab3ad3db77a" ),
- array( "chongo", "9b77794f5fdec421" ),
- array( "chongo ", "0ac742dfe7874433" ),
- array( "chongo w", "d7dad5766ad8e2de" ),
- array( "chongo wa", "a1bb96378e897f5b" ),
- array( "chongo was", "5b3f9b6733a367d2" ),
- array( "chongo was ", "b07ce25cbea969f6" ),
- array( "chongo was h", "8d9e9997f9df0d6a" ),
- array( "chongo was he", "838c673d9603cb7b" ),
- array( "chongo was her", "8b5ee8a5e872c273" ),
- array( "chongo was here", "4507c4e9fb00690c" ),
- array( "chongo was here!", "4c9ca59581b27f45" ),
- array( "chongo was here!\n", "e0aca20b624e4235" ),
- array( "ch\0", "d8d5c8186ba98b94" ),
- array( "cho\0", "1ccefc7ef118db81" ),
- array( "chon\0", "0c92fab3ad3db71d" ),
- array( "chong\0", "9b77794f5fdec44e" ),
- array( "chongo\0", "0ac742dfe7874413" ),
- array( "chongo \0", "d7dad5766ad8e2a9" ),
- array( "chongo w\0", "a1bb96378e897f3a" ),
- array( "chongo wa\0", "5b3f9b6733a367a1" ),
- array( "chongo was\0", "b07ce25cbea969d6" ),
- array( "chongo was \0", "8d9e9997f9df0d02" ),
- array( "chongo was h\0", "838c673d9603cb1e" ),
- array( "chongo was he\0", "8b5ee8a5e872c201" ),
- array( "chongo was her\0", "4507c4e9fb006969" ),
- array( "chongo was here\0", "4c9ca59581b27f64" ),
- array( "chongo was here!\0", "e0aca20b624e423f" ),
- array( "chongo was here!\n\0", "13998e580afa800f" ),
- array( "cu", "08326507b4eb3401" ),
- array( "cur", "d8d5ad186ba95dc1" ),
- array( "curd", "1c72e17ef0ca4e97" ),
- array( "curds", "2183c1b327c38ae6" ),
- array( "curds ", "b66d096c914504f2" ),
- array( "curds a", "404bf57ad8476757" ),
- array( "curds an", "887976bd815498bb" ),
- array( "curds and", "3afd7f02c2bf85a5" ),
- array( "curds and ", "fc4476b0eb70177f" ),
- array( "curds and w", "186d2da00f77ecba" ),
- array( "curds and wh", "f97140fa48c74066" ),
- array( "curds and whe", "a2b1cf49aa926d37" ),
- array( "curds and whey", "0690712cd6cf940c" ),
- array( "curds and whey\n", "f7045b3102b8906e" ),
- array( "cu\0", "d8d5ad186ba95db3" ),
- array( "cur\0", "1c72e17ef0ca4ef3" ),
- array( "curd\0", "2183c1b327c38a95" ),
- array( "curds\0", "b66d096c914504d2" ),
- array( "curds \0", "404bf57ad8476736" ),
- array( "curds a\0", "887976bd815498d5" ),
- array( "curds an\0", "3afd7f02c2bf85c1" ),
- array( "curds and\0", "fc4476b0eb70175f" ),
- array( "curds and \0", "186d2da00f77eccd" ),
- array( "curds and w\0", "f97140fa48c7400e" ),
- array( "curds and wh\0", "a2b1cf49aa926d52" ),
- array( "curds and whe\0", "0690712cd6cf9475" ),
- array( "curds and whey\0", "f7045b3102b89064" ),
- array( "curds and whey\n\0", "74f762479f9d6aea" ),
- array( "line 1\nline 2\nline 3", "a64e5f36c9e2b0e3" ),
- array( "chongo <Landon Curt Noll> /\\../\\", "8fd0680da3088a04" ),
- array( "chongo <Landon Curt Noll> /\\../\\\0", "67aad32c078284cc" ),
- array( "chongo (Landon Curt Noll) /\\../\\", "b37d55d81c57b331" ),
- array( "chongo (Landon Curt Noll) /\\../\\\0", "55ac0f3829057c43" ),
- array( "http://antwrp.gsfc.nasa.gov/apod/astropix.html", "cb27f4b8e1b6cc20" ),
- array( "http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash", "26caf88bcbef2d19" ),
- array( "http://epod.usra.edu/", "8e6e063b97e61b8f" ),
- array( "http://exoplanet.eu/", "b42750f7f3b7c37e" ),
- array( "http://hvo.wr.usgs.gov/cam3/", "f3c6ba64cf7ca99b" ),
- array( "http://hvo.wr.usgs.gov/cams/HMcam/", "ebfb69b427ea80fe" ),
- array( "http://hvo.wr.usgs.gov/kilauea/update/deformation.html", "39b50c3ed970f46c" ),
- array( "http://hvo.wr.usgs.gov/kilauea/update/images.html", "5b9b177aa3eb3e8a" ),
- array( "http://hvo.wr.usgs.gov/kilauea/update/maps.html", "6510063ecf4ec903" ),
- array( "http://hvo.wr.usgs.gov/volcanowatch/current_issue.html", "2b3bbd2c00797c7a" ),
- array( "http://neo.jpl.nasa.gov/risk/", "f1d6204ff5cb4aa7" ),
- array( "http://norvig.com/21-days.html", "4836e27ccf099f38" ),
- array( "http://primes.utm.edu/curios/home.php", "82efbb0dd073b44d" ),
- array( "http://slashdot.org/", "4a80c282ffd7d4c6" ),
- array( "http://tux.wr.usgs.gov/Maps/155.25-19.5.html", "305d1a9c9ee43bdf" ),
- array( "http://volcano.wr.usgs.gov/kilaueastatus.php", "15c366948ffc6997" ),
- array( "http://www.avo.alaska.edu/activity/Redoubt.php", "80153ae218916e7b" ),
- array( "http://www.dilbert.com/fast/", "fa23e2bdf9e2a9e1" ),
- array( "http://www.fourmilab.ch/gravitation/orbits/", "d47e8d8a2333c6de" ),
- array( "http://www.fpoa.net/", "7e128095f688b056" ),
- array( "http://www.ioccc.org/index.html", "2f5356890efcedab" ),
- array( "http://www.isthe.com/cgi-bin/number.cgi", "95c2b383014f55c5" ),
- array( "http://www.isthe.com/chongo/bio.html", "4727a5339ce6070f" ),
- array( "http://www.isthe.com/chongo/index.html", "b0555ecd575108e9" ),
- array( "http://www.isthe.com/chongo/src/calc/lucas-calc", "48d785770bb4af37" ),
- array( "http://www.isthe.com/chongo/tech/astro/venus2004.html", "09d4701c12af02b1" ),
- array( "http://www.isthe.com/chongo/tech/astro/vita.html", "79f031e78f3cf62e" ),
- array( "http://www.isthe.com/chongo/tech/comp/c/expert.html", "52a1ee85db1b5a94" ),
- array( "http://www.isthe.com/chongo/tech/comp/calc/index.html", "6bd95b2eb37fa6b8" ),
- array( "http://www.isthe.com/chongo/tech/comp/fnv/index.html", "74971b7077aef85d" ),
- array( "http://www.isthe.com/chongo/tech/math/number/howhigh.html", "b4e4fae2ffcc1aad" ),
- array( "http://www.isthe.com/chongo/tech/math/number/number.html", "2bd48bd898b8f63a" ),
- array( "http://www.isthe.com/chongo/tech/math/prime/mersenne.html", "e9966ac1556257f6" ),
- array( "http://www.isthe.com/chongo/tech/math/prime/mersenne.html#largest", "92a3d1cd078ba293" ),
- array( "http://www.lavarnd.org/cgi-bin/corpspeak.cgi", "f81175a482e20ab8" ),
- array( "http://www.lavarnd.org/cgi-bin/haiku.cgi", "5bbb3de722e73048" ),
- array( "http://www.lavarnd.org/cgi-bin/rand-none.cgi", "6b4f363492b9f2be" ),
- array( "http://www.lavarnd.org/cgi-bin/randdist.cgi", "c2d559df73d59875" ),
- array( "http://www.lavarnd.org/index.html", "f75f62284bc7a8c2" ),
- array( "http://www.lavarnd.org/what/nist-test.html", "da8dd8e116a9f1cc" ),
- array( "http://www.macosxhints.com/", "bdc1e6ab76057885" ),
- array( "http://www.mellis.com/", "fec6a4238a1224a0" ),
- array( "http://www.nature.nps.gov/air/webcams/parks/havoso2alert/havoalert.cfm", "c03f40f3223e290e" ),
- array( "http://www.nature.nps.gov/air/webcams/parks/havoso2alert/timelines_24.cfm", "1ed21673466ffda9" ),
- array( "http://www.paulnoll.com/", "df70f906bb0dd2af" ),
- array( "http://www.pepysdiary.com/", "f3dcda369f2af666" ),
- array( "http://www.sciencenews.org/index/home/activity/view", "9ebb11573cdcebde" ),
- array( "http://www.skyandtelescope.com/", "81c72d9077fedca0" ),
- array( "http://www.sput.nl/~rob/sirius.html", "0ec074a31be5fb15" ),
- array( "http://www.systemexperts.com/", "2a8b3280b6c48f20" ),
- array( "http://www.tq-international.com/phpBB3/index.php", "fd31777513309344" ),
- array( "http://www.travelquesttours.com/index.htm", "194534a86ad006b6" ),
- array( "http://www.wunderground.com/global/stations/89606.html", "3be6fdf46e0cfe12" ),
- array( R10("21701"), "017cc137a07eb057" ),
- array( R10("M21701"), "9428fc6e7d26b54d" ),
- array( R10("2^21701-1"), "9aaa2e3603ef8ad7" ),
- array( R10("\x54\xc5"), "82c6d3f3a0ccdf7d" ),
- array( R10("\xc5\x54"), "c86eeea00cf09b65" ),
- array( R10("23209"), "705f8189dbb58299" ),
- array( R10("M23209"), "415a7f554391ca69" ),
- array( R10("2^23209-1"), "cfe3d49fa2bdc555" ),
- array( R10("\x5a\xa9"), "f0f9c56039b25191" ),
- array( R10("\xa9\x5a"), "7075cb6abd1d32d9" ),
- array( R10("391581216093"), "43c94e2c8b277509" ),
- array( R10("391581*2^216093-1"), "3cbfd4e4ea670359" ),
- array( R10("\x05\xf9\x9d\x03\x4c\x81"), "c05887810f4d019d" ),
- array( R10("FEDCBA9876543210"), "14468ff93ac22dc5" ),
- array( R10("\xfe\xdc\xba\x98\x76\x54\x32\x10"), "ebed699589d99c05" ),
- array( R10("EFCDAB8967452301"), "6d99f6df321ca5d5" ),
- array( R10("\xef\xcd\xab\x89\x67\x45\x23\x01"), "0cd410d08c36d625" ),
- array( R10("0123456789ABCDEF"), "ef1b2a2c86831d35" ),
- array( R10("\x01\x23\x45\x67\x89\xab\xcd\xef"), "3b349c4d69ee5f05" ),
- array( R10("1032547698BADCFE"), "55248ce88f45f035" ),
- array( R10("\x10\x32\x54\x76\x98\xba\xdc\xfe"), "aa69ca6a18a4c885" ),
- array( R500("\x00"), "1fe3fce62bd816b5" ),
- array( R500("\x07"), "0289a488a8df69d9" ),
- array( R500("~"), "15e96e1613df98b5" ),
- array( R500("\x7f"), "e6be57375ad89b99" ),
+ array( "", "cbf29ce484222325" ),
+ array( "a", "af63bd4c8601b7be" ),
+ array( "b", "af63bd4c8601b7bd" ),
+ array( "c", "af63bd4c8601b7bc" ),
+ array( "d", "af63bd4c8601b7bb" ),
+ array( "e", "af63bd4c8601b7ba" ),
+ array( "f", "af63bd4c8601b7b9" ),
+ array( "fo", "08326207b4eb2f34" ),
+ array( "foo", "d8cbc7186ba13533" ),
+ array( "foob", "0378817ee2ed65cb" ),
+ array( "fooba", "d329d59b9963f790" ),
+ array( "foobar", "340d8765a4dda9c2" ),
+ array( "\0", "af63bd4c8601b7df" ),
+ array( "a\0", "08326707b4eb37da" ),
+ array( "b\0", "08326607b4eb3627" ),
+ array( "c\0", "08326507b4eb3474" ),
+ array( "d\0", "08326407b4eb32c1" ),
+ array( "e\0", "08326307b4eb310e" ),
+ array( "f\0", "08326207b4eb2f5b" ),
+ array( "fo\0", "d8cbc7186ba1355c" ),
+ array( "foo\0", "0378817ee2ed65a9" ),
+ array( "foob\0", "d329d59b9963f7f1" ),
+ array( "fooba\0", "340d8765a4dda9b0" ),
+ array( "foobar\0", "50a6d3b724a774a6" ),
+ array( "ch", "08326507b4eb341c" ),
+ array( "cho", "d8d5c8186ba98bfb" ),
+ array( "chon", "1ccefc7ef118dbef" ),
+ array( "chong", "0c92fab3ad3db77a" ),
+ array( "chongo", "9b77794f5fdec421" ),
+ array( "chongo ", "0ac742dfe7874433" ),
+ array( "chongo w", "d7dad5766ad8e2de" ),
+ array( "chongo wa", "a1bb96378e897f5b" ),
+ array( "chongo was", "5b3f9b6733a367d2" ),
+ array( "chongo was ", "b07ce25cbea969f6" ),
+ array( "chongo was h", "8d9e9997f9df0d6a" ),
+ array( "chongo was he", "838c673d9603cb7b" ),
+ array( "chongo was her", "8b5ee8a5e872c273" ),
+ array( "chongo was here", "4507c4e9fb00690c" ),
+ array( "chongo was here!", "4c9ca59581b27f45" ),
+ array( "chongo was here!\n", "e0aca20b624e4235" ),
+ array( "ch\0", "d8d5c8186ba98b94" ),
+ array( "cho\0", "1ccefc7ef118db81" ),
+ array( "chon\0", "0c92fab3ad3db71d" ),
+ array( "chong\0", "9b77794f5fdec44e" ),
+ array( "chongo\0", "0ac742dfe7874413" ),
+ array( "chongo \0", "d7dad5766ad8e2a9" ),
+ array( "chongo w\0", "a1bb96378e897f3a" ),
+ array( "chongo wa\0", "5b3f9b6733a367a1" ),
+ array( "chongo was\0", "b07ce25cbea969d6" ),
+ array( "chongo was \0", "8d9e9997f9df0d02" ),
+ array( "chongo was h\0", "838c673d9603cb1e" ),
+ array( "chongo was he\0", "8b5ee8a5e872c201" ),
+ array( "chongo was her\0", "4507c4e9fb006969" ),
+ array( "chongo was here\0", "4c9ca59581b27f64" ),
+ array( "chongo was here!\0", "e0aca20b624e423f" ),
+ array( "chongo was here!\n\0", "13998e580afa800f" ),
+ array( "cu", "08326507b4eb3401" ),
+ array( "cur", "d8d5ad186ba95dc1" ),
+ array( "curd", "1c72e17ef0ca4e97" ),
+ array( "curds", "2183c1b327c38ae6" ),
+ array( "curds ", "b66d096c914504f2" ),
+ array( "curds a", "404bf57ad8476757" ),
+ array( "curds an", "887976bd815498bb" ),
+ array( "curds and", "3afd7f02c2bf85a5" ),
+ array( "curds and ", "fc4476b0eb70177f" ),
+ array( "curds and w", "186d2da00f77ecba" ),
+ array( "curds and wh", "f97140fa48c74066" ),
+ array( "curds and whe", "a2b1cf49aa926d37" ),
+ array( "curds and whey", "0690712cd6cf940c" ),
+ array( "curds and whey\n", "f7045b3102b8906e" ),
+ array( "cu\0", "d8d5ad186ba95db3" ),
+ array( "cur\0", "1c72e17ef0ca4ef3" ),
+ array( "curd\0", "2183c1b327c38a95" ),
+ array( "curds\0", "b66d096c914504d2" ),
+ array( "curds \0", "404bf57ad8476736" ),
+ array( "curds a\0", "887976bd815498d5" ),
+ array( "curds an\0", "3afd7f02c2bf85c1" ),
+ array( "curds and\0", "fc4476b0eb70175f" ),
+ array( "curds and \0", "186d2da00f77eccd" ),
+ array( "curds and w\0", "f97140fa48c7400e" ),
+ array( "curds and wh\0", "a2b1cf49aa926d52" ),
+ array( "curds and whe\0", "0690712cd6cf9475" ),
+ array( "curds and whey\0", "f7045b3102b89064" ),
+ array( "curds and whey\n\0", "74f762479f9d6aea" ),
+ array( "line 1\nline 2\nline 3", "a64e5f36c9e2b0e3" ),
+ array( "chongo <Landon Curt Noll> /\\../\\", "8fd0680da3088a04" ),
+ array( "chongo <Landon Curt Noll> /\\../\\\0", "67aad32c078284cc" ),
+ array( "chongo (Landon Curt Noll) /\\../\\", "b37d55d81c57b331" ),
+ array( "chongo (Landon Curt Noll) /\\../\\\0", "55ac0f3829057c43" ),
+ array( "http://antwrp.gsfc.nasa.gov/apod/astropix.html", "cb27f4b8e1b6cc20" ),
+ array( "http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash", "26caf88bcbef2d19" ),
+ array( "http://epod.usra.edu/", "8e6e063b97e61b8f" ),
+ array( "http://exoplanet.eu/", "b42750f7f3b7c37e" ),
+ array( "http://hvo.wr.usgs.gov/cam3/", "f3c6ba64cf7ca99b" ),
+ array( "http://hvo.wr.usgs.gov/cams/HMcam/", "ebfb69b427ea80fe" ),
+ array( "http://hvo.wr.usgs.gov/kilauea/update/deformation.html", "39b50c3ed970f46c" ),
+ array( "http://hvo.wr.usgs.gov/kilauea/update/images.html", "5b9b177aa3eb3e8a" ),
+ array( "http://hvo.wr.usgs.gov/kilauea/update/maps.html", "6510063ecf4ec903" ),
+ array( "http://hvo.wr.usgs.gov/volcanowatch/current_issue.html", "2b3bbd2c00797c7a" ),
+ array( "http://neo.jpl.nasa.gov/risk/", "f1d6204ff5cb4aa7" ),
+ array( "http://norvig.com/21-days.html", "4836e27ccf099f38" ),
+ array( "http://primes.utm.edu/curios/home.php", "82efbb0dd073b44d" ),
+ array( "http://slashdot.org/", "4a80c282ffd7d4c6" ),
+ array( "http://tux.wr.usgs.gov/Maps/155.25-19.5.html", "305d1a9c9ee43bdf" ),
+ array( "http://volcano.wr.usgs.gov/kilaueastatus.php", "15c366948ffc6997" ),
+ array( "http://www.avo.alaska.edu/activity/Redoubt.php", "80153ae218916e7b" ),
+ array( "http://www.dilbert.com/fast/", "fa23e2bdf9e2a9e1" ),
+ array( "http://www.fourmilab.ch/gravitation/orbits/", "d47e8d8a2333c6de" ),
+ array( "http://www.fpoa.net/", "7e128095f688b056" ),
+ array( "http://www.ioccc.org/index.html", "2f5356890efcedab" ),
+ array( "http://www.isthe.com/cgi-bin/number.cgi", "95c2b383014f55c5" ),
+ array( "http://www.isthe.com/chongo/bio.html", "4727a5339ce6070f" ),
+ array( "http://www.isthe.com/chongo/index.html", "b0555ecd575108e9" ),
+ array( "http://www.isthe.com/chongo/src/calc/lucas-calc", "48d785770bb4af37" ),
+ array( "http://www.isthe.com/chongo/tech/astro/venus2004.html", "09d4701c12af02b1" ),
+ array( "http://www.isthe.com/chongo/tech/astro/vita.html", "79f031e78f3cf62e" ),
+ array( "http://www.isthe.com/chongo/tech/comp/c/expert.html", "52a1ee85db1b5a94" ),
+ array( "http://www.isthe.com/chongo/tech/comp/calc/index.html", "6bd95b2eb37fa6b8" ),
+ array( "http://www.isthe.com/chongo/tech/comp/fnv/index.html", "74971b7077aef85d" ),
+ array( "http://www.isthe.com/chongo/tech/math/number/howhigh.html", "b4e4fae2ffcc1aad" ),
+ array( "http://www.isthe.com/chongo/tech/math/number/number.html", "2bd48bd898b8f63a" ),
+ array( "http://www.isthe.com/chongo/tech/math/prime/mersenne.html", "e9966ac1556257f6" ),
+ array( "http://www.isthe.com/chongo/tech/math/prime/mersenne.html#largest", "92a3d1cd078ba293" ),
+ array( "http://www.lavarnd.org/cgi-bin/corpspeak.cgi", "f81175a482e20ab8" ),
+ array( "http://www.lavarnd.org/cgi-bin/haiku.cgi", "5bbb3de722e73048" ),
+ array( "http://www.lavarnd.org/cgi-bin/rand-none.cgi", "6b4f363492b9f2be" ),
+ array( "http://www.lavarnd.org/cgi-bin/randdist.cgi", "c2d559df73d59875" ),
+ array( "http://www.lavarnd.org/index.html", "f75f62284bc7a8c2" ),
+ array( "http://www.lavarnd.org/what/nist-test.html", "da8dd8e116a9f1cc" ),
+ array( "http://www.macosxhints.com/", "bdc1e6ab76057885" ),
+ array( "http://www.mellis.com/", "fec6a4238a1224a0" ),
+ array( "http://www.nature.nps.gov/air/webcams/parks/havoso2alert/havoalert.cfm", "c03f40f3223e290e" ),
+ array( "http://www.nature.nps.gov/air/webcams/parks/havoso2alert/timelines_24.cfm", "1ed21673466ffda9" ),
+ array( "http://www.paulnoll.com/", "df70f906bb0dd2af" ),
+ array( "http://www.pepysdiary.com/", "f3dcda369f2af666" ),
+ array( "http://www.sciencenews.org/index/home/activity/view", "9ebb11573cdcebde" ),
+ array( "http://www.skyandtelescope.com/", "81c72d9077fedca0" ),
+ array( "http://www.sput.nl/~rob/sirius.html", "0ec074a31be5fb15" ),
+ array( "http://www.systemexperts.com/", "2a8b3280b6c48f20" ),
+ array( "http://www.tq-international.com/phpBB3/index.php", "fd31777513309344" ),
+ array( "http://www.travelquesttours.com/index.htm", "194534a86ad006b6" ),
+ array( "http://www.wunderground.com/global/stations/89606.html", "3be6fdf46e0cfe12" ),
+ array( R10("21701"), "017cc137a07eb057" ),
+ array( R10("M21701"), "9428fc6e7d26b54d" ),
+ array( R10("2^21701-1"), "9aaa2e3603ef8ad7" ),
+ array( R10("\x54\xc5"), "82c6d3f3a0ccdf7d" ),
+ array( R10("\xc5\x54"), "c86eeea00cf09b65" ),
+ array( R10("23209"), "705f8189dbb58299" ),
+ array( R10("M23209"), "415a7f554391ca69" ),
+ array( R10("2^23209-1"), "cfe3d49fa2bdc555" ),
+ array( R10("\x5a\xa9"), "f0f9c56039b25191" ),
+ array( R10("\xa9\x5a"), "7075cb6abd1d32d9" ),
+ array( R10("391581216093"), "43c94e2c8b277509" ),
+ array( R10("391581*2^216093-1"), "3cbfd4e4ea670359" ),
+ array( R10("\x05\xf9\x9d\x03\x4c\x81"), "c05887810f4d019d" ),
+ array( R10("FEDCBA9876543210"), "14468ff93ac22dc5" ),
+ array( R10("\xfe\xdc\xba\x98\x76\x54\x32\x10"), "ebed699589d99c05" ),
+ array( R10("EFCDAB8967452301"), "6d99f6df321ca5d5" ),
+ array( R10("\xef\xcd\xab\x89\x67\x45\x23\x01"), "0cd410d08c36d625" ),
+ array( R10("0123456789ABCDEF"), "ef1b2a2c86831d35" ),
+ array( R10("\x01\x23\x45\x67\x89\xab\xcd\xef"), "3b349c4d69ee5f05" ),
+ array( R10("1032547698BADCFE"), "55248ce88f45f035" ),
+ array( R10("\x10\x32\x54\x76\x98\xba\xdc\xfe"), "aa69ca6a18a4c885" ),
+ array( R500("\x00"), "1fe3fce62bd816b5" ),
+ array( R500("\x07"), "0289a488a8df69d9" ),
+ array( R500("~"), "15e96e1613df98b5" ),
+ array( R500("\x7f"), "e6be57375ad89b99" ),
);
$i = 0;
$pass = true;
foreach($tests as $test) {
- $result = hash('fnv164', $test[0]);
- if ($result != $test[1]) {
- echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n";
+ $result = hash('fnv164', $test[0]);
+ if ($result != $test[1]) {
+ echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n";
$pass = false;
- }
- $i++;
+ }
+ $i++;
}
if($pass) {
diff --git a/ext/hash/tests/fnv1a32.phpt b/ext/hash/tests/fnv1a32.phpt
index d2e01f7998..af12a2de37 100644
--- a/ext/hash/tests/fnv1a32.phpt
+++ b/ext/hash/tests/fnv1a32.phpt
@@ -4,321 +4,321 @@ Hash: FNV1a32 algorithm
<?php
$tests = array(
- array( 'l', 'e90c310b' ),
- array( 'b', 'e70c2de5' ),
- array( 'a', 'e40c292c' ),
- array( 'd', 'e10c2473' ),
- array( 'Z', 'df0c214d' ),
- array( '0K', '66eddeec' ),
- array( 'cp', '47297986' ),
- array( 'UY', '6bf399cb' ),
- array( 'RS', '6e04e612' ),
- array( '+`', '47dc64fe' ),
- array( 'Q: ', '1c02a1d6' ),
- array( ' Mu', 'c5c8a3f9' ),
- array( 'jS0', '1819afae' ),
- array( 'cRZ', 'd9f699ae' ),
- array( ' "]', 'ee32d84e' ),
- array( 'Bo@$', '1544a53a' ),
- array( 'U{5"', '08f0b60a' ),
- array( '`&W;', '300ba78d' ),
- array( 'Y+F;', '12d960fe' ),
- array( '\\a<]', '7596c231' ),
- array( '/2HcC', '4ee26872' ),
- array( '-7}-:', '5e0b1ab7' ),
- array( '[O*|T', 'c259a137' ),
- array( '_yib[', '6cc9d49b' ),
- array( 'p:vKE', 'becd7e8f' ),
- array( '>g# $a', 'ae428052' ),
- array( '07*tZ8', 'ed8d23f4' ),
- array( ',YEF5u', 'faf2b057' ),
- array( 'Q3K2.6', '44f076e4' ),
- array( 'ti(0aT', '29d6e513' ),
- array( 'U <Y!A;', 'ebcefc16' ),
- array( '2XF\'4^3', '11bad723' ),
- array( 'm%Z${-8', '2ef77eeb' ),
- array( 'G@F^60g', 'a0044fc5' ),
- array( 'Fq<|rYV', '00fb2e21' ),
- array( 't{r\'U9.i', '0d526094' ),
- array( 'xBX}}]y,', '58e08903' ),
- array( 'uBL<"bMi', '6b4adbd4' ),
- array( '*@\'\'3a^)', 'e9588a44' ),
- array( ']Q03k?|d', '5a837058' ),
- array( 'aVb`4]l* ', '8e9bed4b' ),
- array( '9G#|tl\'6s', '7301283c' ),
- array( '/JUmS4@cG', 'd708df29' ),
- array( '-$Eqf{UG1', '406526e0' ),
- array( '44<5Nd8LZ', '56f2092a' ),
- array( '&Tpyc;PRnd', 'e1b9c4be' ),
- array( 'sS-!WRs>OJ', '9fee418c' ),
- array( 'fa^z}tJc-v', '42d4d075' ),
- array( '>3K/./J_b9', 'd9e15b05' ),
- array( 'EVmRXE&LdV', '1ccbc7ba' ),
- array( 'wK9WG7LqzYi', 'fc482f42' ),
- array( '9m5I|Es\\(."', '43fc2be7' ),
- array( '^{U8B\\d(4\\T', 'af371347' ),
- array( 'M4{eana<X{*', '0073ed9f' ),
- array( 'mE\'39d<Gg{D', '7755ffb9' ),
- array( '=4fzyn/WC\\l@', '3085c332' ),
- array( 'BN0$jh uWE}k', 'c95b95dc' ),
- array( '_b((J$Lh94c3', 'c7f99999' ),
- array( '$rjGPWhr&xwq', '0b9873cd' ),
- array( 'bxg;?e(~H0\'s', 'cee0652d' ),
- array( '5T\\OhAbl4M5e&', '21278985' ),
- array( '~Y-xQ~[JfwiL ', '97dae25b' ),
- array( 'iu1qiGFGv/hZ|', '045498c1' ),
- array( '})2c/1=<*o;f;', 'ce6b0a18' ),
- array( '"_&O_oEqa09(W', '31218352' ),
- array( '18@k5>tG"$Y@@d', 'e67f32fc' ),
- array( '1\\LL_,R/kCU]%e', '563251e6' ),
- array( 'w.=)F]t\\|i% n^', '10a0ae81' ),
- array( 'A0DRlp~L|Q\\it2', '2f5d78ca' ),
- array( 'Gzw@)6IPt?-q*3', '228eab51' ),
- array( 'rxq4*6fw(eE%8"n', '843e8340' ),
- array( '.57).W3D"d9Ar,K', '9cc1aba3' ),
- array( '&~Ex3O0yH8_m=xo', 'c1a72c91' ),
- array( '-\'&D14{EX}*r@}~', 'f0b627fc' ),
- array( 'k$}2}1b.,+Flyde', '2255bec4' ),
- array( 'iqmp6~%3D]2OPRNO', '95cb7153' ),
- array( '?RNRQ`5_lA\'Y;k@&', '98f1390e' ),
- array( '^.vu.{)SZ<#+nQ[/', '2f89dc6c' ),
- array( '%+aVkw7Y9>3U+T\\j', '15c1ec76' ),
- array( 'bS`pPjD+\'H7vzs\'!', 'b732fff0' ),
- array( '~hWkaoE{.YQ:..%qb', 'a53c7189' ),
- array( 'eb3Q(?XQWPLKWMKA&', '3bf2f0e8' ),
- array( '7#u]~%7Q?E_D7C+zW', 'f5038551' ),
- array( '\\$w5UOf#{>PH_W`cN', 'c3b89ba6' ),
- array( '>bSU4rzt839C.p 2h', '00cf8218' ),
- array( '5h9|k6;=^{t?`C]Cv4', '855c27e9' ),
- array( 'Xj0N#CgFRYFeC\\N]Z;', 'caae0fcf' ),
- array( 'suXRrNrTrPwjeQUu!Y', 'e2ac5b6c' ),
- array( ':i lDGSg%#E_>:VwlJ', '0648058a' ),
- array( 'F_~91w$vIZmK4(55tY', '11c2fffb' ),
- array( '\\HBbLhBj#ybpD*PCCb;', 'b32cc782' ),
- array( 'HZe#H27PGLF"*oEl<.0', '86a137c7' ),
- array( '\'1*j"NtSr87/aqtd;\'|', 'f40113e8' ),
- array( 'kOI3RT#wB?&RF8]2;,\'', '0096ffab' ),
- array( 'n @\'/"y$g5,d"\\/5/c9', '8b7ec669' ),
- array( '\'&X.Y F72aD:QDZYS]SX', '26b51c68' ),
- array( 'Eid*lB9#Q}<Y%tg_u/v(', '9ff0e9b3' ),
- array( 'p<BC`}|5[Qm!;S,(uE,H', '50d88cac' ),
- array( 'DH"J>i*4y"<j>_/ ],59', '9354bdac' ),
- array( '^#:yWG#Mm/u2Xx\\vcg+]', '4debf08a' ),
- array( 'iHI)(X)ee> DB;?zbCIPS', '312f5ce8' ),
- array( '@c,9A$|)/[sX%|`]&GDEG', '8793f867' ),
- array( 'ihc)cFL-w!M[-g|1d\'A@z', '57a03ef9' ),
- array( 'yFw[%~#IDK3.0=qVj OkN', 'a435237b' ),
- array( '+x6)+{0M=+Hc$$h#(3HTF', 'f7f3fb17' ),
- array( 'VdcI<OIk;xv5/!A+1nI<7-', 'c0276bde' ),
- array( '@<vDD*lxQC^6mze8g!1_6@', '2a8386fd' ),
- array( '`WLqGu/^$Oz{s@&a:W&xms', 'c5454bef' ),
- array( 'tS,\\U==l^}E+pl" L\'PG#E', '7163befc' ),
- array( 'h)\'#a-|P"q%.OZLmG+kl7\\', '262417f4' ),
- array( 'Z9]\'@.ODT8N[<0i9ak,fz\\B', '30233bfa' ),
- array( 'GJjR6Xis3$R:Eaii6#9q?I\\', 'b1d4e934' ),
- array( 'Y+IerDB5kl ?$X*xk/L\'T.q', '20d3742c' ),
- array( '?DtX75#sn/=U"ax7Nf8nkpx', '61619334' ),
- array( 'd])1d]?W}dLW{b[oRj.)lo"', '366d01d0' ),
- array( '%?h=.T/(:m1LRol*nQWGM;#>', '6ec48f20' ),
- array( 'mmLv[=ya\\b k8/tS|\' Pwl[f', '9fb5d98f' ),
- array( '?4/lO2,>!X5]u/?Sr@@,O5_M', 'b476c549' ),
- array( '=_~5M[|lo,Z?>f]@?s}6$>iw', '621bbc86' ),
- array( '^+$/@c]^C\\sp9p^)|9I<!(\\A', '3ea36c5d' ),
- array( '{[W!yBxXM|hm`FL$$Au=2UF0o', '0f54780f' ),
- array( 'pMpx*2tfjv`-o:Zl#IMIuRN8I', 'c19ab462' ),
- array( 'kK 3[o$)a|4trz_i\\lZvGGzpu', '1cd34af1' ),
- array( 'DgHr r_Krr(cw2EuF:iByS~f.', '0d60d437' ),
- array( 'v/Vq L7gu+hhj5\\^=@WPfMw"7', '9d0ca535' ),
- array( ':{k:cz2sQ$s~<\\tGF^3[<ry]JJ', '92579a4a' ),
- array( 'DwCF0^C|y(w,{J1pJMM?ut~)Q<', 'ed50fb22' ),
- array( '|KyGv>@;eQy)Ns1F -q1}<_L\\U', 'c5960f99' ),
- array( 'B\\_sx\\@r%71FRvwM!FA3lA@_S?', '51be9eb7' ),
- array( '{4lXj05K$.)D".\\3T0+L]-r @`', 'e8525ded' ),
- array( 'Aa@u"=+nvu -A$;JI>X&R.7^[uk', '0510b06f' ),
- array( 'Nu,08nQ.pn9`e0`rQd/{.MU5 cL', '43c2c9c8' ),
- array( '^?BKn8X~QGP_8@yx&*Zy[@)XOV.', '39874c53' ),
- array( 'dWr273Ub"n;"@bS!{szuz&Ptbp~', 'c81fe453' ),
- array( '<@VJ&.>8ERn)U]DW~(, $!{y|"K', 'dc0d68d2' ),
- array( 'qe<p"]GMcVk||>k&sJKLITYIYZET', '90be4d50' ),
- array( 'WH J.=;0zc]_;J\\8hI?]sk+=@dfy', '5e1e1340' ),
- array( '?-OwUOBcm^tiCRI^}\'wfP7ED#PaC', 'f03345c0' ),
- array( '5I>UWmM->pq,Pgus:?S9FK!wbF<e', '94060b65' ),
- array( 'w~*-IHc!72/U$!bThYH$x|=@H>9+', '547a6b68' ),
- array( 'eUq]U{k~EP!]b04f2v;{Qd!Ka?l+^', 'e777322d' ),
- array( '&6D[)#2&n1L?2*#C?iU7&RhkS4Nr!', '4a78ebdf' ),
- array( 'YR\'ovcyyu i\'L*:W-^vw5.}gvj<+9', 'f83d06fa' ),
- array( '0-rb4cZw]Um^?u+J1bWpZO&hNn`:,', '7f314445' ),
- array( 'lS<yG /+Z(i0vHPmTz~8Rpr#w\\Rf>', '831a8450' ),
- array( 'lr+A0&h05sk=^{4\'M#\\H"t{sh kESS', '0c39d6ad' ),
- array( 'cAFobWuKh,@TJ Q_(~bdHeYEYCEEhx', '12b2879c' ),
- array( 'xM;@=}x4JaAk7kkhLsh/Y2t4WOW}uA', '81c3b55c' ),
- array( 'von21-1*B[lcH$P4m|)V-bi#wARO?I', '0d5d6b27' ),
- array( 'p79`JKn[V18Cu`GGu5D lQbVTZx(+8', '0fd3c926' ),
- array( 'Q{Pk]z7LWn^o2UQZ|HpAH]s,5If/QrG', '0f36a996' ),
- array( '$oxoMs(zLvY=*/nd,8UN`4ClJlTY>G"', '80b38386' ),
- array( 'C7z4do<_<4:Y?JI$WaZ\'BoJ0;7dtV,w', '9874d3b3' ),
- array( 'yDr.*cKj `%Z P$%(f`/*PY:kq~aH,Y', 'ab5089b4' ),
- array( 'BQMQ[1|F1]Lk]|pc&WD5buo|ab|D+*}', '5d600f5e' ),
- array( 'N[K 7\\|^n[+[9(L}.%BDg85ezwc?$m>R', '1966e89b' ),
- array( 'JjRaGPA7,LrFU?EcEg).!?t{7X<;F[mp', '908106a1' ),
- array( 'FASnrt& BxGw9l\\_TemV%bR=<oXbKGTr', '824f8688' ),
- array( 'i)a\\~g]Aa%9{qu[G\\J}b.Q JBY.m"c`k', '195cad65' ),
- array( 'lCIk,\'.m-Gj >GH{qF^!x_L;9Z*;?k(,', '36f68af8' ),
- array( '/Qx;Y\'*gOtgn<0j/WI1Q)]lC9w_Xcges:', '885fad78' ),
- array( '^0tf:\\60E%MVp].:n_DMMgfEH?*0%}Kd.', '7f86cff2' ),
- array( '@LI}cZCi)yZg)tVi:%8#k^K,h\\2g(vvIC', '3dd2e16e' ),
- array( '@G\'{jp&eLmoBEY\\Jq_6Q,B:hT#pLy:p;a', '03b92168' ),
- array( 'x8Mj>47,$YQ^6{Qv2##U>l+A]W<xIW[Bo', '7b4dcec0' ),
- array( '*-.>D:C~l"6hS-{W1Qu}]8\\6TU_,2#|<0+', 'b86f1510' ),
- array( '[UF~U3"k|Vyx.+K$*)<f@p= }O#zl4\'HjM', '93a09a8c' ),
- array( 'H@aJ,^!&W02$4<-Q#MCANApR=]fD\'RqPrT', '2d094101' ),
- array( '{~3|&k.8oCU}tXL9y{[kNxJ6=Rh0#[e~[x', '72d5e000' ),
- array( '|ae+zUNPTD*!]%|:pL3<bQnKbr(HqcBnF(', 'f4f08743' ),
- array( 'zA]Jr3n|4M"2gs^{0AM m0ruYeZ{U!$PCbz', 'ef1f608e' ),
- array( '6uj4+87=!,{|=>J=,[1#6v]2L^7}#yx:pdN', '800e955f' ),
- array( '{}f:~r7{0UGNa$_e:WCM$#d"&_{AQ`pN^Wh', 'fa87c111' ),
- array( '^K [\\U$+8)k~CCBqGEWJL7Fnh(_7g7!Fc!"', 'f0d49ddf' ),
- array( '@W\'Kp08oT[3F$Y}N\'6uu ~U8fm9-Q;0qs8>', 'bbc8b16a' ),
- array( 'eHVU|2iD7CCfJY]@Y\\vqCd,Q6Gb);zG!D}WB', 'b4c1dc4c' ),
- array( '1BfIe+01dmR?JI2n.>@Ef#N#~u%Dt\\f\' NPe', '7c98ca04' ),
- array( 'Y`w?NJ_ysqh#1)Hw-w{-m!Qc^9j^g;EB{=bK', '79ccb205' ),
- array( 'gBF\\5/_F9)?G!;Un=\'S{A>[)Y!LV>/#\'QIcg', 'ba719e14' ),
- array( 'YC.rLN;Mjp=(xp%:0`DjbpB! E(Rol:I0I=]', 'ce2a6b64' ),
- array( 'xY,cJIlC;r]KT"77sY9t~BGo/b:@-X}&2*j\\T', '87e2ae2a' ),
- array( 'X!pK_=!bT8V.RL.ts}$W8DdqCk$NVa$0ct\\C2', '380f7299' ),
- array( ']\'gv^uI+%> #CW<h=.,)3[`t_pXTM|g,$O#cF', 'eeb01e49' ),
- array( 'LnKkoO/Hkwez%o.`Q$@C\\upZ]}_.!CTM3!:#P', '9f74a4c3' ),
- array( 'IK=B29G"G(SKIv)?hc}gC,hga7zbQ~4zKR>]k', '4b7036db' ),
- array( 'e`4n5`9-iXvNV^rcGZE_V)1U>-!pL_]2@q"UR;', '2ef7953e' ),
- array( 'b=sYlK9_/`;TAr^SH|aJm.+K@K>C"p^d/S?{~X', '58f87a0f' ),
- array( '\\/:wc\\jC04@q_. jZA7xd9jD}zw>vwwS\'3Lko8', '924bf023' ),
- array( '/ MOr.^rx9503yI~>Hy7gp/_E6rr#c,2cYbWhA', 'd2c773bf' ),
- array( 'Ja[`ro[=nzeh2MZB.!Y"t\\e!oJ[R"DtM\'P.yAi', '59761485' ),
- array( '70d}ywLU:ZVs]LQCMAn*sqOh@V:NQ[9il~hgw5=', '1616e5d5' ),
- array( '2pt\'NAXroybznTJXt"rDTO^>=^(%V=Bi/8q^ZJR', '2b93c8c6' ),
- array( 'JE5E5jpm_r`%G1cfNBnSy-vd=0V{j!N5Gc[\\NMJ', '22863e0e' ),
- array( '/@,4h=xPl<@@7N8{kHRg3T7I{z&YJS%Zt2o^Oi/', 'ce54d2ce' ),
- array( '<&O]=~v9j?lRSAi}>e%w1X}lN0\\-`G=}Mm[klS&', '925e90a6' ),
- array( 'Wsr+G4tFS[KLm%JZTZ8a<_ :.mvyZJ!3>s>f)3-]', 'b47ebcb9' ),
- array( 'oY*]^T830PuL1uf?d^9?);RG0q.9&<vuu"STVlhg', '76d4ed18' ),
- array( '>_5OV|n;[)ZdE.-U <n\'Xf|NhQ$@?m)]M>.$;}?w', '2fb33679' ),
- array( '(z]M*j#+\'r2_Z0/Da3e!"n_O.mTJltBto CzkF&r', '569492ba' ),
- array( ':9SuIb:+v!-xplI~[}JHrm>cna^Z)eND~":IeUT]', 'b9cb09fa' ),
- array( 'WbVHP!H- rVratWPW7+a}Y&|\\AFBw{!O_Ww0YA>Y5', '26b7c332' ),
- array( 'tMvi&HB=S$;.+9jL`.D]/t=gmNB/l{EbI<MOdom9t', '7de5c876' ),
- array( '*G C3L$BqbRf ;UO]d=Z+ %GMU-=CF2Mn3q#`vFRY', '627567d3' ),
- array( 'y:Z6o*sUHO`HT)u*74N]G|MZnQ;exn@r*z*z&}QNN', 'b1579567' ),
- array( '3v#<m.S#]2KZ`\'J3C1,2Q =M*8S)i"W|y[:hinlH"', '948a6c9e' ),
- array( '9#b@Nvc`$v3$4`/L4977q42MO{8>i`@#d$C4z\'t~~(', 'fa5a6693' ),
- array( '$3h4_}Mw6?-Im\\E&z/g<2M@Va<^W<]_@pITQH#J^BW', '5db013f4' ),
- array( '(14N80^ LqNmH0+\'hGeIhWr>*<AT{d,$u@S.Q2/~$]', '57cd1795' ),
- array( 'mMnxUWA;!*stH}2iR.O_3E!fTRycQ}B?K18"iZ=kd1', '08722fa3' ),
- array( '`.0sxb"HC6nD}Cvw\'HvJgC[!EE[c1AtrO&fIiiq- `', 'c89edaa7' ),
- array( 'Q~%Hv-qmWZ23\\WY9;kZ1^+8FT"1G/2)`1.*)<{vsW*(', '702aaaa4' ),
- array( '4aaM}M(0-4HTiJe1Zw;<*JF3fC+Zz5c/wE]vsf("zQV', '197ef095' ),
- array( 'd|=vW63s@];SD^_ Ztcjm*He~/m!+?Xp<vgs-{hMY$"', '1ed13f33' ),
- array( '}cb~>Xb)FmR,laznl:H^V?FKLC4z|9}{|`z<:^F`Lxm', 'c04f1349' ),
- array( ':[h*I#R(ZrO\'?r<;oU:lS{ho6G6vt0e/kN:6Rl>._m5', '48c23cac' ),
- array( ' aQ<R(V?[R(LhPb`EsGU`vovJ]5X>$n?eA[9I3X&faRP', 'a53ac530' ),
- array( '262W+Y.kP}b{[wTz|D:bev{0*U7p7iBJ!T#,.1w_/Z[k', '05d91499' ),
- array( 'S1gPU"4<x1M$gdu N8JPlM]{^U[n18[eIC7 FL<@^iDF', '12db23fd' ),
- array( 'N:G}SqO@@-< cxnt1K[[or[6@wV~b{F17m0j__,!mI!Q', '2b2e3dde' ),
- array( 'BpGT<#0-vkC7dz6Gv\\Y.Kjx+K&-9O.jq 2G<6WJ-DmE*', 'f4c74b67' ),
- array( 'h\\R_:-newhqCn~]>-I1.[XKr1u!UcF`M#3-=@|#9et]Tt', 'bd458351' ),
- array( ';r#d$1A]\\4nR6E6\\&d_:q}Zn"tUwR*lm}oS#!u`^+P1Au', 'f8e9f1d5' ),
- array( 'H}|-^7 ]ro_gEW;PD*N5]Q7S3u^c\' YP~W^^n^<bO{KuS', '8e947b43' ),
- array( 'fFxpu.OGE$[;c?CdytcQSCA2_$b[PX08~)*t8Y=]^yyB9', 'a34f6609' ),
- array( '>(33lef0\'yo,\\L]6\\u6e ,}ZI\\9CW\\]udq)QWpb_jRlH~', 'e9d8fa86' ),
- array( 'J^[@tB@!A{K~5oVqNLW@V*xGlY3@F[@q;|21?S3aO_`eP8', '104537ea' ),
- array( 'X~e0@<;:d)swI;Ti-pg@"(s6iDuK*GcbFIsgf/"K9vCb2x', '7c5f8020' ),
- array( 'M?i5_l=T#(xyT$A9fhb[QJkSu%K:h]46}}L^kj3os-iH1,', 'ab2ee1ee' ),
- array( 'axuETGoA{fFG"0&6G$4sb!_upS#[{5h^.^$c\'t%#[LK]\\Q', '8520630b' ),
- array( 't$U)x8*X/{,3W)H@hW m;\'bA+?mV}K(rP^|Iw("\'$/;\\9d', '5ec32f02' ),
- array( '|"<|oX%Sz0rifq5oeeNb0Fk2NpBiM[OK^lINFN#A^u+FhA7', 'b5b5f4e5' ),
- array( 'N(e18-}K[nmF<Jvg)c1X*`[L@RWg;y~i"e{:rzeOiTv&~mn', '14562c12' ),
- array( ')R!b\\a?)"qai.[ix]OuxCp^rZ4ja3XP=+R h4?r72T"@1k9', '01b11a54' ),
- array( 'n</g_!GS[[>=own-#B.lVM_n`5p!F];5zJ}ZLF.("MFrE6!', '8f9e0173' ),
- array( 'IX/60]v~>,p@RO[hJ\'f%S.4[1a#$\'9%Qr5g#r_#1ktQ>D.(', 'f4e44d2d' ),
- array( 'n5oth}*E/kH4sb:FVO.ZBn]TZR\'yv5"fJq\\4ofZ S#4HfNn>', '51b1ae3d' ),
- array( '}}xAlVvH*}B"4Eh_7Fs(.N(aR=+:lyXkxQ.f)%/3#R57w~v/', '0d3e9950' ),
- array( 'Ek7S;@6m^A)L<a864G|=L,QP^fgVf_f,L~`g?vV~9_KVBdlW', '8c43dabf' ),
- array( '-itYuG*U/r-uSs# rch3[?2t ^KBD8yQ#o,y86OG*\\=]QA^D', '4d86d9cd' ),
- array( '%GXafjWgJ$*o=%B@uN:.ejUoGsMy5,>;Tv|<bT$.X.~u4A7*', '38b099cc' ),
- array( 'pQ9V<oFdct^y"}5Vu3rYhvgB&g8;)PFy"_Q?Ow%3md.pbDHYW', '859042fe' ),
- array( ';3A3{c:c|UmM{gP\\:o,3t@!ZNq=s:vKV+lj\'P&kM[Y{XBL6\\<', '88b478a3' ),
- array( 'Bo2cql2d+& #RW/@B6qH#@%\\<^ ht]&8N9{@\'/%36%6h\\F* \\', '4b1d0513' ),
- array( '{I`<N>Y.>C$|J<Kc8kkHq~^w6GT\\RU:N~{kN:E\\YiaV4}"x7n', 'f1ce1247' ),
- array( 'e_`d>Y{f/Y9dsgdpT3+zpddR<yP?rh.XHo>fI;NXtg>iP#Z%6', '3e4eb24d' ),
- array( 'e \'KeZg_,\'St6-=\'K%QfS+\\;IFkL!qcgrk3XF{9R$lG;yeBFjs', '69476a97' ),
- array( '.? j[I2Hv4:Z{-F0fm, A0mhLhOn0:c>Zc*6.=^%Qy`M(\']nuj', '9097fe8e' ),
- array( 'n7{]!HFP7Vk{uF`!]n>=to7U>?]{.Sg}kc\\l,#>DZ*@QQ"R/qq', 'cbee4ea9' ),
- array( 'Mfbd<!$z}3Oe2;In(UrFyMQ; $=R40Eav(F4)K/(^^mpz8`#mS', 'f19251c8' ),
- array( 'Jh!|%"!CT6SzwK#?_-jo5JO#<J<|N*PysRwyTy=*0q%(=)G}63', '8f27bdfb' ),
- array( 'nK]?Oyikv9vH4k{,eQ&$[6va>5jf3"y#NWB~R-kJGcr[Oog6Am;', '9cb72621' ),
- array( '}%3`DHK+\\N&_|^#|10h[WLO4|?{4ajP_pc@5-lAi<GJ:\'M78^!t', 'e0686fbc' ),
- array( '7NEKLdHaG32($vI:$7[nS$9n+f&DF(9]V^*#DRdlfwtko>&tUbc', 'e4bd2dd7' ),
- array( '*f|xrd 8,(Qi^1sbVGHC.@9y1W &.cj9Kh2>M2VZ:)Dy;9\\r`%6', '5efb3af6' ),
- array( 'oFOiW(j^7NIPy2b9`uo;1y`+6zh)\\n@L5p6mx!L0OvaJ)Dci;T&', '05e74ead' ),
- array( 'LNfXdaAn>0/jF "5y#b+SYl}b2bMM7Sze:SK|u:<&J(MJ*bD.EOb', '17cbb538' ),
- array( ' <abND0|\\dwC Kn|A*:HTCv NZD] t@!1#c`Ht]%YVHY"8WDBrlw', '4eca862a' ),
- array( '6dwd?=B@2cADf%&0zd5U;]/=ugb9[P2q5*WTHzt[_6!G<\'W8klm\'', '296c9ed7' ),
- array( 'J}EAe)ZBYl4nwlDAh9|HP}om&H&q5sy`q@#XI]z$K0rD}7efQc0#', 'bc868018' ),
- array( 'a!pgIwZ^lU@^uC8@"3DND8rCPY*#=:\' <xhepDE]ye=p*U1,iVZ/', '09251477' ),
- array( 'oNRA(\\DFwKF4D/z6S@sN\'1?1gQ=R)xaxG4:Pq_vj+= PMzf";[QCm', 'e8f565aa' ),
- array( 'pTUCr(LkiF4~`eq@\\\\Lz\\|IXdLt@}8.nld2_l_LW&aWfHI(&&U!cS', '40202a4d' ),
- array( 'K<8w2YvJhe8Mxx;YFs_)KGQtPW{&Y`Z%}r}0Mt[6[scUm~/4rn=?7', '9d3dfab7' ),
- array( 'o5gG1n!rI\'p=&!jz]!VRe-@d<TX,rwCb-,+?z-2D4$a;&M6cNm65z', '092e633d' ),
- array( 'Vy8,SD LhcZtnyo|-421vM8Dc{sR3)Ni$fvX,w%t[_iKZYHhnZzf(', 'db49c4e2' ),
- array( '3,l/ @B*n-/U%gb|lWYMA&){Orj+mQ4!]!1^BTi1bxgh`JfN"@|DG&', '0c69cbb2' ),
- array( '@vx+"g]7i<9z{[Pel4^U|? cn#%kGLqgDksGSR^=ow9kSjQA~0v{Pv', '8aafa096' ),
- array( '_?zd,B2~+Vj ~?S]]CVv/+aaL`qD]C<=c7#oZ5oelZflz:KX^"Pn.3', '2da2dfea' ),
- array( 'PZtC Rf<oKSs</),uvf\\cbw/<W2lF@ v{u:{H"88Ml-i{6ur.]OqAH', '6aa6fe03' ),
- array( '"] 4JFTK>PAXMi[e#*S0sPGjCUIsHk=JI=^td4A#eb\\3M8yQBMb7~+', '50438792' ),
- array( '#CaM8*9UUbs5XXIy[/]8B+P=]sjA+jL./.\\G9u|oYp%2JO,&_i?"up?', '5a10e446' ),
- array( 'Td+upvB~&Q\\NkRL[->`?h1Lop7/s- 4ad@XU7zU>M2l9e9trWV3Ag_1', 'b41de8a2' ),
- array( 'Xw@L&@ah&"A\\9<3WjEE$,_y 8P3Y9sjrk,@rM"[S$|1>:Du%j<*v{$v', '3d1d96c3' ),
- array( '4T+nn~Yake"^4$;g)8xGR>>X)Zb Wfwk<#Z+#5mo{oO0tjx}#rEV1c/', '021cf019' ),
- array( ':?r;vZ3cv7?#:Tq+QaZaWE[UHN{ ``0{ #7v]KZUbyX}OJ)!-ccd*?;', 'a52533a0' ),
- array( 'Sn8SOxcLxfcpE0KzsFTqu~{w-`[rj{/>jGr;@Vg:>L+c]W_Q}4Dt4@lA', 'eacea244' ),
- array( '"I5lED,1k~M-V6GtcRYA*9s)N8}bYk%[6;I\\_UnLU<Z,R""7U\\X_vMiE', '8dc7eb87' ),
- array( 'eg)?T/{kKEH+{7XRT3^(6a?k>xK6F6\\-~eLSuI@AnhMk!\'>V:}_P_~<~', '7481744d' ),
- array( 'xh5@~qM}XzRODrq4\\? ^F>6a<u3|uO{n9209%]8^Yk.}_ 3=@3{gR2In', '4da520dc' ),
- array( ')\\l~-hmG{}`"\\y`7eo6FpIc1\\_x/rC~{ k{.UjURi7TF16]w&s>w>"*z', 'c6ec7195' ),
- array( 'b#+VG+SGvOUM:, $CTKUj*Nq~mi=os9SwD+?O_gG0>tJKtOnJ{E6&s(&a', '6976d3a8' ),
- array( 'rCRg\\\'`"2!Qriy#(nNTd~C/ziE"]N(@AKr))zj+.k]!UW$^FR3,QW;MA`', '57543a3a' ),
- array( 'O /X@Q%4[.0F:>2w?hPDGvwZ$J3?wT!HT0!ub&+>4;dOZwGy`w?)o7dsa', '5e4ad807' ),
- array( 'w4ZM5##F%x)+%G@A-o{%8vf06p!NUu1N*k{?o~etxn }7A?D1;JI32ZI#', 'c01f194b' ),
- array( '\\wXR)(]u$|e#cZ|SZzj{;/.WZXjl45op-ID7Q"-U rYcMV7)R#&n35Fmm', '4e92f8a5' ),
- array( '2Z"GJsUt8lF;z|;mV <.8F`;MPNbw<Q*vTRBH)7au]|q[9_29|ARC#mpS<', 'cf4d6b34' ),
- array( 'TKY&VQZ)t$2,e)jczF|[Y7Xzi|~WnRtC~OIU"%_v)r#n{nRw6PTph.lR+k', '7a8a94c5' ),
- array( '+y?!>>PgsSmSJvFNfC=:<TjqES 3\',~2\'>4E\\e.Q9{&crL2YpPs.%_ K4 ', '11032641' ),
- array( '_;-^N4}bZ[Hh-ae3EX`X3R)(`/h`[|a;9nzg$xK^UsHcV.w{gXUz,^$lnm', '9298d67e' ),
- array( 'MKj/f%~bl#\\9b2-+vc:n`"H6}Tu#Aepo1\\ xa~[O#8hfKvrBZ-2</ZS.0I', '0654c0b0' ),
- array( '1Q/"BA^B:ABvpE0Y-[Q ~--1I=l|L|G]OW`qy?44`V,R|<-*w^*wk8)5Vu3', '2f477f17' ),
- array( '#r[aB4B5.bIBD Nv}j$(cb3[OLee$\\x\'PUhsi,)wnR;3Si*QU/Z:rmvB;\\(', 'cf7e00ca' ),
- array( '?9"GiW1^B=g:,:U@n@J@vZ{1Mi(o&exE zljS~Iu<11ILgi;(5\\~oX1=C:.', '2b97bb55' ),
- array( 'I \'n #\\jW[4NxF_BrH-.PBjP2CaPf|_1|f!}j^iC:}q4DRW7zdFL\'1|:U_k', '8923a6db' ),
- array( '=\\KNZ2OY}/CAIA3^ff6~azF.#W,>.l*LIU{%gL^f["(&D<d,${,evRtz+"9', 'aa215ef1' ),
- array( '9nCe9xb>a/}Ij QpEnUQrQ]YI0OE<Q^U@#<Y|~x^.v(xvZj=J@n=rMw<^Gaz', '87741385' ),
- array( 'xAQ:DnsBnl"}c*w[ebx1#hNu7G3unuqh7D#\\3w~"d" I,w&rZ $^iSU!{hwj', 'cccba4fc' ),
- array( '_jTw/XTBPTE5VF_c?eWzf\\YP1/Q-xJxY5MQD&\'gV\\-l4TMxs4Pnz.HL?X}LR', '5d4564df' ),
- array( 'HF,^s]#zdjRBx@VMnOA# 0~/YKN3J{esBrR7QV36BeY;\'0iu_+y`<yovF>*q', '3bec6d86' ),
- array( ':pe]c9t5o(L2n&Nv68lvDgW`bGX)fbz"Sa_8zTNk]z}L"LC8e10*ygk\\0Dfv', 'fef9aa77' ),
+ array( 'l', 'e90c310b' ),
+ array( 'b', 'e70c2de5' ),
+ array( 'a', 'e40c292c' ),
+ array( 'd', 'e10c2473' ),
+ array( 'Z', 'df0c214d' ),
+ array( '0K', '66eddeec' ),
+ array( 'cp', '47297986' ),
+ array( 'UY', '6bf399cb' ),
+ array( 'RS', '6e04e612' ),
+ array( '+`', '47dc64fe' ),
+ array( 'Q: ', '1c02a1d6' ),
+ array( ' Mu', 'c5c8a3f9' ),
+ array( 'jS0', '1819afae' ),
+ array( 'cRZ', 'd9f699ae' ),
+ array( ' "]', 'ee32d84e' ),
+ array( 'Bo@$', '1544a53a' ),
+ array( 'U{5"', '08f0b60a' ),
+ array( '`&W;', '300ba78d' ),
+ array( 'Y+F;', '12d960fe' ),
+ array( '\\a<]', '7596c231' ),
+ array( '/2HcC', '4ee26872' ),
+ array( '-7}-:', '5e0b1ab7' ),
+ array( '[O*|T', 'c259a137' ),
+ array( '_yib[', '6cc9d49b' ),
+ array( 'p:vKE', 'becd7e8f' ),
+ array( '>g# $a', 'ae428052' ),
+ array( '07*tZ8', 'ed8d23f4' ),
+ array( ',YEF5u', 'faf2b057' ),
+ array( 'Q3K2.6', '44f076e4' ),
+ array( 'ti(0aT', '29d6e513' ),
+ array( 'U <Y!A;', 'ebcefc16' ),
+ array( '2XF\'4^3', '11bad723' ),
+ array( 'm%Z${-8', '2ef77eeb' ),
+ array( 'G@F^60g', 'a0044fc5' ),
+ array( 'Fq<|rYV', '00fb2e21' ),
+ array( 't{r\'U9.i', '0d526094' ),
+ array( 'xBX}}]y,', '58e08903' ),
+ array( 'uBL<"bMi', '6b4adbd4' ),
+ array( '*@\'\'3a^)', 'e9588a44' ),
+ array( ']Q03k?|d', '5a837058' ),
+ array( 'aVb`4]l* ', '8e9bed4b' ),
+ array( '9G#|tl\'6s', '7301283c' ),
+ array( '/JUmS4@cG', 'd708df29' ),
+ array( '-$Eqf{UG1', '406526e0' ),
+ array( '44<5Nd8LZ', '56f2092a' ),
+ array( '&Tpyc;PRnd', 'e1b9c4be' ),
+ array( 'sS-!WRs>OJ', '9fee418c' ),
+ array( 'fa^z}tJc-v', '42d4d075' ),
+ array( '>3K/./J_b9', 'd9e15b05' ),
+ array( 'EVmRXE&LdV', '1ccbc7ba' ),
+ array( 'wK9WG7LqzYi', 'fc482f42' ),
+ array( '9m5I|Es\\(."', '43fc2be7' ),
+ array( '^{U8B\\d(4\\T', 'af371347' ),
+ array( 'M4{eana<X{*', '0073ed9f' ),
+ array( 'mE\'39d<Gg{D', '7755ffb9' ),
+ array( '=4fzyn/WC\\l@', '3085c332' ),
+ array( 'BN0$jh uWE}k', 'c95b95dc' ),
+ array( '_b((J$Lh94c3', 'c7f99999' ),
+ array( '$rjGPWhr&xwq', '0b9873cd' ),
+ array( 'bxg;?e(~H0\'s', 'cee0652d' ),
+ array( '5T\\OhAbl4M5e&', '21278985' ),
+ array( '~Y-xQ~[JfwiL ', '97dae25b' ),
+ array( 'iu1qiGFGv/hZ|', '045498c1' ),
+ array( '})2c/1=<*o;f;', 'ce6b0a18' ),
+ array( '"_&O_oEqa09(W', '31218352' ),
+ array( '18@k5>tG"$Y@@d', 'e67f32fc' ),
+ array( '1\\LL_,R/kCU]%e', '563251e6' ),
+ array( 'w.=)F]t\\|i% n^', '10a0ae81' ),
+ array( 'A0DRlp~L|Q\\it2', '2f5d78ca' ),
+ array( 'Gzw@)6IPt?-q*3', '228eab51' ),
+ array( 'rxq4*6fw(eE%8"n', '843e8340' ),
+ array( '.57).W3D"d9Ar,K', '9cc1aba3' ),
+ array( '&~Ex3O0yH8_m=xo', 'c1a72c91' ),
+ array( '-\'&D14{EX}*r@}~', 'f0b627fc' ),
+ array( 'k$}2}1b.,+Flyde', '2255bec4' ),
+ array( 'iqmp6~%3D]2OPRNO', '95cb7153' ),
+ array( '?RNRQ`5_lA\'Y;k@&', '98f1390e' ),
+ array( '^.vu.{)SZ<#+nQ[/', '2f89dc6c' ),
+ array( '%+aVkw7Y9>3U+T\\j', '15c1ec76' ),
+ array( 'bS`pPjD+\'H7vzs\'!', 'b732fff0' ),
+ array( '~hWkaoE{.YQ:..%qb', 'a53c7189' ),
+ array( 'eb3Q(?XQWPLKWMKA&', '3bf2f0e8' ),
+ array( '7#u]~%7Q?E_D7C+zW', 'f5038551' ),
+ array( '\\$w5UOf#{>PH_W`cN', 'c3b89ba6' ),
+ array( '>bSU4rzt839C.p 2h', '00cf8218' ),
+ array( '5h9|k6;=^{t?`C]Cv4', '855c27e9' ),
+ array( 'Xj0N#CgFRYFeC\\N]Z;', 'caae0fcf' ),
+ array( 'suXRrNrTrPwjeQUu!Y', 'e2ac5b6c' ),
+ array( ':i lDGSg%#E_>:VwlJ', '0648058a' ),
+ array( 'F_~91w$vIZmK4(55tY', '11c2fffb' ),
+ array( '\\HBbLhBj#ybpD*PCCb;', 'b32cc782' ),
+ array( 'HZe#H27PGLF"*oEl<.0', '86a137c7' ),
+ array( '\'1*j"NtSr87/aqtd;\'|', 'f40113e8' ),
+ array( 'kOI3RT#wB?&RF8]2;,\'', '0096ffab' ),
+ array( 'n @\'/"y$g5,d"\\/5/c9', '8b7ec669' ),
+ array( '\'&X.Y F72aD:QDZYS]SX', '26b51c68' ),
+ array( 'Eid*lB9#Q}<Y%tg_u/v(', '9ff0e9b3' ),
+ array( 'p<BC`}|5[Qm!;S,(uE,H', '50d88cac' ),
+ array( 'DH"J>i*4y"<j>_/ ],59', '9354bdac' ),
+ array( '^#:yWG#Mm/u2Xx\\vcg+]', '4debf08a' ),
+ array( 'iHI)(X)ee> DB;?zbCIPS', '312f5ce8' ),
+ array( '@c,9A$|)/[sX%|`]&GDEG', '8793f867' ),
+ array( 'ihc)cFL-w!M[-g|1d\'A@z', '57a03ef9' ),
+ array( 'yFw[%~#IDK3.0=qVj OkN', 'a435237b' ),
+ array( '+x6)+{0M=+Hc$$h#(3HTF', 'f7f3fb17' ),
+ array( 'VdcI<OIk;xv5/!A+1nI<7-', 'c0276bde' ),
+ array( '@<vDD*lxQC^6mze8g!1_6@', '2a8386fd' ),
+ array( '`WLqGu/^$Oz{s@&a:W&xms', 'c5454bef' ),
+ array( 'tS,\\U==l^}E+pl" L\'PG#E', '7163befc' ),
+ array( 'h)\'#a-|P"q%.OZLmG+kl7\\', '262417f4' ),
+ array( 'Z9]\'@.ODT8N[<0i9ak,fz\\B', '30233bfa' ),
+ array( 'GJjR6Xis3$R:Eaii6#9q?I\\', 'b1d4e934' ),
+ array( 'Y+IerDB5kl ?$X*xk/L\'T.q', '20d3742c' ),
+ array( '?DtX75#sn/=U"ax7Nf8nkpx', '61619334' ),
+ array( 'd])1d]?W}dLW{b[oRj.)lo"', '366d01d0' ),
+ array( '%?h=.T/(:m1LRol*nQWGM;#>', '6ec48f20' ),
+ array( 'mmLv[=ya\\b k8/tS|\' Pwl[f', '9fb5d98f' ),
+ array( '?4/lO2,>!X5]u/?Sr@@,O5_M', 'b476c549' ),
+ array( '=_~5M[|lo,Z?>f]@?s}6$>iw', '621bbc86' ),
+ array( '^+$/@c]^C\\sp9p^)|9I<!(\\A', '3ea36c5d' ),
+ array( '{[W!yBxXM|hm`FL$$Au=2UF0o', '0f54780f' ),
+ array( 'pMpx*2tfjv`-o:Zl#IMIuRN8I', 'c19ab462' ),
+ array( 'kK 3[o$)a|4trz_i\\lZvGGzpu', '1cd34af1' ),
+ array( 'DgHr r_Krr(cw2EuF:iByS~f.', '0d60d437' ),
+ array( 'v/Vq L7gu+hhj5\\^=@WPfMw"7', '9d0ca535' ),
+ array( ':{k:cz2sQ$s~<\\tGF^3[<ry]JJ', '92579a4a' ),
+ array( 'DwCF0^C|y(w,{J1pJMM?ut~)Q<', 'ed50fb22' ),
+ array( '|KyGv>@;eQy)Ns1F -q1}<_L\\U', 'c5960f99' ),
+ array( 'B\\_sx\\@r%71FRvwM!FA3lA@_S?', '51be9eb7' ),
+ array( '{4lXj05K$.)D".\\3T0+L]-r @`', 'e8525ded' ),
+ array( 'Aa@u"=+nvu -A$;JI>X&R.7^[uk', '0510b06f' ),
+ array( 'Nu,08nQ.pn9`e0`rQd/{.MU5 cL', '43c2c9c8' ),
+ array( '^?BKn8X~QGP_8@yx&*Zy[@)XOV.', '39874c53' ),
+ array( 'dWr273Ub"n;"@bS!{szuz&Ptbp~', 'c81fe453' ),
+ array( '<@VJ&.>8ERn)U]DW~(, $!{y|"K', 'dc0d68d2' ),
+ array( 'qe<p"]GMcVk||>k&sJKLITYIYZET', '90be4d50' ),
+ array( 'WH J.=;0zc]_;J\\8hI?]sk+=@dfy', '5e1e1340' ),
+ array( '?-OwUOBcm^tiCRI^}\'wfP7ED#PaC', 'f03345c0' ),
+ array( '5I>UWmM->pq,Pgus:?S9FK!wbF<e', '94060b65' ),
+ array( 'w~*-IHc!72/U$!bThYH$x|=@H>9+', '547a6b68' ),
+ array( 'eUq]U{k~EP!]b04f2v;{Qd!Ka?l+^', 'e777322d' ),
+ array( '&6D[)#2&n1L?2*#C?iU7&RhkS4Nr!', '4a78ebdf' ),
+ array( 'YR\'ovcyyu i\'L*:W-^vw5.}gvj<+9', 'f83d06fa' ),
+ array( '0-rb4cZw]Um^?u+J1bWpZO&hNn`:,', '7f314445' ),
+ array( 'lS<yG /+Z(i0vHPmTz~8Rpr#w\\Rf>', '831a8450' ),
+ array( 'lr+A0&h05sk=^{4\'M#\\H"t{sh kESS', '0c39d6ad' ),
+ array( 'cAFobWuKh,@TJ Q_(~bdHeYEYCEEhx', '12b2879c' ),
+ array( 'xM;@=}x4JaAk7kkhLsh/Y2t4WOW}uA', '81c3b55c' ),
+ array( 'von21-1*B[lcH$P4m|)V-bi#wARO?I', '0d5d6b27' ),
+ array( 'p79`JKn[V18Cu`GGu5D lQbVTZx(+8', '0fd3c926' ),
+ array( 'Q{Pk]z7LWn^o2UQZ|HpAH]s,5If/QrG', '0f36a996' ),
+ array( '$oxoMs(zLvY=*/nd,8UN`4ClJlTY>G"', '80b38386' ),
+ array( 'C7z4do<_<4:Y?JI$WaZ\'BoJ0;7dtV,w', '9874d3b3' ),
+ array( 'yDr.*cKj `%Z P$%(f`/*PY:kq~aH,Y', 'ab5089b4' ),
+ array( 'BQMQ[1|F1]Lk]|pc&WD5buo|ab|D+*}', '5d600f5e' ),
+ array( 'N[K 7\\|^n[+[9(L}.%BDg85ezwc?$m>R', '1966e89b' ),
+ array( 'JjRaGPA7,LrFU?EcEg).!?t{7X<;F[mp', '908106a1' ),
+ array( 'FASnrt& BxGw9l\\_TemV%bR=<oXbKGTr', '824f8688' ),
+ array( 'i)a\\~g]Aa%9{qu[G\\J}b.Q JBY.m"c`k', '195cad65' ),
+ array( 'lCIk,\'.m-Gj >GH{qF^!x_L;9Z*;?k(,', '36f68af8' ),
+ array( '/Qx;Y\'*gOtgn<0j/WI1Q)]lC9w_Xcges:', '885fad78' ),
+ array( '^0tf:\\60E%MVp].:n_DMMgfEH?*0%}Kd.', '7f86cff2' ),
+ array( '@LI}cZCi)yZg)tVi:%8#k^K,h\\2g(vvIC', '3dd2e16e' ),
+ array( '@G\'{jp&eLmoBEY\\Jq_6Q,B:hT#pLy:p;a', '03b92168' ),
+ array( 'x8Mj>47,$YQ^6{Qv2##U>l+A]W<xIW[Bo', '7b4dcec0' ),
+ array( '*-.>D:C~l"6hS-{W1Qu}]8\\6TU_,2#|<0+', 'b86f1510' ),
+ array( '[UF~U3"k|Vyx.+K$*)<f@p= }O#zl4\'HjM', '93a09a8c' ),
+ array( 'H@aJ,^!&W02$4<-Q#MCANApR=]fD\'RqPrT', '2d094101' ),
+ array( '{~3|&k.8oCU}tXL9y{[kNxJ6=Rh0#[e~[x', '72d5e000' ),
+ array( '|ae+zUNPTD*!]%|:pL3<bQnKbr(HqcBnF(', 'f4f08743' ),
+ array( 'zA]Jr3n|4M"2gs^{0AM m0ruYeZ{U!$PCbz', 'ef1f608e' ),
+ array( '6uj4+87=!,{|=>J=,[1#6v]2L^7}#yx:pdN', '800e955f' ),
+ array( '{}f:~r7{0UGNa$_e:WCM$#d"&_{AQ`pN^Wh', 'fa87c111' ),
+ array( '^K [\\U$+8)k~CCBqGEWJL7Fnh(_7g7!Fc!"', 'f0d49ddf' ),
+ array( '@W\'Kp08oT[3F$Y}N\'6uu ~U8fm9-Q;0qs8>', 'bbc8b16a' ),
+ array( 'eHVU|2iD7CCfJY]@Y\\vqCd,Q6Gb);zG!D}WB', 'b4c1dc4c' ),
+ array( '1BfIe+01dmR?JI2n.>@Ef#N#~u%Dt\\f\' NPe', '7c98ca04' ),
+ array( 'Y`w?NJ_ysqh#1)Hw-w{-m!Qc^9j^g;EB{=bK', '79ccb205' ),
+ array( 'gBF\\5/_F9)?G!;Un=\'S{A>[)Y!LV>/#\'QIcg', 'ba719e14' ),
+ array( 'YC.rLN;Mjp=(xp%:0`DjbpB! E(Rol:I0I=]', 'ce2a6b64' ),
+ array( 'xY,cJIlC;r]KT"77sY9t~BGo/b:@-X}&2*j\\T', '87e2ae2a' ),
+ array( 'X!pK_=!bT8V.RL.ts}$W8DdqCk$NVa$0ct\\C2', '380f7299' ),
+ array( ']\'gv^uI+%> #CW<h=.,)3[`t_pXTM|g,$O#cF', 'eeb01e49' ),
+ array( 'LnKkoO/Hkwez%o.`Q$@C\\upZ]}_.!CTM3!:#P', '9f74a4c3' ),
+ array( 'IK=B29G"G(SKIv)?hc}gC,hga7zbQ~4zKR>]k', '4b7036db' ),
+ array( 'e`4n5`9-iXvNV^rcGZE_V)1U>-!pL_]2@q"UR;', '2ef7953e' ),
+ array( 'b=sYlK9_/`;TAr^SH|aJm.+K@K>C"p^d/S?{~X', '58f87a0f' ),
+ array( '\\/:wc\\jC04@q_. jZA7xd9jD}zw>vwwS\'3Lko8', '924bf023' ),
+ array( '/ MOr.^rx9503yI~>Hy7gp/_E6rr#c,2cYbWhA', 'd2c773bf' ),
+ array( 'Ja[`ro[=nzeh2MZB.!Y"t\\e!oJ[R"DtM\'P.yAi', '59761485' ),
+ array( '70d}ywLU:ZVs]LQCMAn*sqOh@V:NQ[9il~hgw5=', '1616e5d5' ),
+ array( '2pt\'NAXroybznTJXt"rDTO^>=^(%V=Bi/8q^ZJR', '2b93c8c6' ),
+ array( 'JE5E5jpm_r`%G1cfNBnSy-vd=0V{j!N5Gc[\\NMJ', '22863e0e' ),
+ array( '/@,4h=xPl<@@7N8{kHRg3T7I{z&YJS%Zt2o^Oi/', 'ce54d2ce' ),
+ array( '<&O]=~v9j?lRSAi}>e%w1X}lN0\\-`G=}Mm[klS&', '925e90a6' ),
+ array( 'Wsr+G4tFS[KLm%JZTZ8a<_ :.mvyZJ!3>s>f)3-]', 'b47ebcb9' ),
+ array( 'oY*]^T830PuL1uf?d^9?);RG0q.9&<vuu"STVlhg', '76d4ed18' ),
+ array( '>_5OV|n;[)ZdE.-U <n\'Xf|NhQ$@?m)]M>.$;}?w', '2fb33679' ),
+ array( '(z]M*j#+\'r2_Z0/Da3e!"n_O.mTJltBto CzkF&r', '569492ba' ),
+ array( ':9SuIb:+v!-xplI~[}JHrm>cna^Z)eND~":IeUT]', 'b9cb09fa' ),
+ array( 'WbVHP!H- rVratWPW7+a}Y&|\\AFBw{!O_Ww0YA>Y5', '26b7c332' ),
+ array( 'tMvi&HB=S$;.+9jL`.D]/t=gmNB/l{EbI<MOdom9t', '7de5c876' ),
+ array( '*G C3L$BqbRf ;UO]d=Z+ %GMU-=CF2Mn3q#`vFRY', '627567d3' ),
+ array( 'y:Z6o*sUHO`HT)u*74N]G|MZnQ;exn@r*z*z&}QNN', 'b1579567' ),
+ array( '3v#<m.S#]2KZ`\'J3C1,2Q =M*8S)i"W|y[:hinlH"', '948a6c9e' ),
+ array( '9#b@Nvc`$v3$4`/L4977q42MO{8>i`@#d$C4z\'t~~(', 'fa5a6693' ),
+ array( '$3h4_}Mw6?-Im\\E&z/g<2M@Va<^W<]_@pITQH#J^BW', '5db013f4' ),
+ array( '(14N80^ LqNmH0+\'hGeIhWr>*<AT{d,$u@S.Q2/~$]', '57cd1795' ),
+ array( 'mMnxUWA;!*stH}2iR.O_3E!fTRycQ}B?K18"iZ=kd1', '08722fa3' ),
+ array( '`.0sxb"HC6nD}Cvw\'HvJgC[!EE[c1AtrO&fIiiq- `', 'c89edaa7' ),
+ array( 'Q~%Hv-qmWZ23\\WY9;kZ1^+8FT"1G/2)`1.*)<{vsW*(', '702aaaa4' ),
+ array( '4aaM}M(0-4HTiJe1Zw;<*JF3fC+Zz5c/wE]vsf("zQV', '197ef095' ),
+ array( 'd|=vW63s@];SD^_ Ztcjm*He~/m!+?Xp<vgs-{hMY$"', '1ed13f33' ),
+ array( '}cb~>Xb)FmR,laznl:H^V?FKLC4z|9}{|`z<:^F`Lxm', 'c04f1349' ),
+ array( ':[h*I#R(ZrO\'?r<;oU:lS{ho6G6vt0e/kN:6Rl>._m5', '48c23cac' ),
+ array( ' aQ<R(V?[R(LhPb`EsGU`vovJ]5X>$n?eA[9I3X&faRP', 'a53ac530' ),
+ array( '262W+Y.kP}b{[wTz|D:bev{0*U7p7iBJ!T#,.1w_/Z[k', '05d91499' ),
+ array( 'S1gPU"4<x1M$gdu N8JPlM]{^U[n18[eIC7 FL<@^iDF', '12db23fd' ),
+ array( 'N:G}SqO@@-< cxnt1K[[or[6@wV~b{F17m0j__,!mI!Q', '2b2e3dde' ),
+ array( 'BpGT<#0-vkC7dz6Gv\\Y.Kjx+K&-9O.jq 2G<6WJ-DmE*', 'f4c74b67' ),
+ array( 'h\\R_:-newhqCn~]>-I1.[XKr1u!UcF`M#3-=@|#9et]Tt', 'bd458351' ),
+ array( ';r#d$1A]\\4nR6E6\\&d_:q}Zn"tUwR*lm}oS#!u`^+P1Au', 'f8e9f1d5' ),
+ array( 'H}|-^7 ]ro_gEW;PD*N5]Q7S3u^c\' YP~W^^n^<bO{KuS', '8e947b43' ),
+ array( 'fFxpu.OGE$[;c?CdytcQSCA2_$b[PX08~)*t8Y=]^yyB9', 'a34f6609' ),
+ array( '>(33lef0\'yo,\\L]6\\u6e ,}ZI\\9CW\\]udq)QWpb_jRlH~', 'e9d8fa86' ),
+ array( 'J^[@tB@!A{K~5oVqNLW@V*xGlY3@F[@q;|21?S3aO_`eP8', '104537ea' ),
+ array( 'X~e0@<;:d)swI;Ti-pg@"(s6iDuK*GcbFIsgf/"K9vCb2x', '7c5f8020' ),
+ array( 'M?i5_l=T#(xyT$A9fhb[QJkSu%K:h]46}}L^kj3os-iH1,', 'ab2ee1ee' ),
+ array( 'axuETGoA{fFG"0&6G$4sb!_upS#[{5h^.^$c\'t%#[LK]\\Q', '8520630b' ),
+ array( 't$U)x8*X/{,3W)H@hW m;\'bA+?mV}K(rP^|Iw("\'$/;\\9d', '5ec32f02' ),
+ array( '|"<|oX%Sz0rifq5oeeNb0Fk2NpBiM[OK^lINFN#A^u+FhA7', 'b5b5f4e5' ),
+ array( 'N(e18-}K[nmF<Jvg)c1X*`[L@RWg;y~i"e{:rzeOiTv&~mn', '14562c12' ),
+ array( ')R!b\\a?)"qai.[ix]OuxCp^rZ4ja3XP=+R h4?r72T"@1k9', '01b11a54' ),
+ array( 'n</g_!GS[[>=own-#B.lVM_n`5p!F];5zJ}ZLF.("MFrE6!', '8f9e0173' ),
+ array( 'IX/60]v~>,p@RO[hJ\'f%S.4[1a#$\'9%Qr5g#r_#1ktQ>D.(', 'f4e44d2d' ),
+ array( 'n5oth}*E/kH4sb:FVO.ZBn]TZR\'yv5"fJq\\4ofZ S#4HfNn>', '51b1ae3d' ),
+ array( '}}xAlVvH*}B"4Eh_7Fs(.N(aR=+:lyXkxQ.f)%/3#R57w~v/', '0d3e9950' ),
+ array( 'Ek7S;@6m^A)L<a864G|=L,QP^fgVf_f,L~`g?vV~9_KVBdlW', '8c43dabf' ),
+ array( '-itYuG*U/r-uSs# rch3[?2t ^KBD8yQ#o,y86OG*\\=]QA^D', '4d86d9cd' ),
+ array( '%GXafjWgJ$*o=%B@uN:.ejUoGsMy5,>;Tv|<bT$.X.~u4A7*', '38b099cc' ),
+ array( 'pQ9V<oFdct^y"}5Vu3rYhvgB&g8;)PFy"_Q?Ow%3md.pbDHYW', '859042fe' ),
+ array( ';3A3{c:c|UmM{gP\\:o,3t@!ZNq=s:vKV+lj\'P&kM[Y{XBL6\\<', '88b478a3' ),
+ array( 'Bo2cql2d+& #RW/@B6qH#@%\\<^ ht]&8N9{@\'/%36%6h\\F* \\', '4b1d0513' ),
+ array( '{I`<N>Y.>C$|J<Kc8kkHq~^w6GT\\RU:N~{kN:E\\YiaV4}"x7n', 'f1ce1247' ),
+ array( 'e_`d>Y{f/Y9dsgdpT3+zpddR<yP?rh.XHo>fI;NXtg>iP#Z%6', '3e4eb24d' ),
+ array( 'e \'KeZg_,\'St6-=\'K%QfS+\\;IFkL!qcgrk3XF{9R$lG;yeBFjs', '69476a97' ),
+ array( '.? j[I2Hv4:Z{-F0fm, A0mhLhOn0:c>Zc*6.=^%Qy`M(\']nuj', '9097fe8e' ),
+ array( 'n7{]!HFP7Vk{uF`!]n>=to7U>?]{.Sg}kc\\l,#>DZ*@QQ"R/qq', 'cbee4ea9' ),
+ array( 'Mfbd<!$z}3Oe2;In(UrFyMQ; $=R40Eav(F4)K/(^^mpz8`#mS', 'f19251c8' ),
+ array( 'Jh!|%"!CT6SzwK#?_-jo5JO#<J<|N*PysRwyTy=*0q%(=)G}63', '8f27bdfb' ),
+ array( 'nK]?Oyikv9vH4k{,eQ&$[6va>5jf3"y#NWB~R-kJGcr[Oog6Am;', '9cb72621' ),
+ array( '}%3`DHK+\\N&_|^#|10h[WLO4|?{4ajP_pc@5-lAi<GJ:\'M78^!t', 'e0686fbc' ),
+ array( '7NEKLdHaG32($vI:$7[nS$9n+f&DF(9]V^*#DRdlfwtko>&tUbc', 'e4bd2dd7' ),
+ array( '*f|xrd 8,(Qi^1sbVGHC.@9y1W &.cj9Kh2>M2VZ:)Dy;9\\r`%6', '5efb3af6' ),
+ array( 'oFOiW(j^7NIPy2b9`uo;1y`+6zh)\\n@L5p6mx!L0OvaJ)Dci;T&', '05e74ead' ),
+ array( 'LNfXdaAn>0/jF "5y#b+SYl}b2bMM7Sze:SK|u:<&J(MJ*bD.EOb', '17cbb538' ),
+ array( ' <abND0|\\dwC Kn|A*:HTCv NZD] t@!1#c`Ht]%YVHY"8WDBrlw', '4eca862a' ),
+ array( '6dwd?=B@2cADf%&0zd5U;]/=ugb9[P2q5*WTHzt[_6!G<\'W8klm\'', '296c9ed7' ),
+ array( 'J}EAe)ZBYl4nwlDAh9|HP}om&H&q5sy`q@#XI]z$K0rD}7efQc0#', 'bc868018' ),
+ array( 'a!pgIwZ^lU@^uC8@"3DND8rCPY*#=:\' <xhepDE]ye=p*U1,iVZ/', '09251477' ),
+ array( 'oNRA(\\DFwKF4D/z6S@sN\'1?1gQ=R)xaxG4:Pq_vj+= PMzf";[QCm', 'e8f565aa' ),
+ array( 'pTUCr(LkiF4~`eq@\\\\Lz\\|IXdLt@}8.nld2_l_LW&aWfHI(&&U!cS', '40202a4d' ),
+ array( 'K<8w2YvJhe8Mxx;YFs_)KGQtPW{&Y`Z%}r}0Mt[6[scUm~/4rn=?7', '9d3dfab7' ),
+ array( 'o5gG1n!rI\'p=&!jz]!VRe-@d<TX,rwCb-,+?z-2D4$a;&M6cNm65z', '092e633d' ),
+ array( 'Vy8,SD LhcZtnyo|-421vM8Dc{sR3)Ni$fvX,w%t[_iKZYHhnZzf(', 'db49c4e2' ),
+ array( '3,l/ @B*n-/U%gb|lWYMA&){Orj+mQ4!]!1^BTi1bxgh`JfN"@|DG&', '0c69cbb2' ),
+ array( '@vx+"g]7i<9z{[Pel4^U|? cn#%kGLqgDksGSR^=ow9kSjQA~0v{Pv', '8aafa096' ),
+ array( '_?zd,B2~+Vj ~?S]]CVv/+aaL`qD]C<=c7#oZ5oelZflz:KX^"Pn.3', '2da2dfea' ),
+ array( 'PZtC Rf<oKSs</),uvf\\cbw/<W2lF@ v{u:{H"88Ml-i{6ur.]OqAH', '6aa6fe03' ),
+ array( '"] 4JFTK>PAXMi[e#*S0sPGjCUIsHk=JI=^td4A#eb\\3M8yQBMb7~+', '50438792' ),
+ array( '#CaM8*9UUbs5XXIy[/]8B+P=]sjA+jL./.\\G9u|oYp%2JO,&_i?"up?', '5a10e446' ),
+ array( 'Td+upvB~&Q\\NkRL[->`?h1Lop7/s- 4ad@XU7zU>M2l9e9trWV3Ag_1', 'b41de8a2' ),
+ array( 'Xw@L&@ah&"A\\9<3WjEE$,_y 8P3Y9sjrk,@rM"[S$|1>:Du%j<*v{$v', '3d1d96c3' ),
+ array( '4T+nn~Yake"^4$;g)8xGR>>X)Zb Wfwk<#Z+#5mo{oO0tjx}#rEV1c/', '021cf019' ),
+ array( ':?r;vZ3cv7?#:Tq+QaZaWE[UHN{ ``0{ #7v]KZUbyX}OJ)!-ccd*?;', 'a52533a0' ),
+ array( 'Sn8SOxcLxfcpE0KzsFTqu~{w-`[rj{/>jGr;@Vg:>L+c]W_Q}4Dt4@lA', 'eacea244' ),
+ array( '"I5lED,1k~M-V6GtcRYA*9s)N8}bYk%[6;I\\_UnLU<Z,R""7U\\X_vMiE', '8dc7eb87' ),
+ array( 'eg)?T/{kKEH+{7XRT3^(6a?k>xK6F6\\-~eLSuI@AnhMk!\'>V:}_P_~<~', '7481744d' ),
+ array( 'xh5@~qM}XzRODrq4\\? ^F>6a<u3|uO{n9209%]8^Yk.}_ 3=@3{gR2In', '4da520dc' ),
+ array( ')\\l~-hmG{}`"\\y`7eo6FpIc1\\_x/rC~{ k{.UjURi7TF16]w&s>w>"*z', 'c6ec7195' ),
+ array( 'b#+VG+SGvOUM:, $CTKUj*Nq~mi=os9SwD+?O_gG0>tJKtOnJ{E6&s(&a', '6976d3a8' ),
+ array( 'rCRg\\\'`"2!Qriy#(nNTd~C/ziE"]N(@AKr))zj+.k]!UW$^FR3,QW;MA`', '57543a3a' ),
+ array( 'O /X@Q%4[.0F:>2w?hPDGvwZ$J3?wT!HT0!ub&+>4;dOZwGy`w?)o7dsa', '5e4ad807' ),
+ array( 'w4ZM5##F%x)+%G@A-o{%8vf06p!NUu1N*k{?o~etxn }7A?D1;JI32ZI#', 'c01f194b' ),
+ array( '\\wXR)(]u$|e#cZ|SZzj{;/.WZXjl45op-ID7Q"-U rYcMV7)R#&n35Fmm', '4e92f8a5' ),
+ array( '2Z"GJsUt8lF;z|;mV <.8F`;MPNbw<Q*vTRBH)7au]|q[9_29|ARC#mpS<', 'cf4d6b34' ),
+ array( 'TKY&VQZ)t$2,e)jczF|[Y7Xzi|~WnRtC~OIU"%_v)r#n{nRw6PTph.lR+k', '7a8a94c5' ),
+ array( '+y?!>>PgsSmSJvFNfC=:<TjqES 3\',~2\'>4E\\e.Q9{&crL2YpPs.%_ K4 ', '11032641' ),
+ array( '_;-^N4}bZ[Hh-ae3EX`X3R)(`/h`[|a;9nzg$xK^UsHcV.w{gXUz,^$lnm', '9298d67e' ),
+ array( 'MKj/f%~bl#\\9b2-+vc:n`"H6}Tu#Aepo1\\ xa~[O#8hfKvrBZ-2</ZS.0I', '0654c0b0' ),
+ array( '1Q/"BA^B:ABvpE0Y-[Q ~--1I=l|L|G]OW`qy?44`V,R|<-*w^*wk8)5Vu3', '2f477f17' ),
+ array( '#r[aB4B5.bIBD Nv}j$(cb3[OLee$\\x\'PUhsi,)wnR;3Si*QU/Z:rmvB;\\(', 'cf7e00ca' ),
+ array( '?9"GiW1^B=g:,:U@n@J@vZ{1Mi(o&exE zljS~Iu<11ILgi;(5\\~oX1=C:.', '2b97bb55' ),
+ array( 'I \'n #\\jW[4NxF_BrH-.PBjP2CaPf|_1|f!}j^iC:}q4DRW7zdFL\'1|:U_k', '8923a6db' ),
+ array( '=\\KNZ2OY}/CAIA3^ff6~azF.#W,>.l*LIU{%gL^f["(&D<d,${,evRtz+"9', 'aa215ef1' ),
+ array( '9nCe9xb>a/}Ij QpEnUQrQ]YI0OE<Q^U@#<Y|~x^.v(xvZj=J@n=rMw<^Gaz', '87741385' ),
+ array( 'xAQ:DnsBnl"}c*w[ebx1#hNu7G3unuqh7D#\\3w~"d" I,w&rZ $^iSU!{hwj', 'cccba4fc' ),
+ array( '_jTw/XTBPTE5VF_c?eWzf\\YP1/Q-xJxY5MQD&\'gV\\-l4TMxs4Pnz.HL?X}LR', '5d4564df' ),
+ array( 'HF,^s]#zdjRBx@VMnOA# 0~/YKN3J{esBrR7QV36BeY;\'0iu_+y`<yovF>*q', '3bec6d86' ),
+ array( ':pe]c9t5o(L2n&Nv68lvDgW`bGX)fbz"Sa_8zTNk]z}L"LC8e10*ygk\\0Dfv', 'fef9aa77' ),
);
$i = 0;
$pass = true;
foreach($tests as $test) {
- $result = hash('fnv1a32', $test[0]);
- if ($result != $test[1]) {
- echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n";
- $pass = false;
- }
- $i++;
+ $result = hash('fnv1a32', $test[0]);
+ if ($result != $test[1]) {
+ echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n";
+ $pass = false;
+ }
+ $i++;
}
if($pass) {
- echo "PASS";
+ echo "PASS";
}
?>
--EXPECT--
diff --git a/ext/hash/tests/fnv1a64.phpt b/ext/hash/tests/fnv1a64.phpt
index 870c6ced0c..1393fc1b80 100644
--- a/ext/hash/tests/fnv1a64.phpt
+++ b/ext/hash/tests/fnv1a64.phpt
@@ -4,321 +4,321 @@ Hash: FNV1a64 algorithm
<?php
$tests = array(
- array( '9', 'af63b44c8601a894' ),
- array( 'w', 'af63ea4c86020456' ),
- array( 'v', 'af63eb4c86020609' ),
- array( 'Q', 'af640c4c86023e1c' ),
- array( 'd', 'af63d94c8601e773' ),
- array( '"e', '07cc2f07b4942580' ),
- array( 'pl', '08d53c07b5755019' ),
- array( '@L', '090c3c07b5a49289' ),
- array( '"N', '07cc5a07b4946e91' ),
- array( '&O', '07bf3907b489ac22' ),
- array( 'KE:', '50d8ad19d18c8505' ),
- array( '",u', 'd511f317d88f429a' ),
- array( 'RX7', 'a0549119ff001600' ),
- array( '/<i', 'eea15a17e6ea5bbd' ),
- array( 'Otx', '2ffdc919bf72be52' ),
- array( 'w/qn', '9c6e50f771dcafd0' ),
- array( 'aVqG', '4f1788838c1bcf9e' ),
- array( 'G^hs', '33551d7dbbea0209' ),
- array( 'a7z1', '4389ab82f4d6a7d0' ),
- array( 'c@Lf', 'c14b5591800f1338' ),
- array( 'MB:&Y', 'beb09d1ee59646d5' ),
- array( 'ICDy9', '4f05ddd19c2c2285' ),
- array( '>qH0a', '370b9a8e5a2329eb' ),
- array( '*fSR/', 'f78a85007841cb19' ),
- array( '3;$tS', '94b935103cc08938' ),
- array( ' \'7AS}', 'd81e3aef0fde6ad8' ),
- array( 'ou9vPc', '549f05284ed347f7' ),
- array( ':u]S4O', '31b0206c95a52e7d' ),
- array( '{D2\',e', '3a68240ea9539e62' ),
- array( 'Y;yt@n', 'afdae733c98065a2' ),
- array( 'IAu`bI_', 'c311eb3e8f9f51c4' ),
- array( 'R@xIq]d', '3fa1984555c55e46' ),
- array( 'g;8{k5@', '9e9c5e80cdc3d58e' ),
- array( '}<Ldvh^', 'e5be53f31a393f34' ),
- array( 'k*N6KDw', '558fdadc82fbb9d4' ),
- array( '/nWb0Q-"', '84fcc8959c773b75' ),
- array( '/qiK+e7@', 'd177962e1def962a' ),
- array( '\'5]SzT=Z', 'befb197ea3aac960' ),
- array( 'AH)WsNO$', '63dcf1c6c88d5426' ),
- array( '=(fNZsPj', '806bfb067d62da41' ),
- array( 'f:6q!M3(c', '5125f3e296d40b42' ),
- array( 'p\\^Fz:gCC', 'b9ffcd384d90ba98' ),
- array( '@7qp<0x#^', '1da17e378a5f0686' ),
- array( 'Tw/?^JUQL', '85f6d1938d45b818' ),
- array( '#dTfU2F|-', 'b66e4e092e385394' ),
- array( '`dP%&hvv%(', '84523fb38ca2975d' ),
- array( 'p)fE!vd`B;', '9c94c2a34d9f95c3' ),
- array( '2n>vD&MVMJ', '1f4fd77c72b6004b' ),
- array( 'd//546~,-$', '159ef268adc718d9' ),
- array( '4~.{E/s*p6', '31a60e2db942bc67' ),
- array( 'F#&dyJkG!:q', '33b8c68aed55c285' ),
- array( 'eI"{^9zjG ', 'b42c013a2028584a' ),
- array( 'F/|k>pv/(=3', '671c9537b41d76fe' ),
- array( '.#-XoUZ*HAT', '84e0630a952577f4' ),
- array( 'K>4d:~-: SI', '57deb72cc24c6bad' ),
- array( '|@hn8xvV,%Y:', '157fda2502fe1297' ),
- array( '^Jp:T9\\*ez>K', 'f784c17d1a2d1bd2' ),
- array( '5>XP>-z<Mc,f', '6084bce050682a8b' ),
- array( ']#=j)w&hBv#w', '7a2da4d0b1c01e1e' ),
- array( '1_"vZ@Bp_{A}', 'e1e8fb095e4709fd' ),
- array( ')<;W!G>^K\\JTT', 'dd737d6771e9cd69' ),
- array( 'P>vGAoX"qP]3s', '0375e65060074988' ),
- array( 'Nrooqy-.Q.Upm', '135d77993c647f43' ),
- array( '"M8W"huy18ij:', 'aedeb2565e1c29f7' ),
- array( '\\;wo0Gb!8UzEc', '59ae633a0b17a945' ),
- array( 'LS:=B<kZtmDjhU', '2b2e674d9a46a36c' ),
- array( '$S@>0\\7 l^cmw:', 'f21c8cb206540a2e' ),
- array( 'h=}6q8T4U@nJ/3', 'b258eae8a4671c77' ),
- array( '6wi:L*Y\\gp]UPB', 'bff5f2c9ed84bce5' ),
- array( 'CH\\-fZDXsxlJ9\\', '298d4e05d5a47c45' ),
- array( 'uIp,BZFne!KMr*#', '8641dfc04c9fb552' ),
- array( 'CLGl)USdy-Yry$-', '3ab1497c481f22ab' ),
- array( 'WyVH\'y#NhhO57B?', '8dea1d032c597f60' ),
- array( ';fkbSt8(Z264&09', '4b875649e7cfa1a9' ),
- array( '4g3k1:e4iN}9c6[', 'd33acc8fe01b77fd' ),
- array( '$QBo4veM @`6UgGn', 'c4b17749dca1aa6a' ),
- array( '{0#gA>MV(|TAaj}e', '067ae9cfff2cd6ea' ),
- array( '=AVR8< 9]aO3Iw#E', '02bad50d48a8e564' ),
- array( '(&-JD[!LYVm<Bl#_', 'ec868a84ae92c032' ),
- array( '.Y2Gv3`Tt1h>)kd2', '9f7776edcdaf2937' ),
- array( 'qq]6N_c)7REY?H:M"', '1899eee357e747b4' ),
- array( 'Mtx`VNVg7uq#Z%uMc', '8eb7e5a4bb9fb739' ),
- array( '-{Cp%ZCK5ctO2v}\'p', '58ebf399369565ce' ),
- array( '^^@6GW,9[f?Q4#^1G', '76ab1ea61d68a738' ),
- array( 'P7#tb9XWhjOgrAGQa', '29294a2d4b758119' ),
- array( ']x9i3uPSGeW\'v~W.#L', '508d3356f8ec886b' ),
- array( 'p<&I&pxmd:57{r06\\D', '4660b5543de2afdc' ),
- array( ',.wTsO[jO4xSajog4u', '6d85fca5fba07683' ),
- array( 'Y.c?HyVElg\\J,hY%>N', '01e82905c1f66c8f' ),
- array( 'Uy:&/4Yq~IZ4@5B%Tk', 'a05cc808b297050e' ),
- array( '~+1lrm8 Wr&uA[p[a!o', '22783c7a8fbe4826' ),
- array( '<roeM$\'bG,73+CDx731', 'e00ac9dc3812b301' ),
- array( '7j$>aFyS#\\TsxGc_uhf', 'a8cfc6804bc24e1d' ),
- array( 'X0rpD~5iwL|*dh/#KU|', '17b538fc3a531c98' ),
- array( '~YZSMS{14qzzK,n=PmR', '47a7dd2be021ae55' ),
- array( ':f 8pd!!hMWeL1A!^u|p', '4c9d34c81b647804' ),
- array( '*ol&<xtZIb-dJ.|<r~=[', '7d8483384e8a46c8' ),
- array( 'LuBx\'dzfZwXehEk%>`_h', '25484f299d38dc95' ),
- array( 'DmMn{K+oKILw?oqGTl/0', '8ecc9d0f58ead225' ),
- array( 'eguN-bTLC55h$cX!0cq[', 'b3e4439d186da97b' ),
- array( '.?TN/Fvd4&uznlJ{O~Is5', '983efebee9945885' ),
- array( '_\\9C5;Sy-0)LdW[,NAAU7', 'c01a00203768a32c' ),
- array( '<D%fATfjH{K&6n;QC6^T?', 'ef488311549372ed' ),
- array( '+9wgEG*g}B$BGjd{QPEN{', '2c57de61c289de00' ),
- array( 'Kdkg6/~uc>"}7jD^t,\\80', 'f83a6970b348b383' ),
- array( ' _{e\\N6#|2Nb~7y/6orUrq', '26006911a7c5d137' ),
- array( 'l]6LRC)jS*KPo)~&,{9Z^9', 'd848d0547a41bac1' ),
- array( 'rXH)I;^<.KyExMh"9=-em|', 'ad7ca21d760bab1f' ),
- array( 'nl$zh>UHWH" RL<1hJ]coV', '87be1c6aab3568a9' ),
- array( '2XYKuf1cd Qhz;\'Qc^zf^M', 'fcb5e375b267b232' ),
- array( '3z_|F>`6usoP?e8QJ|R{fM7', 'd6cd721ef468a686' ),
- array( 'm {Mzc-Iv(*tOIVe@JVpj=*', '5ea4e77a701e1fd9' ),
- array( '<g\'ndm=|\\=y*9]7cU@nJp9"', '256fbcae5dc6e749' ),
- array( 'VYL.K7KUT4]DyLav*~p49OL', '55e66fa9c0b7f691' ),
- array( '}%mlP^&R6` D,8pbl%A1~ms', '1d260b7fec06fa81' ),
- array( 'vwsg--8Z,=Ixn) A?`BdlZVP', '1ac9ffbeaf2ceff1' ),
- array( 'H[qZ[_NRXC;fQSA]qjV`sW#4', 'fcd1a44f1f9644d7' ),
- array( '8Ey&!PVJ-H%i)T=bwXII-j( ', '20541ecba873cbbb' ),
- array( 'V^`K6d`O+ZU,,,W:U\\$_2BB+', '817f942d64cdf041' ),
- array( 'zlU)W])/=j[SP<$[wYh%f@@=', '8a852332f2c99373' ),
- array( '}E|0g@<b-qleOuumaQA2nFnf ', 'f817c2a8dc3cac28' ),
- array( 'Wlgw-%uR#\':DC}R5j8ea/SDau', 'be35effdcebfb5bc' ),
- array( 'VP<E8=}%%u2+le/s S8}&Ni?4', '31a4b812c4ec4d45' ),
- array( 'LOhp1_Ga|my;k~Ab2LOw\\Cx1[', '21bc5ceca29e51b8' ),
- array( 'w7*aW?/() 9hHzf6u"#uCe(p5', 'de09593ecddfbfad' ),
- array( '!MYz^5rv@UO`dWidpS-l:Db=GY', 'ba497ffae361581a' ),
- array( 'a-bRCc!|_`3RWS)(5n`~TRSa?n', '7d6da8683f44e043' ),
- array( '\'#,O]m\\@A!%B}d$18\\eAdz0Ezd', '964a554b2ea62312' ),
- array( 'xOG9>O<K~y:\\;\\]@ [%$l=`S_E', 'a6d30ae05805da81' ),
- array( 'OokJUez}~9M;eL6!)Q]fq]Bwa0', '52a0a33924a1e495' ),
- array( '5Bdth4eU_;;Z9:tgVZ4m[=@:%3w', '4e3d8a502aad23d1' ),
- array( 'H+YYA|>7fR|<39XmSsb;K>P9ymY', 'a30084c8ebfe7959' ),
- array( '5sl-<xgv:d5RLhOh{iBi=6MYak*', 'e4a386d2c4782f99' ),
- array( '{fxU{lC**=q!XW7+$ Zm|E0gcG5', '19e6ce2e2493a78b' ),
- array( '=*"H&iA\\f/!p:>b<v;S"?T].Q#?', '226c52cdff2324cb' ),
- array( ':ffP%pSMw=oT$ Uu:sYVkt+m5_KC', '08df2d276c9a057a' ),
- array( '2OcL7J}<<Qj4nZisZ?iu4DL 9WmO', 'f02866cab6af3d35' ),
- array( '8:sJjWw"#u>@H)T7d>,@^v6r;crU', 'ef8377919e2a1bad' ),
- array( '<a&T|y gRxiUo)v83LPwk\\9JTO>o', '99a9a1a21c2ee2ec' ),
- array( '31FOsL%pG%Yz}CQnMH\'`tWY`5r+i', '887cd200603d7a11' ),
- array( 'BJZV["&PN+Bv1{q0@C~mk\'Oa_*Bt|', 'faad097477f65bd7' ),
- array( 'N_@x:wU=}&l*Ic<EVLfyLUfS&H30k', '26a5acae427f26a8' ),
- array( '(.:hN4$FiAEp.P:ql`I:GCf|+:$TM', 'bfe197dd01c4279a' ),
- array( '4@VB[@qoD8Ze^Ks/ff|G07oT}m`9q', '60dffddf1fd785eb' ),
- array( '5g&V>I2_;#$T]j3*^CqF@:WX*-Vxm', '05994a3217bb26d8' ),
- array( 'oj#WqZv;lWVp[,OF?Y&cLM%f%]q24j', '151f45373d53bd27' ),
- array( '!%U$]H_UcL-;>iGm0gH7KtdP\\i.N|C', '0b91af28a642cac4' ),
- array( '9}Io#(8b]|0k8NU`=fIe}t[bF8MUfJ', 'fd58c24dc342b56c' ),
- array( 'y ICoML(0+%Av>pM .4Is2?OufhC<O', '199280a86e05b101' ),
- array( 'n6O8Z?f\'Hw2N9*m*Wn9k9.~Y^t@G9]', '732c4bf03e824fe5' ),
- array( 'v(tFAPf(W0 j^:uMDM<^:Vl90K/PrH/', 'ad49c5c4b29581d8' ),
- array( 'jQ$1rTx{-*{xi7n7\\=T;X+(r;T"lHK{', '74f8023eb53a4c87' ),
- array( '3|!EpV?lcIi]3!LK]j xC,"6HW85 d2', '45f93db9ecbd61e2' ),
- array( '4a4YSjy@NC+,V,Y#jE#dh/f~W?8m?}!', '628239fa1e9fbf4c' ),
- array( 'T_5/3 )TOL_\\$l7\'W\\+<E;$ErC^ac\\b', 'c4d6aab371c199b4' ),
- array( '8=xGQyP&I}f&"S>*+z6GAQLfDoF\'S#jk', '97ef2b6a27cfe08b' ),
- array( '@c3q]dx(b_/e3Mp?H\'gjX4Q}$w%X{pE<', '8a65a0d9c497dca7' ),
- array( 'TY/3>(;"hJg{wY<A`$,:8^8=W>vS/<pd', '7d99f135b9dd392a' ),
- array( 'u w4)46r^~nWX,x:0%TIdmg<,^o<z`"p', 'a3296f83b9d4178e' ),
- array( 'az%k/<^m<NEtZ?0kDd5*R|F_[6|Ww~HZ', '6971ed23982e966c' ),
- array( 'yNG)j&w\'U>|1]-|#r3-E0S&lj$Db#m>}<', 'b3fb4982abc0e4c0' ),
- array( 'e(\'l!/C?-T|:Q -d.SuaZcM^)1bvOa36i', '031098cfb4e50d1f' ),
- array( ';$jKG+X{(sN)"48U+z1oHoxYSo*5$@ ?D', 'd2ee11dc187ad41e' ),
- array( 'kjlvDi 89*:MBpY="IfrB@G3J\\7k\\W1HB', 'fee80db84822febc' ),
- array( '}@gh@ "K:Pm,*,.Tr"w4I+_\'CKcz]->\\N', '849ddd5ac8830991' ),
- array( '&En&G;Aw*M#6\\W*_O?)[~0~Kty)#9eQ?+A', '58f765bdd716e1c2' ),
- array( 'FS\\hLf6O}s\')SWH]3Hn3sc.|gGc:go[/C9', '1ef7be10e1e94525' ),
- array( 'wo!/@ #H)W R54z$GnhVlP}QkfAGueamVc', 'fb192bd95f5f88b2' ),
- array( '|vc!?mX?@mT<r|+\\Sx.RJy9lB/R$})h{ L', '3f2604691e2ced49' ),
- array( '|?;U_[D4x81%te}#8I}Q6@ahE_q.[r[Y3v', 'cb8807aabe087372' ),
- array( '/rST(Ll:Qb Pf8yej0&LyL-lZi_6Cs.Sga(', '4c6bc9be092660cd' ),
- array( 'o/u+aY,2@D-&0>-\\8Yj&5TeLxZZLB=T3MK>', '9207d0b883378aaa' ),
- array( '/%JBFoOM n[]\'5H-K}swvORCqpx%>EDNKnp', '34c18ad3e2030b27' ),
- array( 'q_A@_0{>82gF]e:V]j*!\\zza:@&hkuZ^U{ ', 'ff47e63839babc22' ),
- array( '6,|UD/=jm$&DapOcNJ^0e 7Nl.*Ld&Lz3IP', '8fc04f6e48534104' ),
- array( 'WYnCGrJlT<<8jgw{Mx4|eB\'2\'._#A)SybC>+', '444cf38629f9f5e6' ),
- array( '6hxk&5$p}|lKu!I\\DQoK_ON!X#{<G:H]#AI*', '93be8d30fbf2a711' ),
- array( 'WNzUKh"BjL~/}o[]?+_x.[6Vu^4y ^$X- .Y', '0457576f79c1af9f' ),
- array( 'h1{T]{c[k?:+Ky%ZV;1MzEHz$MT1Mbk7sgkR', '60d5a7492fab7ad1' ),
- array( 'dP.PpH\\<Cbvz}(HxNqtS?Iem-Q%":qT~CcP4', '0005d93c99685bc1' ),
- array( '-.QPpIKoRth!f^U\');t7ly9\'ln\'0RWE_ew1VA', 'e13bf2cdf312dd7b' ),
- array( ']FsR0u:oKAxg61U1J\\~9d0l<UL#N]Zo;"dn3[', '53d2c531034cdde3' ),
- array( '*#\'K|ob.EsY#rsg$`%Y.((lcx(e]wx9"|ANy1', 'e16aa67d2eb4115b' ),
- array( '1)V%bYxVB}8GWFP`34Z<z95tS7qtek\'wt^}X9', '5511e58643ea102a' ),
- array( 'w/[uH$NnU0#jj?e$TZWlLMS9UK/4IgNAw+7@0', 'c03ee6776b09be84' ),
- array( 'e0eu3PaS7f)r?v?lJYCvhXAP\'bI3ziCaz)X.Z:', '6e63e154ba982b2f' ),
- array( 'bq!kd@c%.._R&H+Gy3+CG&.jh)tA8P[zC]g)~K', 'd191830ad78ef4b4' ),
- array( '..Zn``7l(2 3VG:e3#o)D(Y!$|_k&^85lr$MT<', '7aa3d56eb663566f' ),
- array( ':]O;p&c,lv0\\ UdZVhW6U^umtbax066KsefelK', 'ea574dd4514d7c68' ),
- array( 'qYB#6CX{~0dVF;6=)+ j%1"<\\u"D[ooNI3Q`W+', '58f171ded41e0193' ),
- array( '\\V;B.b^D gP SV1VrnLu4)f$W18*qo5OGPrU3Qz', '11baf93d39928abd' ),
- array( '4:L4n#FEv5rmJ{TOTeg^XXt( EzVYLRmg #V$I{', '0ac0c936f7521a28' ),
- array( 'z_nh*k>Y@$B~\\zte{:`St.\'cu\'fL+1I\'q9p{%/V', '1a0c38f41c1826e8' ),
- array( 'E4yEpu:WqU8FJGM/=Uvja(4hyMYvSiNx}H>o?YH', '75024234e0476c05' ),
- array( '2/`XZ(\'jF\\a1?iF(dtb\\HM+BLTa<t;d\'KF_\'Ogq', 'bdcaffa418ba3eda' ),
- array( 'vES(d>Om#EP`n}l1JBsg70M>[t~bDfU;-)DqGt_K', 'bda836f33c0092dc' ),
- array( ':1-)0y;Z</CS?pq{eq^+Y4Gf>lYfa:2|K?&\\:B7V', '16e6a228513a03c4' ),
- array( 'QZ+qL}m3oM?Ibf1!Tjh6&z4R;;/V]F-0"8#O6pc\'', 'd272ca04df7d0554' ),
- array( '?#P"jb$?MlVThj\'%&6[d]it`#w19itA)wr,bU1##', 'c1b2b80d012bdf50' ),
- array( '}ZXgE_lLvI1T3\'67 GQi<rs5e!x;2|?1Wwx}WfJN', 'bdd12a4f05766cfe' ),
- array( '1\\$Ed;\\dc.O !D6fE/#X,Bic:carJ-B\\jG"Ob^4Fl', '9667031dfb5a16c7' ),
- array( 'dGm)^UOmX(zzq_6VB)"PK^;s`jV? },dFzn%Q>s*G', '166ff835024396df' ),
- array( 'n&:O=pqGrBsQ^g2J>RJ=_0c[ i->]8eL?!|\\qo$e3', 'bd73d9e41ae5c6d8' ),
- array( 'w7q_J<~|g=]w!9wjF7I^}v}~s[pc_VvXnh9:&87mV', '81bed0679537a583' ),
- array( 'ueW/^CUul5tc4sXoe<P=4*,}CF$\\^q3TXjd8/;.|P', '823ceb765e67c7a8' ),
- array( '#aew:U]W\'{k1(iTOm1/`Dd:0JR@ea>6e {]:R<qZ8^', '3d7194b6e03cc23b' ),
- array( 'kAHAq7S"wxf3*1eJvGh.-h+j$^(v9@U&b~GT7zV0s>', '01e47424ff38f337' ),
- array( 'C}P)IHP3V]|bI!BQx[rOaUO*+f&bvz!:yQDCzuVRTT', '55e116dfbdeaffb3' ),
- array( '5}VWPO4D vzO!&7(h.#jI|=nA8dxj9M 8$XhTm.Td)', '5ccd76496410ea5e' ),
- array( '%f0<nxKrcup!d2:J,%cZ&{^^e4Lsi2}nx.,h\'X[kOM', '99b5ca1d7ad80276' ),
- array( 'm5`(_l.DG4@\'s\';A{%SytM("60[r|+@jA!s"n"F77g>', '42c09c31678d6f41' ),
- array( '+nZLj`!dUNmXe}4Yz@zfb|[dk^+#urB!a|NM^P25 !m', '7c2bc1c66d9f0223' ),
- array( 'e~#?zD:a\'8=l${w(qkKsNIC{(s/=t0,Z0/z+T6l\\N+I', '8b024f00082671f5' ),
- array( 'S\'B\\y/(n]Q3ZY(jv|{$W,3S8hi&E91ol92I3BR# $6[', 'f90f149aea3b4fff' ),
- array( ']?FU<BZtOmHgW3m}M m:9!dMC7QD<h y(GPDj+:;yc#', '216ea9a72de9aadc' ),
- array( 'RwqPEr>`,@EZc],)yt*t|QFB<R\\WMA[ 9NQ^Ao?N1e)u', '9a53a5fdb4a3fea9' ),
- array( 'C5~>*)4([ZJw-(P[I-[b\\-A}}aM/GV&kl%+w/? jyJc(', '7a9e26e4aeb98fc9' ),
- array( 'R5c|B@_~N"}McK\\,#cxpi%hxDhd?3HHf^,c!MD!{F I+', '4f0136432df156d5' ),
- array( 'L\'8Oj1@U6)N[r4z\'\\Cm;PR=}v?z>?EIkLa;8s\\m+f=fZ', 'c2587023e1d5b660' ),
- array( 'Qaa/&PKV#iTz)P9Huc4CFP\\:-KEth,O;n1JtavKe`!ai', '50683e95eabc367d' ),
- array( 'R{2H_Fl\'vIA%tgy^tJyd\\EY><&%}(fgZby#CApJ8:l>0U', 'f16422882c0082cc' ),
- array( '9nJci0@/i_LoeJxL2S0-WTNH gbl&rC?bn$L~E[h%)YkS', 'b8c4873ffdaf0fac' ),
- array( 'R8f\'Is^}C\'}+jk2^/QA}Vm|{If"SAm\'t\'m{PbZO&bN2M:', '948738b38e532172' ),
- array( 'D,JvNIM<GJf.L:P:AEB0Ars|Cy_q-.-Q;XHi"v&IAmXn(', 'afd0b1e73ddced08' ),
- array( ')*JNL[p@OmcJNVW]d*y=Sc?JjhlYB\\aKf-z4hkT9Z9d*p', '1dfd3ac789532668' ),
- array( '=gUGarzF3F2|4k?qNjX[fmERC_.\\D8Nb!$*cw&*+M=(b*G', 'c7ce7d6de622765c' ),
- array( 'TX3.5y{[M?<[|`sKDtPNXHUcT#"\\e,%;e9I{4FWaes>cU2', 'f0fa521206e1c67b' ),
- array( '0y(aIa*~F_#H<iUB%;\\N7punS[cq@:%Q4-3]o=]7|`_:J5', 'a38fb64baf6368b4' ),
- array( ']PQ: h,uX_R=QrWWDkdWJUu(lsiM/5cme5)e~5\\Wu/uH#M', '885465855ee39187' ),
- array( ' G:e d;vm)kWWzm;hSPr:P)v)~\'~G*LHQf.RLJI:S5r,1`', 'de1bd4eebc876571' ),
- array( 'Gz5xmPIvGRvNQ>Y~f+fu^4@)Ot>B!P$HK:B:jk13?(bqG<p', '5fce9e2beab28428' ),
- array( '/HX%\'lF0<;O_< ceL~(fitx}4"`&I|wYFP_M=&^YA.:^/}E', 'babb5873a7b954a2' ),
- array( '[}MCgC<eW>G^hEVCk\'#:E)y K):+89Pt7~8 BTfzs.Y\\T0 ', 'a4dcad2a3d27a8c5' ),
- array( '@8#[^-U_Y^ydw45lL5%LXZ3SNB.,v?,8X0t7>Jvw*q\\"\'rn', '5fce337a1b15535d' ),
- array( 'S)t aO46}VD*Nd7g=H\\Uf\'M^2?;4F/$y8xzzH/1GfVR5;j}', 'd650a004f4a4a934' ),
- array( 'X3Z.yb[Xt{t*C$.>=\'98PHJx0!KF<6DuI~%Dba|X^rb"wp@5', '26f61f52e18a413f' ),
- array( 'xYNI#xB4ynZ7& .P 3tbtr;Te}V^nwshRC2V<Uj7DFOKF]{F', '955141b7150fa2c1' ),
- array( 'pp)fcE;JCr)3j}{=A/s^d^v*%FUL$QrtC|\\(BwRfk\\yVZvs|', '26761cf7ed795ba8' ),
- array( '\'h\\kGSvMzLy~~ltBiQJ-J}s6Znl6ea4lJqYrFPAA};@})5@s', '7e915de5eb615078' ),
- array( 'fk"2juHFd6\\Jxq8Ddr7+CYLBul@ #atjMv|8lF^Q]<|V/6zs', '7313e5cd61f71972' ),
- array( ')3~MmKoc91c<rX\'AO%Z<K9n)Vl`f#\\Z,oZY^\'JB@[&]O_ep/j', 'b8b744c7e5836f88' ),
- array( 'KL7e;A=)"$,^^9O9s.A>QazW@J7&<Gqgs*N0Kk:NoF.O_^iSl', '71567bade5dcc22e' ),
- array( '+r?lnv.:/4VW\'?L1m]]Yw,I>;x~ycSgnG\'\\6~jP/ \'f\'G395q', 'b52ab992b89a25eb' ),
- array( 'wni%9(@3(:v["e#*B:)-j8-r 5:4OO&G?oLXxll!(c]*Ja4l{', '05178f3f6d1bd723' ),
- array( '>zgV)ZW?tknEq6dbb>[P+]Xo<c:}x(z7$bn-=FL33;Y&R>h6]', '2d02887219c5f7ba' ),
- array( 'Efi$@Y@$s?||:4!}$/<J[O]w)cKHMa&rIpwiJ8n?Xk<s!>q%M.', '7402cada54c164fc' ),
- array( 'P*^."grN1A085Z)-DSF3s~ 0r!Nd\'{sW&Rf);ZWL{hd2Cn?hBf', '7d506df1306b7bd3' ),
- array( '|6e|GY~v?\'s3^zeE%"!\\N|F40j#OSE7Q\\|N%VN{vUo*5jpZor\\', '2f6a27e5596405bc' ),
- array( 'MBYtVj_Y:4 Qe]O5b\'d_};O)P;y,,mhZ0COf.0AIEB{, KBcS\'', '584088c026129ecb' ),
- array( 'CRCr[s/V ;EivU-F=;W_e|"a*".LeaT*5w|pk-HlImW@Ddga!?', '52d26109c3976242' ),
- array( 'Bf=DIGGWt.:I8OA6@.ChzmWR.{8v^:7!!TEJ|m#q{=;5l]K.kow', '0664b26c38a5d953' ),
- array( 'g]O;lKSc*mz+oPQ;N@>A<[]RI;}W\'mOnL *9K^}VLxb=J4XyTw;', '614bf3c3f15ec6d4' ),
- array( 'qTxD}4CV;2\'+^\'5xStv*Apl_<"96W1QIeKnd`3;|EC(%J>~~3u)', '75c7984cbfee5c09' ),
- array( 'Ugv5$xN;P`mzF9j,y}HvDk I7>H6Q??((6=-0lH`M7\\tPG!KFIC', '08249b54b4e80e4a' ),
- array( 'j6C5Mb^d5~%=\'<[5LH].vtkkF3mrZ86FNZ[|=;bR:gpB$LWQu6`', 'd86b2b1dc38a51fe' ),
- array( 'l,LYR_GF;_\\a/8=-VYo*sXz7\\Hn/>%o+1<ed|-+8mhy}!8+Wq{ae', 'de82683d6c863f8e' ),
- array( 'T]}2&lADr2P$N6iKDud3^^1`w=9i:{PoYN"`;D%/VV4&m}R3s7FS', '1585883d76b8ad21' ),
- array( 'vX4nvNX1J)"%X$etIk$!C8\'27YE+pl_hFtW=C0On:QtrV[g Hk!k', '0fcab3a55bc257eb' ),
- array( '%)}<bDHT1(=W|uuA&F1@x&4Oa{P*hRvm[u*?;RtM[3&Y){z0C-Q<', 'f8b622573f260ed6' ),
- array( '3ekub=!Kox9LnDl+waXSu^.~[*/~7`<JG(A*EBU6;ob+4O6-2oa(', '9cfe1752ba2120c5' ),
- array( 'Oo(+y8+1yG\\AP}KvA"-\\qph\'A 5Tov]@geKa}Wsw Q:PPfHqhVO[H', 'bbfbf47f5e41f626' ),
- array( '9ci9x?*o|JXbv:aN/ZO`u!2\\I$E T"Hme3(^R2OO\\(3TCu$SQS4GT', '0fd77de0e48a299e' ),
- array( 'G$}LJ~!LHo2[wq/*A^gJr<niAB;tWbJ~fIK1HL]p<pM5b\\?%<(P0E', 'ff59a87c858ded0c' ),
- array( '?yfa5[9w&8_Pdqx2OjOA8d$u%*2-ZBSy<:[RvuK}/+Ns|G&M3VnL;', 'c15664e583440709' ),
- array( 'sB@}TNXw"R5=/g4%424?`)=)/j<fZh"N,CLar&YtXo3gXGmlY#,:,', 'ed2cece5fae7e40a' ),
- array( 'JD;6`"pJ%@VIm9<sr2McE6<l$)G\'6b3`\'OvgRh3X)j"v$>kwP9[vOw', 'af6317fd2ec74937' ),
- array( 'cS!+[7nnxu?o^qXqJb\\LZakFY=_54/.xc/%?Gs/@iN1H@j;kNw9)Z%', '176ecfc36ff0fb5e' ),
- array( 'O4B0JW@XP$hUC1IRR4"d\\BOw/~pH(KMX`ph,H)ex-OOQ`x%4.\'xkJI', '2e7bda1a61ef9b56' ),
- array( 'cYHU#Q"P*bBroj|Uc+%4]f-c{<jt(6?lphBs:DEE(g9wR6N7ASK ;Y', '3d2b93b2479f85fc' ),
- array( 'c7vO-~eMkW7.LRSqw\\Z1U.H$EjXqjtLN,C}:Bcg/<~>hQq[JO6[%D$', '62a5e1665612c6c0' ),
- array( '*jnc]YX*)eN\' qjh!(g?p:2LdacAf)Fqt6URp.]yt-!t~l] tF@faR4', '547b12c39bb0fdf3' ),
- array( 'G4wh{"0mvFCI7R(1G53=4 {5tBV\\%)pL>h6:jF)blM,% 57HJJe_Jau', 'c22639e2811d6816' ),
- array( '@%L|*VnWtWm0C49\'"f4\'fI>0tiuU4XKU]xShOB@Ez.U?CnFFUZM=%lM', '37b9a926337766d3' ),
- array( 'yVDOk|{BZtuDE9dj4s@S80z^fV-%[zRUQw&>t"`PwWt=pZ)%NJYgZUF', 'cc6ba46fb041513c' ),
- array( 'B,TGgOz>"rD@gG"9?Y/]JigP92+!m`H0m|XUMStOF9o/`qH!KX^vBFG', 'a4c997dd620f2ff9' ),
- array( '\\YS^H4(Y"&2XSeM#,gs<HeeJ2>**aQR>+&|S;%-=,?v_&Db2-VNV=4!P', 'a07bd8ec425f5a4f' ),
- array( 'S+[5\\.Sh4Q=PWKnckeCq+\'%8^Tn|hpM={)RY8\'CMX`}1,luxR:j^Aov!', '84b7e4acb0c0a79a' ),
- array( 'Df}.WLKTV~/o&R=^3;p@)f9[!%;Cu2E:yCIRpu\'Ht68ziVZ|qL>z3WW5', 'e0f646c8b28fd049' ),
- array( ']rYS&~n!C8S5/[]%rv!\\M[Z@)x<<QtR/h,bo+QpNjEcz!B s:!Qg],)f', '05032e744464292c' ),
- array( '&E$W:Vf$cJsn{d>g+#b,Fb!`dSIB_R*ex/=4e%8JO,9LqX4|\\v*#Z+d?', 'd416e24b2f0208f8' ),
- array( '^.b?`m&Z|DncI(.y4HG\'"[%^S/b/;GOzU3:7!Ar~eac0iq*~;Q\'=.,|b;', '3927892869e71809' ),
- array( '_qW(AR^UmvV/iVtL:&7-06Hb>fqJdTfEG>Miq,?_#vomMe:hkQu|h?_\'\'', '6642fa162be3f787' ),
- array( 'RQk\'91OW^9IkX*oOz]}`xfLJ]I3}*;%]mpd\'"5^aN)M(4>X/{Vpu>=@|g', 'bc2d4f3aa4d38015' ),
- array( 'Tzro P]q6esKDVzN%#cC[r@3c6R"WOj,K]|K/[=EA2qfil5npy3LlT_Qj', 'f8e6d9128469532b' ),
- array( '2SCb?P.|MZ-*xSK,E3u3He$BxQ0N1b9D6]\'U.6S[p`fi52uZElnnRs2LE', '7277ce5e05c03037' ),
- array( 'CzW&5{=r$s!;H],*Dv?Wmz}Zim-] Z$DU[KjXh]\\\\_w&>%0b{O;iJ9E5\'S', 'f52c0085314b0fd8' ),
- array( 'r(.wMcSxN,a-i?maF,gVnd&+NQDtfLHZUVR#:&|i3_v| e_FqG|`,$k[U1', '69e03fdc5e6ef8b3' ),
- array( 'P=^xx4PK8jR6TeuLcu2C<%j9ew>RStd%2D}+YNWr:+)oq~=UtPx1UdK<\\i', 'ad82f3fd37f369cc' ),
- array( 'o0^U5qy4|ScUF~`OnRN-)D]"V3g"PDl@ULuk>o <DdrjcS;S\'j`1/>3eR{', 'a0a8ea76841101cb' ),
- array( 'h#@VDv#;bB,c_PHR<-\'W`/BA@R`T83P"7pX\\h\\wK~$/_TX2qe:IGIlhi?I', 'cc3c875a245445bb' ),
- array( '>X]n[t`4QIqJuqN%Q$^cuD}@kH.U2M Q\']@bS"w&KiPA[~G.$&rzKq<8:Jn', '36b37774404085a2' ),
- array( 'Mxn~ M?c!B[\'mFX0#XX1\\_%W,vtD2?4_8#^9P}|RAYZ0!3@$ky6HY<!f3u,', '6953f8802999c26d' ),
- array( 'E6@%NDdhtceH%@#5A6VF"P]K+yMq.D}TZ?Z*c?rX#Y"(z%==;sc>EBjP=9C', 'a93c088a44fbfc35' ),
- array( 'L]B!9a\\DE{8~ r!)m\'G+C;oaa3M3QfV}Ex _[\\%"Y>!Z1#c *+,MG|0)0^<', '4c23bc673f998d50' ),
- array( 'bEs`kmaLI?RKxpMT"P8#[D/)k,:u=x2!?&a,tDX>c+j]|82~iK"Eo2O\\?iR', '68fc83d0d7fbfe26' ),
- array( '\\ce]$k@0aei Iuk\'r$:qnet4V(d3GOf%3Lb79$Gzi2{4(g<zkWm[>cotkU)3', '1154a4047a591047' ),
- array( '%o88={PV!xQk+M 35=/"t}]3aN(M$2a)"zB?vrvxkHdwvd,-#<0w:n+{=4JB', '4241c775b22008a8' ),
- array( 'F-LI(oi b`xO*]H"CT0Fp@>,/J)M^Sp&a>Oi.:iq{bB\'@j)d@9+2ZJ>itG8T', 'd8a203d84a6e0ad0' ),
- array( '{)[]G+GVF2HBtjI6USzvm\')HRG2HnK|kTXI|dqS,${Nygx0>M,5;4>cffv/V', '71228d8490cbb004' ),
- array( 'B-BwfkuK]IXbF\'\\/!mMNybi/"NuhE&@g3b`yOVF.! pH(MW);&X6iCEkq<U7', 'f772a9177eddfcf8' ),
+ array( '9', 'af63b44c8601a894' ),
+ array( 'w', 'af63ea4c86020456' ),
+ array( 'v', 'af63eb4c86020609' ),
+ array( 'Q', 'af640c4c86023e1c' ),
+ array( 'd', 'af63d94c8601e773' ),
+ array( '"e', '07cc2f07b4942580' ),
+ array( 'pl', '08d53c07b5755019' ),
+ array( '@L', '090c3c07b5a49289' ),
+ array( '"N', '07cc5a07b4946e91' ),
+ array( '&O', '07bf3907b489ac22' ),
+ array( 'KE:', '50d8ad19d18c8505' ),
+ array( '",u', 'd511f317d88f429a' ),
+ array( 'RX7', 'a0549119ff001600' ),
+ array( '/<i', 'eea15a17e6ea5bbd' ),
+ array( 'Otx', '2ffdc919bf72be52' ),
+ array( 'w/qn', '9c6e50f771dcafd0' ),
+ array( 'aVqG', '4f1788838c1bcf9e' ),
+ array( 'G^hs', '33551d7dbbea0209' ),
+ array( 'a7z1', '4389ab82f4d6a7d0' ),
+ array( 'c@Lf', 'c14b5591800f1338' ),
+ array( 'MB:&Y', 'beb09d1ee59646d5' ),
+ array( 'ICDy9', '4f05ddd19c2c2285' ),
+ array( '>qH0a', '370b9a8e5a2329eb' ),
+ array( '*fSR/', 'f78a85007841cb19' ),
+ array( '3;$tS', '94b935103cc08938' ),
+ array( ' \'7AS}', 'd81e3aef0fde6ad8' ),
+ array( 'ou9vPc', '549f05284ed347f7' ),
+ array( ':u]S4O', '31b0206c95a52e7d' ),
+ array( '{D2\',e', '3a68240ea9539e62' ),
+ array( 'Y;yt@n', 'afdae733c98065a2' ),
+ array( 'IAu`bI_', 'c311eb3e8f9f51c4' ),
+ array( 'R@xIq]d', '3fa1984555c55e46' ),
+ array( 'g;8{k5@', '9e9c5e80cdc3d58e' ),
+ array( '}<Ldvh^', 'e5be53f31a393f34' ),
+ array( 'k*N6KDw', '558fdadc82fbb9d4' ),
+ array( '/nWb0Q-"', '84fcc8959c773b75' ),
+ array( '/qiK+e7@', 'd177962e1def962a' ),
+ array( '\'5]SzT=Z', 'befb197ea3aac960' ),
+ array( 'AH)WsNO$', '63dcf1c6c88d5426' ),
+ array( '=(fNZsPj', '806bfb067d62da41' ),
+ array( 'f:6q!M3(c', '5125f3e296d40b42' ),
+ array( 'p\\^Fz:gCC', 'b9ffcd384d90ba98' ),
+ array( '@7qp<0x#^', '1da17e378a5f0686' ),
+ array( 'Tw/?^JUQL', '85f6d1938d45b818' ),
+ array( '#dTfU2F|-', 'b66e4e092e385394' ),
+ array( '`dP%&hvv%(', '84523fb38ca2975d' ),
+ array( 'p)fE!vd`B;', '9c94c2a34d9f95c3' ),
+ array( '2n>vD&MVMJ', '1f4fd77c72b6004b' ),
+ array( 'd//546~,-$', '159ef268adc718d9' ),
+ array( '4~.{E/s*p6', '31a60e2db942bc67' ),
+ array( 'F#&dyJkG!:q', '33b8c68aed55c285' ),
+ array( 'eI"{^9zjG ', 'b42c013a2028584a' ),
+ array( 'F/|k>pv/(=3', '671c9537b41d76fe' ),
+ array( '.#-XoUZ*HAT', '84e0630a952577f4' ),
+ array( 'K>4d:~-: SI', '57deb72cc24c6bad' ),
+ array( '|@hn8xvV,%Y:', '157fda2502fe1297' ),
+ array( '^Jp:T9\\*ez>K', 'f784c17d1a2d1bd2' ),
+ array( '5>XP>-z<Mc,f', '6084bce050682a8b' ),
+ array( ']#=j)w&hBv#w', '7a2da4d0b1c01e1e' ),
+ array( '1_"vZ@Bp_{A}', 'e1e8fb095e4709fd' ),
+ array( ')<;W!G>^K\\JTT', 'dd737d6771e9cd69' ),
+ array( 'P>vGAoX"qP]3s', '0375e65060074988' ),
+ array( 'Nrooqy-.Q.Upm', '135d77993c647f43' ),
+ array( '"M8W"huy18ij:', 'aedeb2565e1c29f7' ),
+ array( '\\;wo0Gb!8UzEc', '59ae633a0b17a945' ),
+ array( 'LS:=B<kZtmDjhU', '2b2e674d9a46a36c' ),
+ array( '$S@>0\\7 l^cmw:', 'f21c8cb206540a2e' ),
+ array( 'h=}6q8T4U@nJ/3', 'b258eae8a4671c77' ),
+ array( '6wi:L*Y\\gp]UPB', 'bff5f2c9ed84bce5' ),
+ array( 'CH\\-fZDXsxlJ9\\', '298d4e05d5a47c45' ),
+ array( 'uIp,BZFne!KMr*#', '8641dfc04c9fb552' ),
+ array( 'CLGl)USdy-Yry$-', '3ab1497c481f22ab' ),
+ array( 'WyVH\'y#NhhO57B?', '8dea1d032c597f60' ),
+ array( ';fkbSt8(Z264&09', '4b875649e7cfa1a9' ),
+ array( '4g3k1:e4iN}9c6[', 'd33acc8fe01b77fd' ),
+ array( '$QBo4veM @`6UgGn', 'c4b17749dca1aa6a' ),
+ array( '{0#gA>MV(|TAaj}e', '067ae9cfff2cd6ea' ),
+ array( '=AVR8< 9]aO3Iw#E', '02bad50d48a8e564' ),
+ array( '(&-JD[!LYVm<Bl#_', 'ec868a84ae92c032' ),
+ array( '.Y2Gv3`Tt1h>)kd2', '9f7776edcdaf2937' ),
+ array( 'qq]6N_c)7REY?H:M"', '1899eee357e747b4' ),
+ array( 'Mtx`VNVg7uq#Z%uMc', '8eb7e5a4bb9fb739' ),
+ array( '-{Cp%ZCK5ctO2v}\'p', '58ebf399369565ce' ),
+ array( '^^@6GW,9[f?Q4#^1G', '76ab1ea61d68a738' ),
+ array( 'P7#tb9XWhjOgrAGQa', '29294a2d4b758119' ),
+ array( ']x9i3uPSGeW\'v~W.#L', '508d3356f8ec886b' ),
+ array( 'p<&I&pxmd:57{r06\\D', '4660b5543de2afdc' ),
+ array( ',.wTsO[jO4xSajog4u', '6d85fca5fba07683' ),
+ array( 'Y.c?HyVElg\\J,hY%>N', '01e82905c1f66c8f' ),
+ array( 'Uy:&/4Yq~IZ4@5B%Tk', 'a05cc808b297050e' ),
+ array( '~+1lrm8 Wr&uA[p[a!o', '22783c7a8fbe4826' ),
+ array( '<roeM$\'bG,73+CDx731', 'e00ac9dc3812b301' ),
+ array( '7j$>aFyS#\\TsxGc_uhf', 'a8cfc6804bc24e1d' ),
+ array( 'X0rpD~5iwL|*dh/#KU|', '17b538fc3a531c98' ),
+ array( '~YZSMS{14qzzK,n=PmR', '47a7dd2be021ae55' ),
+ array( ':f 8pd!!hMWeL1A!^u|p', '4c9d34c81b647804' ),
+ array( '*ol&<xtZIb-dJ.|<r~=[', '7d8483384e8a46c8' ),
+ array( 'LuBx\'dzfZwXehEk%>`_h', '25484f299d38dc95' ),
+ array( 'DmMn{K+oKILw?oqGTl/0', '8ecc9d0f58ead225' ),
+ array( 'eguN-bTLC55h$cX!0cq[', 'b3e4439d186da97b' ),
+ array( '.?TN/Fvd4&uznlJ{O~Is5', '983efebee9945885' ),
+ array( '_\\9C5;Sy-0)LdW[,NAAU7', 'c01a00203768a32c' ),
+ array( '<D%fATfjH{K&6n;QC6^T?', 'ef488311549372ed' ),
+ array( '+9wgEG*g}B$BGjd{QPEN{', '2c57de61c289de00' ),
+ array( 'Kdkg6/~uc>"}7jD^t,\\80', 'f83a6970b348b383' ),
+ array( ' _{e\\N6#|2Nb~7y/6orUrq', '26006911a7c5d137' ),
+ array( 'l]6LRC)jS*KPo)~&,{9Z^9', 'd848d0547a41bac1' ),
+ array( 'rXH)I;^<.KyExMh"9=-em|', 'ad7ca21d760bab1f' ),
+ array( 'nl$zh>UHWH" RL<1hJ]coV', '87be1c6aab3568a9' ),
+ array( '2XYKuf1cd Qhz;\'Qc^zf^M', 'fcb5e375b267b232' ),
+ array( '3z_|F>`6usoP?e8QJ|R{fM7', 'd6cd721ef468a686' ),
+ array( 'm {Mzc-Iv(*tOIVe@JVpj=*', '5ea4e77a701e1fd9' ),
+ array( '<g\'ndm=|\\=y*9]7cU@nJp9"', '256fbcae5dc6e749' ),
+ array( 'VYL.K7KUT4]DyLav*~p49OL', '55e66fa9c0b7f691' ),
+ array( '}%mlP^&R6` D,8pbl%A1~ms', '1d260b7fec06fa81' ),
+ array( 'vwsg--8Z,=Ixn) A?`BdlZVP', '1ac9ffbeaf2ceff1' ),
+ array( 'H[qZ[_NRXC;fQSA]qjV`sW#4', 'fcd1a44f1f9644d7' ),
+ array( '8Ey&!PVJ-H%i)T=bwXII-j( ', '20541ecba873cbbb' ),
+ array( 'V^`K6d`O+ZU,,,W:U\\$_2BB+', '817f942d64cdf041' ),
+ array( 'zlU)W])/=j[SP<$[wYh%f@@=', '8a852332f2c99373' ),
+ array( '}E|0g@<b-qleOuumaQA2nFnf ', 'f817c2a8dc3cac28' ),
+ array( 'Wlgw-%uR#\':DC}R5j8ea/SDau', 'be35effdcebfb5bc' ),
+ array( 'VP<E8=}%%u2+le/s S8}&Ni?4', '31a4b812c4ec4d45' ),
+ array( 'LOhp1_Ga|my;k~Ab2LOw\\Cx1[', '21bc5ceca29e51b8' ),
+ array( 'w7*aW?/() 9hHzf6u"#uCe(p5', 'de09593ecddfbfad' ),
+ array( '!MYz^5rv@UO`dWidpS-l:Db=GY', 'ba497ffae361581a' ),
+ array( 'a-bRCc!|_`3RWS)(5n`~TRSa?n', '7d6da8683f44e043' ),
+ array( '\'#,O]m\\@A!%B}d$18\\eAdz0Ezd', '964a554b2ea62312' ),
+ array( 'xOG9>O<K~y:\\;\\]@ [%$l=`S_E', 'a6d30ae05805da81' ),
+ array( 'OokJUez}~9M;eL6!)Q]fq]Bwa0', '52a0a33924a1e495' ),
+ array( '5Bdth4eU_;;Z9:tgVZ4m[=@:%3w', '4e3d8a502aad23d1' ),
+ array( 'H+YYA|>7fR|<39XmSsb;K>P9ymY', 'a30084c8ebfe7959' ),
+ array( '5sl-<xgv:d5RLhOh{iBi=6MYak*', 'e4a386d2c4782f99' ),
+ array( '{fxU{lC**=q!XW7+$ Zm|E0gcG5', '19e6ce2e2493a78b' ),
+ array( '=*"H&iA\\f/!p:>b<v;S"?T].Q#?', '226c52cdff2324cb' ),
+ array( ':ffP%pSMw=oT$ Uu:sYVkt+m5_KC', '08df2d276c9a057a' ),
+ array( '2OcL7J}<<Qj4nZisZ?iu4DL 9WmO', 'f02866cab6af3d35' ),
+ array( '8:sJjWw"#u>@H)T7d>,@^v6r;crU', 'ef8377919e2a1bad' ),
+ array( '<a&T|y gRxiUo)v83LPwk\\9JTO>o', '99a9a1a21c2ee2ec' ),
+ array( '31FOsL%pG%Yz}CQnMH\'`tWY`5r+i', '887cd200603d7a11' ),
+ array( 'BJZV["&PN+Bv1{q0@C~mk\'Oa_*Bt|', 'faad097477f65bd7' ),
+ array( 'N_@x:wU=}&l*Ic<EVLfyLUfS&H30k', '26a5acae427f26a8' ),
+ array( '(.:hN4$FiAEp.P:ql`I:GCf|+:$TM', 'bfe197dd01c4279a' ),
+ array( '4@VB[@qoD8Ze^Ks/ff|G07oT}m`9q', '60dffddf1fd785eb' ),
+ array( '5g&V>I2_;#$T]j3*^CqF@:WX*-Vxm', '05994a3217bb26d8' ),
+ array( 'oj#WqZv;lWVp[,OF?Y&cLM%f%]q24j', '151f45373d53bd27' ),
+ array( '!%U$]H_UcL-;>iGm0gH7KtdP\\i.N|C', '0b91af28a642cac4' ),
+ array( '9}Io#(8b]|0k8NU`=fIe}t[bF8MUfJ', 'fd58c24dc342b56c' ),
+ array( 'y ICoML(0+%Av>pM .4Is2?OufhC<O', '199280a86e05b101' ),
+ array( 'n6O8Z?f\'Hw2N9*m*Wn9k9.~Y^t@G9]', '732c4bf03e824fe5' ),
+ array( 'v(tFAPf(W0 j^:uMDM<^:Vl90K/PrH/', 'ad49c5c4b29581d8' ),
+ array( 'jQ$1rTx{-*{xi7n7\\=T;X+(r;T"lHK{', '74f8023eb53a4c87' ),
+ array( '3|!EpV?lcIi]3!LK]j xC,"6HW85 d2', '45f93db9ecbd61e2' ),
+ array( '4a4YSjy@NC+,V,Y#jE#dh/f~W?8m?}!', '628239fa1e9fbf4c' ),
+ array( 'T_5/3 )TOL_\\$l7\'W\\+<E;$ErC^ac\\b', 'c4d6aab371c199b4' ),
+ array( '8=xGQyP&I}f&"S>*+z6GAQLfDoF\'S#jk', '97ef2b6a27cfe08b' ),
+ array( '@c3q]dx(b_/e3Mp?H\'gjX4Q}$w%X{pE<', '8a65a0d9c497dca7' ),
+ array( 'TY/3>(;"hJg{wY<A`$,:8^8=W>vS/<pd', '7d99f135b9dd392a' ),
+ array( 'u w4)46r^~nWX,x:0%TIdmg<,^o<z`"p', 'a3296f83b9d4178e' ),
+ array( 'az%k/<^m<NEtZ?0kDd5*R|F_[6|Ww~HZ', '6971ed23982e966c' ),
+ array( 'yNG)j&w\'U>|1]-|#r3-E0S&lj$Db#m>}<', 'b3fb4982abc0e4c0' ),
+ array( 'e(\'l!/C?-T|:Q -d.SuaZcM^)1bvOa36i', '031098cfb4e50d1f' ),
+ array( ';$jKG+X{(sN)"48U+z1oHoxYSo*5$@ ?D', 'd2ee11dc187ad41e' ),
+ array( 'kjlvDi 89*:MBpY="IfrB@G3J\\7k\\W1HB', 'fee80db84822febc' ),
+ array( '}@gh@ "K:Pm,*,.Tr"w4I+_\'CKcz]->\\N', '849ddd5ac8830991' ),
+ array( '&En&G;Aw*M#6\\W*_O?)[~0~Kty)#9eQ?+A', '58f765bdd716e1c2' ),
+ array( 'FS\\hLf6O}s\')SWH]3Hn3sc.|gGc:go[/C9', '1ef7be10e1e94525' ),
+ array( 'wo!/@ #H)W R54z$GnhVlP}QkfAGueamVc', 'fb192bd95f5f88b2' ),
+ array( '|vc!?mX?@mT<r|+\\Sx.RJy9lB/R$})h{ L', '3f2604691e2ced49' ),
+ array( '|?;U_[D4x81%te}#8I}Q6@ahE_q.[r[Y3v', 'cb8807aabe087372' ),
+ array( '/rST(Ll:Qb Pf8yej0&LyL-lZi_6Cs.Sga(', '4c6bc9be092660cd' ),
+ array( 'o/u+aY,2@D-&0>-\\8Yj&5TeLxZZLB=T3MK>', '9207d0b883378aaa' ),
+ array( '/%JBFoOM n[]\'5H-K}swvORCqpx%>EDNKnp', '34c18ad3e2030b27' ),
+ array( 'q_A@_0{>82gF]e:V]j*!\\zza:@&hkuZ^U{ ', 'ff47e63839babc22' ),
+ array( '6,|UD/=jm$&DapOcNJ^0e 7Nl.*Ld&Lz3IP', '8fc04f6e48534104' ),
+ array( 'WYnCGrJlT<<8jgw{Mx4|eB\'2\'._#A)SybC>+', '444cf38629f9f5e6' ),
+ array( '6hxk&5$p}|lKu!I\\DQoK_ON!X#{<G:H]#AI*', '93be8d30fbf2a711' ),
+ array( 'WNzUKh"BjL~/}o[]?+_x.[6Vu^4y ^$X- .Y', '0457576f79c1af9f' ),
+ array( 'h1{T]{c[k?:+Ky%ZV;1MzEHz$MT1Mbk7sgkR', '60d5a7492fab7ad1' ),
+ array( 'dP.PpH\\<Cbvz}(HxNqtS?Iem-Q%":qT~CcP4', '0005d93c99685bc1' ),
+ array( '-.QPpIKoRth!f^U\');t7ly9\'ln\'0RWE_ew1VA', 'e13bf2cdf312dd7b' ),
+ array( ']FsR0u:oKAxg61U1J\\~9d0l<UL#N]Zo;"dn3[', '53d2c531034cdde3' ),
+ array( '*#\'K|ob.EsY#rsg$`%Y.((lcx(e]wx9"|ANy1', 'e16aa67d2eb4115b' ),
+ array( '1)V%bYxVB}8GWFP`34Z<z95tS7qtek\'wt^}X9', '5511e58643ea102a' ),
+ array( 'w/[uH$NnU0#jj?e$TZWlLMS9UK/4IgNAw+7@0', 'c03ee6776b09be84' ),
+ array( 'e0eu3PaS7f)r?v?lJYCvhXAP\'bI3ziCaz)X.Z:', '6e63e154ba982b2f' ),
+ array( 'bq!kd@c%.._R&H+Gy3+CG&.jh)tA8P[zC]g)~K', 'd191830ad78ef4b4' ),
+ array( '..Zn``7l(2 3VG:e3#o)D(Y!$|_k&^85lr$MT<', '7aa3d56eb663566f' ),
+ array( ':]O;p&c,lv0\\ UdZVhW6U^umtbax066KsefelK', 'ea574dd4514d7c68' ),
+ array( 'qYB#6CX{~0dVF;6=)+ j%1"<\\u"D[ooNI3Q`W+', '58f171ded41e0193' ),
+ array( '\\V;B.b^D gP SV1VrnLu4)f$W18*qo5OGPrU3Qz', '11baf93d39928abd' ),
+ array( '4:L4n#FEv5rmJ{TOTeg^XXt( EzVYLRmg #V$I{', '0ac0c936f7521a28' ),
+ array( 'z_nh*k>Y@$B~\\zte{:`St.\'cu\'fL+1I\'q9p{%/V', '1a0c38f41c1826e8' ),
+ array( 'E4yEpu:WqU8FJGM/=Uvja(4hyMYvSiNx}H>o?YH', '75024234e0476c05' ),
+ array( '2/`XZ(\'jF\\a1?iF(dtb\\HM+BLTa<t;d\'KF_\'Ogq', 'bdcaffa418ba3eda' ),
+ array( 'vES(d>Om#EP`n}l1JBsg70M>[t~bDfU;-)DqGt_K', 'bda836f33c0092dc' ),
+ array( ':1-)0y;Z</CS?pq{eq^+Y4Gf>lYfa:2|K?&\\:B7V', '16e6a228513a03c4' ),
+ array( 'QZ+qL}m3oM?Ibf1!Tjh6&z4R;;/V]F-0"8#O6pc\'', 'd272ca04df7d0554' ),
+ array( '?#P"jb$?MlVThj\'%&6[d]it`#w19itA)wr,bU1##', 'c1b2b80d012bdf50' ),
+ array( '}ZXgE_lLvI1T3\'67 GQi<rs5e!x;2|?1Wwx}WfJN', 'bdd12a4f05766cfe' ),
+ array( '1\\$Ed;\\dc.O !D6fE/#X,Bic:carJ-B\\jG"Ob^4Fl', '9667031dfb5a16c7' ),
+ array( 'dGm)^UOmX(zzq_6VB)"PK^;s`jV? },dFzn%Q>s*G', '166ff835024396df' ),
+ array( 'n&:O=pqGrBsQ^g2J>RJ=_0c[ i->]8eL?!|\\qo$e3', 'bd73d9e41ae5c6d8' ),
+ array( 'w7q_J<~|g=]w!9wjF7I^}v}~s[pc_VvXnh9:&87mV', '81bed0679537a583' ),
+ array( 'ueW/^CUul5tc4sXoe<P=4*,}CF$\\^q3TXjd8/;.|P', '823ceb765e67c7a8' ),
+ array( '#aew:U]W\'{k1(iTOm1/`Dd:0JR@ea>6e {]:R<qZ8^', '3d7194b6e03cc23b' ),
+ array( 'kAHAq7S"wxf3*1eJvGh.-h+j$^(v9@U&b~GT7zV0s>', '01e47424ff38f337' ),
+ array( 'C}P)IHP3V]|bI!BQx[rOaUO*+f&bvz!:yQDCzuVRTT', '55e116dfbdeaffb3' ),
+ array( '5}VWPO4D vzO!&7(h.#jI|=nA8dxj9M 8$XhTm.Td)', '5ccd76496410ea5e' ),
+ array( '%f0<nxKrcup!d2:J,%cZ&{^^e4Lsi2}nx.,h\'X[kOM', '99b5ca1d7ad80276' ),
+ array( 'm5`(_l.DG4@\'s\';A{%SytM("60[r|+@jA!s"n"F77g>', '42c09c31678d6f41' ),
+ array( '+nZLj`!dUNmXe}4Yz@zfb|[dk^+#urB!a|NM^P25 !m', '7c2bc1c66d9f0223' ),
+ array( 'e~#?zD:a\'8=l${w(qkKsNIC{(s/=t0,Z0/z+T6l\\N+I', '8b024f00082671f5' ),
+ array( 'S\'B\\y/(n]Q3ZY(jv|{$W,3S8hi&E91ol92I3BR# $6[', 'f90f149aea3b4fff' ),
+ array( ']?FU<BZtOmHgW3m}M m:9!dMC7QD<h y(GPDj+:;yc#', '216ea9a72de9aadc' ),
+ array( 'RwqPEr>`,@EZc],)yt*t|QFB<R\\WMA[ 9NQ^Ao?N1e)u', '9a53a5fdb4a3fea9' ),
+ array( 'C5~>*)4([ZJw-(P[I-[b\\-A}}aM/GV&kl%+w/? jyJc(', '7a9e26e4aeb98fc9' ),
+ array( 'R5c|B@_~N"}McK\\,#cxpi%hxDhd?3HHf^,c!MD!{F I+', '4f0136432df156d5' ),
+ array( 'L\'8Oj1@U6)N[r4z\'\\Cm;PR=}v?z>?EIkLa;8s\\m+f=fZ', 'c2587023e1d5b660' ),
+ array( 'Qaa/&PKV#iTz)P9Huc4CFP\\:-KEth,O;n1JtavKe`!ai', '50683e95eabc367d' ),
+ array( 'R{2H_Fl\'vIA%tgy^tJyd\\EY><&%}(fgZby#CApJ8:l>0U', 'f16422882c0082cc' ),
+ array( '9nJci0@/i_LoeJxL2S0-WTNH gbl&rC?bn$L~E[h%)YkS', 'b8c4873ffdaf0fac' ),
+ array( 'R8f\'Is^}C\'}+jk2^/QA}Vm|{If"SAm\'t\'m{PbZO&bN2M:', '948738b38e532172' ),
+ array( 'D,JvNIM<GJf.L:P:AEB0Ars|Cy_q-.-Q;XHi"v&IAmXn(', 'afd0b1e73ddced08' ),
+ array( ')*JNL[p@OmcJNVW]d*y=Sc?JjhlYB\\aKf-z4hkT9Z9d*p', '1dfd3ac789532668' ),
+ array( '=gUGarzF3F2|4k?qNjX[fmERC_.\\D8Nb!$*cw&*+M=(b*G', 'c7ce7d6de622765c' ),
+ array( 'TX3.5y{[M?<[|`sKDtPNXHUcT#"\\e,%;e9I{4FWaes>cU2', 'f0fa521206e1c67b' ),
+ array( '0y(aIa*~F_#H<iUB%;\\N7punS[cq@:%Q4-3]o=]7|`_:J5', 'a38fb64baf6368b4' ),
+ array( ']PQ: h,uX_R=QrWWDkdWJUu(lsiM/5cme5)e~5\\Wu/uH#M', '885465855ee39187' ),
+ array( ' G:e d;vm)kWWzm;hSPr:P)v)~\'~G*LHQf.RLJI:S5r,1`', 'de1bd4eebc876571' ),
+ array( 'Gz5xmPIvGRvNQ>Y~f+fu^4@)Ot>B!P$HK:B:jk13?(bqG<p', '5fce9e2beab28428' ),
+ array( '/HX%\'lF0<;O_< ceL~(fitx}4"`&I|wYFP_M=&^YA.:^/}E', 'babb5873a7b954a2' ),
+ array( '[}MCgC<eW>G^hEVCk\'#:E)y K):+89Pt7~8 BTfzs.Y\\T0 ', 'a4dcad2a3d27a8c5' ),
+ array( '@8#[^-U_Y^ydw45lL5%LXZ3SNB.,v?,8X0t7>Jvw*q\\"\'rn', '5fce337a1b15535d' ),
+ array( 'S)t aO46}VD*Nd7g=H\\Uf\'M^2?;4F/$y8xzzH/1GfVR5;j}', 'd650a004f4a4a934' ),
+ array( 'X3Z.yb[Xt{t*C$.>=\'98PHJx0!KF<6DuI~%Dba|X^rb"wp@5', '26f61f52e18a413f' ),
+ array( 'xYNI#xB4ynZ7& .P 3tbtr;Te}V^nwshRC2V<Uj7DFOKF]{F', '955141b7150fa2c1' ),
+ array( 'pp)fcE;JCr)3j}{=A/s^d^v*%FUL$QrtC|\\(BwRfk\\yVZvs|', '26761cf7ed795ba8' ),
+ array( '\'h\\kGSvMzLy~~ltBiQJ-J}s6Znl6ea4lJqYrFPAA};@})5@s', '7e915de5eb615078' ),
+ array( 'fk"2juHFd6\\Jxq8Ddr7+CYLBul@ #atjMv|8lF^Q]<|V/6zs', '7313e5cd61f71972' ),
+ array( ')3~MmKoc91c<rX\'AO%Z<K9n)Vl`f#\\Z,oZY^\'JB@[&]O_ep/j', 'b8b744c7e5836f88' ),
+ array( 'KL7e;A=)"$,^^9O9s.A>QazW@J7&<Gqgs*N0Kk:NoF.O_^iSl', '71567bade5dcc22e' ),
+ array( '+r?lnv.:/4VW\'?L1m]]Yw,I>;x~ycSgnG\'\\6~jP/ \'f\'G395q', 'b52ab992b89a25eb' ),
+ array( 'wni%9(@3(:v["e#*B:)-j8-r 5:4OO&G?oLXxll!(c]*Ja4l{', '05178f3f6d1bd723' ),
+ array( '>zgV)ZW?tknEq6dbb>[P+]Xo<c:}x(z7$bn-=FL33;Y&R>h6]', '2d02887219c5f7ba' ),
+ array( 'Efi$@Y@$s?||:4!}$/<J[O]w)cKHMa&rIpwiJ8n?Xk<s!>q%M.', '7402cada54c164fc' ),
+ array( 'P*^."grN1A085Z)-DSF3s~ 0r!Nd\'{sW&Rf);ZWL{hd2Cn?hBf', '7d506df1306b7bd3' ),
+ array( '|6e|GY~v?\'s3^zeE%"!\\N|F40j#OSE7Q\\|N%VN{vUo*5jpZor\\', '2f6a27e5596405bc' ),
+ array( 'MBYtVj_Y:4 Qe]O5b\'d_};O)P;y,,mhZ0COf.0AIEB{, KBcS\'', '584088c026129ecb' ),
+ array( 'CRCr[s/V ;EivU-F=;W_e|"a*".LeaT*5w|pk-HlImW@Ddga!?', '52d26109c3976242' ),
+ array( 'Bf=DIGGWt.:I8OA6@.ChzmWR.{8v^:7!!TEJ|m#q{=;5l]K.kow', '0664b26c38a5d953' ),
+ array( 'g]O;lKSc*mz+oPQ;N@>A<[]RI;}W\'mOnL *9K^}VLxb=J4XyTw;', '614bf3c3f15ec6d4' ),
+ array( 'qTxD}4CV;2\'+^\'5xStv*Apl_<"96W1QIeKnd`3;|EC(%J>~~3u)', '75c7984cbfee5c09' ),
+ array( 'Ugv5$xN;P`mzF9j,y}HvDk I7>H6Q??((6=-0lH`M7\\tPG!KFIC', '08249b54b4e80e4a' ),
+ array( 'j6C5Mb^d5~%=\'<[5LH].vtkkF3mrZ86FNZ[|=;bR:gpB$LWQu6`', 'd86b2b1dc38a51fe' ),
+ array( 'l,LYR_GF;_\\a/8=-VYo*sXz7\\Hn/>%o+1<ed|-+8mhy}!8+Wq{ae', 'de82683d6c863f8e' ),
+ array( 'T]}2&lADr2P$N6iKDud3^^1`w=9i:{PoYN"`;D%/VV4&m}R3s7FS', '1585883d76b8ad21' ),
+ array( 'vX4nvNX1J)"%X$etIk$!C8\'27YE+pl_hFtW=C0On:QtrV[g Hk!k', '0fcab3a55bc257eb' ),
+ array( '%)}<bDHT1(=W|uuA&F1@x&4Oa{P*hRvm[u*?;RtM[3&Y){z0C-Q<', 'f8b622573f260ed6' ),
+ array( '3ekub=!Kox9LnDl+waXSu^.~[*/~7`<JG(A*EBU6;ob+4O6-2oa(', '9cfe1752ba2120c5' ),
+ array( 'Oo(+y8+1yG\\AP}KvA"-\\qph\'A 5Tov]@geKa}Wsw Q:PPfHqhVO[H', 'bbfbf47f5e41f626' ),
+ array( '9ci9x?*o|JXbv:aN/ZO`u!2\\I$E T"Hme3(^R2OO\\(3TCu$SQS4GT', '0fd77de0e48a299e' ),
+ array( 'G$}LJ~!LHo2[wq/*A^gJr<niAB;tWbJ~fIK1HL]p<pM5b\\?%<(P0E', 'ff59a87c858ded0c' ),
+ array( '?yfa5[9w&8_Pdqx2OjOA8d$u%*2-ZBSy<:[RvuK}/+Ns|G&M3VnL;', 'c15664e583440709' ),
+ array( 'sB@}TNXw"R5=/g4%424?`)=)/j<fZh"N,CLar&YtXo3gXGmlY#,:,', 'ed2cece5fae7e40a' ),
+ array( 'JD;6`"pJ%@VIm9<sr2McE6<l$)G\'6b3`\'OvgRh3X)j"v$>kwP9[vOw', 'af6317fd2ec74937' ),
+ array( 'cS!+[7nnxu?o^qXqJb\\LZakFY=_54/.xc/%?Gs/@iN1H@j;kNw9)Z%', '176ecfc36ff0fb5e' ),
+ array( 'O4B0JW@XP$hUC1IRR4"d\\BOw/~pH(KMX`ph,H)ex-OOQ`x%4.\'xkJI', '2e7bda1a61ef9b56' ),
+ array( 'cYHU#Q"P*bBroj|Uc+%4]f-c{<jt(6?lphBs:DEE(g9wR6N7ASK ;Y', '3d2b93b2479f85fc' ),
+ array( 'c7vO-~eMkW7.LRSqw\\Z1U.H$EjXqjtLN,C}:Bcg/<~>hQq[JO6[%D$', '62a5e1665612c6c0' ),
+ array( '*jnc]YX*)eN\' qjh!(g?p:2LdacAf)Fqt6URp.]yt-!t~l] tF@faR4', '547b12c39bb0fdf3' ),
+ array( 'G4wh{"0mvFCI7R(1G53=4 {5tBV\\%)pL>h6:jF)blM,% 57HJJe_Jau', 'c22639e2811d6816' ),
+ array( '@%L|*VnWtWm0C49\'"f4\'fI>0tiuU4XKU]xShOB@Ez.U?CnFFUZM=%lM', '37b9a926337766d3' ),
+ array( 'yVDOk|{BZtuDE9dj4s@S80z^fV-%[zRUQw&>t"`PwWt=pZ)%NJYgZUF', 'cc6ba46fb041513c' ),
+ array( 'B,TGgOz>"rD@gG"9?Y/]JigP92+!m`H0m|XUMStOF9o/`qH!KX^vBFG', 'a4c997dd620f2ff9' ),
+ array( '\\YS^H4(Y"&2XSeM#,gs<HeeJ2>**aQR>+&|S;%-=,?v_&Db2-VNV=4!P', 'a07bd8ec425f5a4f' ),
+ array( 'S+[5\\.Sh4Q=PWKnckeCq+\'%8^Tn|hpM={)RY8\'CMX`}1,luxR:j^Aov!', '84b7e4acb0c0a79a' ),
+ array( 'Df}.WLKTV~/o&R=^3;p@)f9[!%;Cu2E:yCIRpu\'Ht68ziVZ|qL>z3WW5', 'e0f646c8b28fd049' ),
+ array( ']rYS&~n!C8S5/[]%rv!\\M[Z@)x<<QtR/h,bo+QpNjEcz!B s:!Qg],)f', '05032e744464292c' ),
+ array( '&E$W:Vf$cJsn{d>g+#b,Fb!`dSIB_R*ex/=4e%8JO,9LqX4|\\v*#Z+d?', 'd416e24b2f0208f8' ),
+ array( '^.b?`m&Z|DncI(.y4HG\'"[%^S/b/;GOzU3:7!Ar~eac0iq*~;Q\'=.,|b;', '3927892869e71809' ),
+ array( '_qW(AR^UmvV/iVtL:&7-06Hb>fqJdTfEG>Miq,?_#vomMe:hkQu|h?_\'\'', '6642fa162be3f787' ),
+ array( 'RQk\'91OW^9IkX*oOz]}`xfLJ]I3}*;%]mpd\'"5^aN)M(4>X/{Vpu>=@|g', 'bc2d4f3aa4d38015' ),
+ array( 'Tzro P]q6esKDVzN%#cC[r@3c6R"WOj,K]|K/[=EA2qfil5npy3LlT_Qj', 'f8e6d9128469532b' ),
+ array( '2SCb?P.|MZ-*xSK,E3u3He$BxQ0N1b9D6]\'U.6S[p`fi52uZElnnRs2LE', '7277ce5e05c03037' ),
+ array( 'CzW&5{=r$s!;H],*Dv?Wmz}Zim-] Z$DU[KjXh]\\\\_w&>%0b{O;iJ9E5\'S', 'f52c0085314b0fd8' ),
+ array( 'r(.wMcSxN,a-i?maF,gVnd&+NQDtfLHZUVR#:&|i3_v| e_FqG|`,$k[U1', '69e03fdc5e6ef8b3' ),
+ array( 'P=^xx4PK8jR6TeuLcu2C<%j9ew>RStd%2D}+YNWr:+)oq~=UtPx1UdK<\\i', 'ad82f3fd37f369cc' ),
+ array( 'o0^U5qy4|ScUF~`OnRN-)D]"V3g"PDl@ULuk>o <DdrjcS;S\'j`1/>3eR{', 'a0a8ea76841101cb' ),
+ array( 'h#@VDv#;bB,c_PHR<-\'W`/BA@R`T83P"7pX\\h\\wK~$/_TX2qe:IGIlhi?I', 'cc3c875a245445bb' ),
+ array( '>X]n[t`4QIqJuqN%Q$^cuD}@kH.U2M Q\']@bS"w&KiPA[~G.$&rzKq<8:Jn', '36b37774404085a2' ),
+ array( 'Mxn~ M?c!B[\'mFX0#XX1\\_%W,vtD2?4_8#^9P}|RAYZ0!3@$ky6HY<!f3u,', '6953f8802999c26d' ),
+ array( 'E6@%NDdhtceH%@#5A6VF"P]K+yMq.D}TZ?Z*c?rX#Y"(z%==;sc>EBjP=9C', 'a93c088a44fbfc35' ),
+ array( 'L]B!9a\\DE{8~ r!)m\'G+C;oaa3M3QfV}Ex _[\\%"Y>!Z1#c *+,MG|0)0^<', '4c23bc673f998d50' ),
+ array( 'bEs`kmaLI?RKxpMT"P8#[D/)k,:u=x2!?&a,tDX>c+j]|82~iK"Eo2O\\?iR', '68fc83d0d7fbfe26' ),
+ array( '\\ce]$k@0aei Iuk\'r$:qnet4V(d3GOf%3Lb79$Gzi2{4(g<zkWm[>cotkU)3', '1154a4047a591047' ),
+ array( '%o88={PV!xQk+M 35=/"t}]3aN(M$2a)"zB?vrvxkHdwvd,-#<0w:n+{=4JB', '4241c775b22008a8' ),
+ array( 'F-LI(oi b`xO*]H"CT0Fp@>,/J)M^Sp&a>Oi.:iq{bB\'@j)d@9+2ZJ>itG8T', 'd8a203d84a6e0ad0' ),
+ array( '{)[]G+GVF2HBtjI6USzvm\')HRG2HnK|kTXI|dqS,${Nygx0>M,5;4>cffv/V', '71228d8490cbb004' ),
+ array( 'B-BwfkuK]IXbF\'\\/!mMNybi/"NuhE&@g3b`yOVF.! pH(MW);&X6iCEkq<U7', 'f772a9177eddfcf8' ),
);
$i = 0;
$pass = true;
foreach($tests as $test) {
- $result = hash('fnv1a64', $test[0]);
- if ($result != $test[1]) {
- echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n";
- $pass = false;
- }
- $i++;
+ $result = hash('fnv1a64', $test[0]);
+ if ($result != $test[1]) {
+ echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n";
+ $pass = false;
+ }
+ $i++;
}
if($pass) {
- echo "PASS";
+ echo "PASS";
}
?>
--EXPECT--
diff --git a/ext/hash/tests/hash-clone.phpt b/ext/hash/tests/hash-clone.phpt
index d5d4205354..57567c0bc5 100644
--- a/ext/hash/tests/hash-clone.phpt
+++ b/ext/hash/tests/hash-clone.phpt
@@ -6,24 +6,24 @@ Hash: hash_copy() via clone
$algos = hash_algos();
foreach ($algos as $algo) {
- var_dump($algo);
- $orig = hash_init($algo);
- hash_update($orig, "I can't remember anything");
- $copy = clone $orig;
- var_dump(hash_final($orig));
+ var_dump($algo);
+ $orig = hash_init($algo);
+ hash_update($orig, "I can't remember anything");
+ $copy = clone $orig;
+ var_dump(hash_final($orig));
- var_dump(hash_final($copy));
+ var_dump(hash_final($copy));
}
foreach ($algos as $algo) {
- var_dump($algo);
- $orig = hash_init($algo);
- hash_update($orig, "I can't remember anything");
- $copy = clone $orig;
- var_dump(hash_final($orig));
+ var_dump($algo);
+ $orig = hash_init($algo);
+ hash_update($orig, "I can't remember anything");
+ $copy = clone $orig;
+ var_dump(hash_final($orig));
- hash_update($copy, "Can’t tell if this is true or dream");
- var_dump(hash_final($copy));
+ hash_update($copy, "Can’t tell if this is true or dream");
+ var_dump(hash_final($copy));
}
echo "Done\n";
@@ -301,7 +301,7 @@ string(16) "bebc746a33b6ab62"
string(16) "893899e4415a920f"
string(5) "joaat"
string(8) "aaebf370"
-string(8) "513479b4"
+string(8) "836fb0e5"
string(10) "haval128,3"
string(32) "86362472c8895e68e223ef8b3711d8d9"
string(32) "ebeeeb05c18af1e53d2d127b561d5e0d"
diff --git a/ext/hash/tests/hash_algos.phpt b/ext/hash/tests/hash_algos.phpt
index 87efdc9213..cff71a7771 100644
--- a/ext/hash/tests/hash_algos.phpt
+++ b/ext/hash/tests/hash_algos.phpt
@@ -3,17 +3,10 @@ Hash: hash_algos() function : basic functionality
--FILE--
<?php
-/* Prototype : array hash_algos (void)
- * Description: Return a list of registered hashing algorithms
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
-
echo "*** Testing hash_algos() : basic functionality ***\n";
var_dump(hash_algos());
?>
-===Done===
--EXPECTF--
*** Testing hash_algos() : basic functionality ***
array(53) {
@@ -124,4 +117,3 @@ array(53) {
[%d]=>
string(10) "haval256,5"
}
-===Done===
diff --git a/ext/hash/tests/hash_copy_001.phpt b/ext/hash/tests/hash_copy_001.phpt
index 8cd620e26d..271326178d 100644
--- a/ext/hash/tests/hash_copy_001.phpt
+++ b/ext/hash/tests/hash_copy_001.phpt
@@ -6,24 +6,24 @@ Hash: hash_copy() basic tests
$algos = hash_algos();
foreach ($algos as $algo) {
- var_dump($algo);
- $orig = hash_init($algo);
- hash_update($orig, "I can't remember anything");
- $copy = hash_copy($orig);
- var_dump(hash_final($orig));
+ var_dump($algo);
+ $orig = hash_init($algo);
+ hash_update($orig, "I can't remember anything");
+ $copy = hash_copy($orig);
+ var_dump(hash_final($orig));
- var_dump(hash_final($copy));
+ var_dump(hash_final($copy));
}
foreach ($algos as $algo) {
- var_dump($algo);
- $orig = hash_init($algo);
- hash_update($orig, "I can't remember anything");
- $copy = hash_copy($orig);
- var_dump(hash_final($orig));
+ var_dump($algo);
+ $orig = hash_init($algo);
+ hash_update($orig, "I can't remember anything");
+ $copy = hash_copy($orig);
+ var_dump(hash_final($orig));
- hash_update($copy, "Can’t tell if this is true or dream");
- var_dump(hash_final($copy));
+ hash_update($copy, "Can’t tell if this is true or dream");
+ var_dump(hash_final($copy));
}
echo "Done\n";
@@ -301,7 +301,7 @@ string(16) "bebc746a33b6ab62"
string(16) "893899e4415a920f"
string(5) "joaat"
string(8) "aaebf370"
-string(8) "513479b4"
+string(8) "836fb0e5"
string(10) "haval128,3"
string(32) "86362472c8895e68e223ef8b3711d8d9"
string(32) "ebeeeb05c18af1e53d2d127b561d5e0d"
diff --git a/ext/hash/tests/hash_equals.phpt b/ext/hash/tests/hash_equals.phpt
index 0c8ab42f93..69e23eea0f 100644
--- a/ext/hash/tests/hash_equals.phpt
+++ b/ext/hash/tests/hash_equals.phpt
@@ -2,21 +2,36 @@
Hash: hash_equals() test
--FILE--
<?php
-var_dump(hash_equals("same", "same"));
-var_dump(hash_equals("not1same", "not2same"));
-var_dump(hash_equals("short", "longer"));
-var_dump(hash_equals("longer", "short"));
-var_dump(hash_equals("", "notempty"));
-var_dump(hash_equals("notempty", ""));
-var_dump(hash_equals("", ""));
-var_dump(hash_equals(123, "NaN"));
-var_dump(hash_equals("NaN", 123));
-var_dump(hash_equals(123, 123));
-var_dump(hash_equals(null, ""));
-var_dump(hash_equals(null, 123));
-var_dump(hash_equals(null, null));
+
+function trycatch_dump(...$tests) {
+ foreach ($tests as $test) {
+ try {
+ var_dump($test());
+ }
+ catch (\Error $e) {
+ echo '[' . get_class($e) . '] ' . $e->getMessage() . "\n";
+ }
+ }
+}
+
+trycatch_dump(
+ fn() => hash_equals("same", "same"),
+ fn() => hash_equals("not1same", "not2same"),
+ fn() => hash_equals("short", "longer"),
+ fn() => hash_equals("longer", "short"),
+ fn() => hash_equals("", "notempty"),
+ fn() => hash_equals("notempty", ""),
+ fn() => hash_equals("", ""),
+ fn() => hash_equals(123, "NaN"),
+ fn() => hash_equals("NaN", 123),
+ fn() => hash_equals(123, 123),
+ fn() => hash_equals(null, ""),
+ fn() => hash_equals(null, 123),
+ fn() => hash_equals(null, null),
+);
+
?>
---EXPECTF--
+--EXPECT--
bool(true)
bool(false)
bool(false)
@@ -24,21 +39,9 @@ bool(false)
bool(false)
bool(false)
bool(true)
-
-Warning: hash_equals(): Expected known_string to be a string, int given in %s on line %d
-bool(false)
-
-Warning: hash_equals(): Expected user_string to be a string, int given in %s on line %d
-bool(false)
-
-Warning: hash_equals(): Expected known_string to be a string, int given in %s on line %d
-bool(false)
-
-Warning: hash_equals(): Expected known_string to be a string, null given in %s on line %d
-bool(false)
-
-Warning: hash_equals(): Expected known_string to be a string, null given in %s on line %d
-bool(false)
-
-Warning: hash_equals(): Expected known_string to be a string, null given in %s on line %d
-bool(false)
+[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, int given
+[TypeError] hash_equals(): Argument #2 ($user_string) must be of type string, int given
+[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, int given
+[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, null given
+[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, null given
+[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, null given
diff --git a/ext/hash/tests/hash_error.phpt b/ext/hash/tests/hash_error.phpt
index e760819e69..b5c0388091 100644
--- a/ext/hash/tests/hash_error.phpt
+++ b/ext/hash/tests/hash_error.phpt
@@ -3,44 +3,18 @@ Hash: hash() function : error conditions
--FILE--
<?php
-/* Prototype : string hash ( string $algo , string $data [, bool $raw_output ] )
- * Description: Generate a hash value (message digest)
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
echo "*** Testing hash() : error conditions ***\n";
-echo "\n-- Testing hash() function with less than expected no. of arguments --\n";
-var_dump(hash());
-var_dump(hash('adler32'));
-
-echo "\n-- Testing hash() function with more than expected no. of arguments --\n";
-$extra_arg= 10;
-var_dump(hash('adler32', '', false, $extra_arg));
-
echo "\n-- Testing hash() function with invalid hash algorithm --\n";
-var_dump(hash('foo', ''));
+try {
+ hash('foo', '');
+} catch (ValueError $exception) {
+ echo $exception->getMessage() . "\n";
+}
?>
-===Done===
---EXPECTF--
+--EXPECT--
*** Testing hash() : error conditions ***
--- Testing hash() function with less than expected no. of arguments --
-
-Warning: hash() expects at least 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: hash() expects at least 2 parameters, 1 given in %s on line %d
-NULL
-
--- Testing hash() function with more than expected no. of arguments --
-
-Warning: hash() expects at most 3 parameters, 4 given in %s on line %d
-NULL
-
-- Testing hash() function with invalid hash algorithm --
-
-Warning: hash(): Unknown hashing algorithm: foo in %s on line %d
-bool(false)
-===Done===
+hash(): Argument #1 ($algo) must be a valid hashing algorithm
diff --git a/ext/hash/tests/hash_file_basic.phpt b/ext/hash/tests/hash_file_basic.phpt
index 283cc37527..0aa80a988e 100644
--- a/ext/hash/tests/hash_file_basic.phpt
+++ b/ext/hash/tests/hash_file_basic.phpt
@@ -4,12 +4,6 @@ Hash: hash_file() function : basic functionality
Felix De Vliegher <felix.devliegher@gmail.com>
--FILE--
<?php
-/* Prototype : string hash_file(string algo, string filename[, bool raw_output = false])
- * Description: Generate a hash of a given file
- * Source code: ext/hash/hash.c
- * Alias to functions:
- */
-
echo "*** Testing hash_file() : basic functionality ***\n";
// Set up file
@@ -24,7 +18,6 @@ var_dump( hash_file( 'sha512', $filename ) );
var_dump( base64_encode( hash_file( 'md5', $filename, true ) ) );
?>
-===DONE===
--CLEAN--
<?php
@@ -39,4 +32,3 @@ string(40) "c0854fb9fb03c41cce3802cb0d220529e6eef94e"
string(64) "68b1282b91de2c054c36629cb8dd447f12f096d3e3c587978dc2248444633483"
string(128) "0a8c150176c2ba391d7f1670ef4955cd99d3c3ec8cf06198cec30d436f2ac0c9b64229b5a54bdbd5563160503ce992a74be528761da9d0c48b7c74627302eb25"
string(24) "XG/73UDZVWtzoh5jw+DpBA=="
-===DONE===
diff --git a/ext/hash/tests/hash_file_basic1.phpt b/ext/hash/tests/hash_file_basic1.phpt
index 0c4197e393..9ffe9a2f6c 100644
--- a/ext/hash/tests/hash_file_basic1.phpt
+++ b/ext/hash/tests/hash_file_basic1.phpt
@@ -3,18 +3,12 @@ Hash: hash_file() function : basic functionality
--FILE--
<?php
-/* Prototype : string hash_file ( string algo, string filename [, bool raw_output] )
- * Description: Generate a hash value using the contents of a given file
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
-
echo "*** Testing hash_file() : basic functionality ***\n";
$file = __DIR__ . "hash_file.txt";
/* Creating a temporary file file */
if (($fp = fopen( $file, "w+")) == FALSE) {
- echo "Cannot create file ($file)";
+ echo "Cannot create file ($file)";
exit;
}
@@ -56,7 +50,6 @@ echo "sha256(raw): " . bin2hex(hash_file('sha256', $file, TRUE)). "\n";
unlink($file);
?>
-===Done===
--EXPECT--
*** Testing hash_file() : basic functionality ***
adler32: ff87222e
@@ -80,4 +73,3 @@ whirlpool: 4248b149e000477269a4a5f1a84d97cfc3d0199b7aaf505913e6f010a6f83276029d1
adler32(raw): ff87222e
md5(raw): 704bf818448f5bbb94061332d2c889aa
sha256(raw): a0f5702fa5d3670b80033d668e8732b70550392abb53841355447f8bb0f72245
-===Done===
diff --git a/ext/hash/tests/hash_file_error.phpt b/ext/hash/tests/hash_file_error.phpt
index a634070de5..44f3d09255 100644
--- a/ext/hash/tests/hash_file_error.phpt
+++ b/ext/hash/tests/hash_file_error.phpt
@@ -4,12 +4,6 @@ Hash: hash_file() function : error conditions
Felix De Vliegher <felix.devliegher@gmail.com>
--FILE--
<?php
-/* Prototype : string hash_file(string algo, string filename[, bool raw_output = false])
- * Description: Generate a hash of a given file
- * Source code: ext/hash/hash.c
- * Alias to functions:
- */
-
echo "*** Testing hash_file() : error conditions ***\n";
// Set up file
@@ -19,20 +13,16 @@ file_put_contents( $filename, 'The quick brown fox jumped over the lazy dog.' );
// hash_file() error tests
echo "\n-- Testing hash_file() function with an unknown algorithm --\n";
-var_dump( hash_file( 'foobar', $filename ) );
+try {
+ hash_file('foobar', $filename);
+} catch (ValueError $exception) {
+ echo $exception->getMessage() . "\n";
+}
echo "\n-- Testing hash_file() function with a non-existent file --\n";
-var_dump( hash_file( 'md5', 'nonexistent.txt' ) );
-
-echo "\n-- Testing hash_file() function with less than expected no. of arguments --\n";
-var_dump( hash_file( 'md5' ) );
-
-echo "\n-- Testing hash_file() function with more than expected no. of arguments --\n";
-$extra_arg = 10;
-var_dump( hash_file( 'md5', $filename, false, $extra_arg ) );
+var_dump(hash_file('md5', 'nonexistent.txt'));
?>
-===DONE===
--CLEAN--
<?php
@@ -44,22 +34,9 @@ unlink( $filename );
*** Testing hash_file() : error conditions ***
-- Testing hash_file() function with an unknown algorithm --
-
-Warning: hash_file(): Unknown hashing algorithm: %s in %s on line %d
-bool(false)
+hash_file(): Argument #1 ($algo) must be a valid hashing algorithm
-- Testing hash_file() function with a non-existent file --
-Warning: hash_file(%s): failed to open stream: No such file or directory in %s on line %d
+Warning: hash_file(%s): Failed to open stream: No such file or directory in %s on line %d
bool(false)
-
--- Testing hash_file() function with less than expected no. of arguments --
-
-Warning: hash_file() expects at least 2 parameters, 1 given in %s on line %d
-NULL
-
--- Testing hash_file() function with more than expected no. of arguments --
-
-Warning: hash_file() expects at most 3 parameters, 4 given in %s on line %d
-NULL
-===DONE===
diff --git a/ext/hash/tests/hash_hkdf_basic.phpt b/ext/hash/tests/hash_hkdf_basic.phpt
index 7cd5f7e22e..bcbde9e5bf 100644
--- a/ext/hash/tests/hash_hkdf_basic.phpt
+++ b/ext/hash/tests/hash_hkdf_basic.phpt
@@ -3,11 +3,6 @@ Hash: hash_hkdf() function: basic functionality
--FILE--
<?php
-/* Prototype : string hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] )
- * Description: HMAC-based Key Derivation Function
- * Source code: ext/hash/hash.c
-*/
-
echo "*** Testing hash_hkdf(): basic functionality ***\n";
$ikm = 'input key material';
diff --git a/ext/hash/tests/hash_hkdf_edges.phpt b/ext/hash/tests/hash_hkdf_edges.phpt
index 82acdbab04..89b3d8af63 100644
--- a/ext/hash/tests/hash_hkdf_edges.phpt
+++ b/ext/hash/tests/hash_hkdf_edges.phpt
@@ -3,11 +3,6 @@ Hash: hash_hkdf() function: edge cases
--FILE--
<?php
-/* Prototype : string hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] )
- * Description: HMAC-based Key Derivation Function
- * Source code: ext/hash/hash.c
-*/
-
echo "*** Testing hash_hkdf(): edge cases ***\n";
$ikm = 'input key material';
@@ -16,15 +11,19 @@ echo 'Length < digestSize: ', bin2hex(hash_hkdf('md5', $ikm, 7)), "\n";
echo 'Length % digestSize != 0: ', bin2hex(hash_hkdf('md5', $ikm, 17)), "\n";
echo 'Algo name case-sensitivity: ', (bin2hex(hash_hkdf('Md5', $ikm, 7)) === '98b16391063ece' ? 'true' : 'false'), "\n";
echo "Non-crypto algo name case-sensitivity:\n";
-var_dump(hash_hkdf('jOaAt', $ikm));
+
+try {
+ var_dump(hash_hkdf('jOaAt', $ikm));
+}
+catch (\Error $e) {
+ echo '[Error] ' . $e->getMessage() . "\n";
+}
?>
---EXPECTF--
+--EXPECT--
*** Testing hash_hkdf(): edge cases ***
Length < digestSize: 98b16391063ece
Length % digestSize != 0: 98b16391063ecee006a3ca8ee5776b1e5f
Algo name case-sensitivity: true
Non-crypto algo name case-sensitivity:
-
-Warning: hash_hkdf(): Non-cryptographic hashing algorithm: jOaAt in %s on line %d
-bool(false)
+[Error] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
diff --git a/ext/hash/tests/hash_hkdf_error.phpt b/ext/hash/tests/hash_hkdf_error.phpt
index b833054e80..a478420ca4 100644
--- a/ext/hash/tests/hash_hkdf_error.phpt
+++ b/ext/hash/tests/hash_hkdf_error.phpt
@@ -3,96 +3,64 @@ Hash: hash_hkdf() function: error conditions
--FILE--
<?php
-/* Prototype : string hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] )
- * Description: HMAC-based Key Derivation Function
- * Source code: ext/hash/hash.c
-*/
+error_reporting(E_ALL);
+
+function trycatch_dump(...$tests) {
+ foreach ($tests as $test) {
+ try {
+ var_dump($test());
+ }
+ catch (\Error $e) {
+ echo '[' . get_class($e) . '] ' . $e->getMessage() . "\n";
+ }
+ }
+}
$ikm = 'input key material';
echo "*** Testing hash_hkdf(): error conditions ***\n";
-echo "\n-- Testing hash_hkdf() function with less than expected no. of arguments --\n";
-var_dump(hash_hkdf());
-var_dump(hash_hkdf('sha1'));
-
-echo "\n-- Testing hash_hkdf() function with more than expected no. of arguments --\n";
-var_dump(hash_hkdf('sha1', $ikm, 20, '', '', 'extra parameter'));
-
echo "\n-- Testing hash_hkdf() function with invalid hash algorithm --\n";
-var_dump(hash_hkdf('foo', $ikm));
+trycatch_dump(
+ fn() => hash_hkdf('foo', $ikm)
+);
echo "\n-- Testing hash_hkdf() function with non-cryptographic hash algorithm --\n";
-var_dump(hash_hkdf('adler32', $ikm));
-var_dump(hash_hkdf('crc32', $ikm));
-var_dump(hash_hkdf('crc32b', $ikm));
-var_dump(hash_hkdf('fnv132', $ikm));
-var_dump(hash_hkdf('fnv1a32', $ikm));
-var_dump(hash_hkdf('fnv164', $ikm));
-var_dump(hash_hkdf('fnv1a64', $ikm));
-var_dump(hash_hkdf('joaat', $ikm));
+trycatch_dump(
+ fn() => hash_hkdf('adler32', $ikm),
+ fn() => hash_hkdf('crc32', $ikm),
+ fn() => hash_hkdf('crc32b', $ikm),
+ fn() => hash_hkdf('fnv132', $ikm),
+ fn() => hash_hkdf('fnv1a32', $ikm),
+ fn() => hash_hkdf('fnv164', $ikm),
+ fn() => hash_hkdf('fnv1a64', $ikm),
+ fn() => hash_hkdf('joaat', $ikm)
+);
echo "\n-- Testing hash_hkdf() function with invalid parameters --\n";
-var_dump(hash_hkdf('sha1', ''));
-var_dump(hash_hkdf('sha1', $ikm, -1));
-var_dump(hash_hkdf('sha1', $ikm, 20 * 255 + 1)); // Length can't be more than 255 times the hash digest size
+trycatch_dump(
+ fn() => hash_hkdf('sha1', ''),
+ fn() => hash_hkdf('sha1', $ikm, -1),
+ fn() => hash_hkdf('sha1', $ikm, 20 * 255 + 1) // Length can't be more than 255 times the hash digest size
+)
?>
-===Done===
---EXPECTF--
+--EXPECT--
*** Testing hash_hkdf(): error conditions ***
--- Testing hash_hkdf() function with less than expected no. of arguments --
-
-Warning: hash_hkdf() expects at least 2 parameters, 0 given in %s on line %d
-NULL
-
-Warning: hash_hkdf() expects at least 2 parameters, 1 given in %s on line %d
-NULL
-
--- Testing hash_hkdf() function with more than expected no. of arguments --
-
-Warning: hash_hkdf() expects at most 5 parameters, 6 given in %s on line %d
-NULL
-
-- Testing hash_hkdf() function with invalid hash algorithm --
-
-Warning: hash_hkdf(): Unknown hashing algorithm: foo in %s on line %d
-bool(false)
+[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_hkdf() function with non-cryptographic hash algorithm --
-
-Warning: hash_hkdf(): Non-cryptographic hashing algorithm: adler32 in %s on line %d
-bool(false)
-
-Warning: hash_hkdf(): Non-cryptographic hashing algorithm: crc32 in %s on line %d
-bool(false)
-
-Warning: hash_hkdf(): Non-cryptographic hashing algorithm: crc32b in %s on line %d
-bool(false)
-
-Warning: hash_hkdf(): Non-cryptographic hashing algorithm: fnv132 in %s on line %d
-bool(false)
-
-Warning: hash_hkdf(): Non-cryptographic hashing algorithm: fnv1a32 in %s on line %d
-bool(false)
-
-Warning: hash_hkdf(): Non-cryptographic hashing algorithm: fnv164 in %s on line %d
-bool(false)
-
-Warning: hash_hkdf(): Non-cryptographic hashing algorithm: fnv1a64 in %s on line %d
-bool(false)
-
-Warning: hash_hkdf(): Non-cryptographic hashing algorithm: joaat in %s on line %d
-bool(false)
+[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
+[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_hkdf() function with invalid parameters --
-
-Warning: hash_hkdf(): Input keying material cannot be empty in %s on line %d
-bool(false)
-
-Warning: hash_hkdf(): Length must be greater than or equal to 0: -1 in %s on line %d
-bool(false)
-
-Warning: hash_hkdf(): Length must be less than or equal to 5100: 5101 in %s on line %d
-bool(false)
-===Done===
+[ValueError] hash_hkdf(): Argument #2 ($ikm) cannot be empty
+[ValueError] hash_hkdf(): Argument #3 ($length) must be greater than or equal to 0
+[ValueError] hash_hkdf(): Argument #3 ($length) must be less than or equal to 5100
diff --git a/ext/hash/tests/hash_hkdf_rfc5869.phpt b/ext/hash/tests/hash_hkdf_rfc5869.phpt
index 5652bff5ef..64d883dd12 100644
--- a/ext/hash/tests/hash_hkdf_rfc5869.phpt
+++ b/ext/hash/tests/hash_hkdf_rfc5869.phpt
@@ -3,69 +3,63 @@ Hash: hash_hkdf() function: RFC 5869 test vectors
--FILE--
<?php
-/* Prototype : string hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] )
- * Description: HMAC-based Key Derivation Function
- * Source code: ext/hash/hash.c
-*/
-
echo "*** Testing hash_hkdf(): RFC 5869 test vectors ***\n";
echo "Test case 1 (SHA-256): ",
- bin2hex(hash_hkdf(
- 'sha256',
- "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
- 42,
- "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9",
- "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c"
- )), "\n";
+ bin2hex(hash_hkdf(
+ 'sha256',
+ "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
+ 42,
+ "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9",
+ "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c"
+ )), "\n";
echo "Test case 2 (SHA-256 with longer inputs/outputs): ",
- bin2hex(hash_hkdf(
- 'sha256',
- "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f",
- 82,
- "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
- "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
- )), "\n";
+ bin2hex(hash_hkdf(
+ 'sha256',
+ "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f",
+ 82,
+ "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+ "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+ )), "\n";
echo "Test case 3 (SHA-256 with zero-length salt, info): ",
- bin2hex(hash_hkdf(
- 'sha256',
- "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
- 42,
- '',
- ''
- )), "\n";
+ bin2hex(hash_hkdf(
+ 'sha256',
+ "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
+ 42,
+ '',
+ ''
+ )), "\n";
echo "Test case 4 (SHA-1): ",
- bin2hex(hash_hkdf(
- 'sha1',
- "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
- 42,
- "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9",
- "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c"
- )), "\n";
+ bin2hex(hash_hkdf(
+ 'sha1',
+ "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
+ 42,
+ "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9",
+ "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c"
+ )), "\n";
echo "Test case 5 (SHA-1 with longer inputs/outputs): ",
- bin2hex(hash_hkdf(
- 'sha1',
- "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f",
- 82,
- "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
- "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
- )), "\n";
+ bin2hex(hash_hkdf(
+ 'sha1',
+ "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f",
+ 82,
+ "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
+ "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+ )), "\n";
echo "Test case 6 (SHA-1 with zero-length salt, info): ",
- bin2hex(hash_hkdf(
- 'sha1',
- "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
- 42,
- '',
- ''
- )), "\n";
+ bin2hex(hash_hkdf(
+ 'sha1',
+ "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
+ 42,
+ '',
+ ''
+ )), "\n";
echo "Test case 7 (SHA-1 with zero-length info, salt not provided): ",
- bin2hex(hash_hkdf(
- 'sha1',
- "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
- 42,
- ''
- )), "\n";
+ bin2hex(hash_hkdf(
+ 'sha1',
+ "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
+ 42,
+ ''
+ )), "\n";
?>
-===Done===
--EXPECT--
*** Testing hash_hkdf(): RFC 5869 test vectors ***
Test case 1 (SHA-256): 3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865
@@ -75,4 +69,3 @@ Test case 4 (SHA-1): 085a01ea1b10f36933068b56efa5ad81a4f14b822f5b091568a9cdd4f15
Test case 5 (SHA-1 with longer inputs/outputs): 0bd770a74d1160f7c9f12cd5912a06ebff6adcae899d92191fe4305673ba2ffe8fa3f1a4e5ad79f3f334b3b202b2173c486ea37ce3d397ed034c7f9dfeb15c5e927336d0441f4c4300e2cff0d0900b52d3b4
Test case 6 (SHA-1 with zero-length salt, info): 0ac1af7002b3d761d1e55298da9d0506b9ae52057220a306e07b6b87e8df21d0ea00033de03984d34918
Test case 7 (SHA-1 with zero-length info, salt not provided): 2c91117204d745f3500d636a62f64f0ab3bae548aa53d423b0d1f27ebba6f5e5673a081d70cce7acfc48
-===Done===
diff --git a/ext/hash/tests/hash_hmac_basic.phpt b/ext/hash/tests/hash_hmac_basic.phpt
index 1ad27e1cb2..7be7d3cea2 100644
--- a/ext/hash/tests/hash_hmac_basic.phpt
+++ b/ext/hash/tests/hash_hmac_basic.phpt
@@ -3,12 +3,6 @@ Hash: hash_file() function : basic functionality
--FILE--
<?php
-/* Prototype : string hash_hmac ( string $algo , string $data , string $key [, bool $raw_output ] )
- * Description: Generate a keyed hash value using the HMAC method
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
-
echo "*** Testing hash_hmac() : basic functionality ***\n";
$content = "This is a sample string used to test the hash_hmac function with various hashing algorithms";
@@ -34,7 +28,6 @@ echo "md5(raw): " . bin2hex(hash_hmac('md5', $content, $key, TRUE)) . "\n";
echo "sha256(raw): " . bin2hex(hash_hmac('sha256', $content, $key, TRUE)) . "\n";
?>
-===Done===
--EXPECT--
*** Testing hash_hmac() : basic functionality ***
gost: a4a3c80bdf3f8665bf07376a34dc9c1b11af7c813f4928f62e39f0c0dc564dad
@@ -55,4 +48,3 @@ tiger192,3: 00a0f884f15a9e5549ed0e40ca0190522d369027e16d5b59
whirlpool: 4a0f1582b21b7aff59bfba7f9c29131c69741b2ce80acdc7d314040f3b768cf5a17e30b74cceb86fbc6b34b1692e0addd5bfd7cfc043d40c0621f1b97e26fa49
md5(raw): 2a632783e2812cf23de100d7d6a463ae
sha256(raw): 49bde3496b9510a17d0edd8a4b0ac70148e32a1d51e881ec76faa96534125838
-===Done===
diff --git a/ext/hash/tests/hash_hmac_error.phpt b/ext/hash/tests/hash_hmac_error.phpt
index 89d29b8df8..81c28ee46c 100644
--- a/ext/hash/tests/hash_hmac_error.phpt
+++ b/ext/hash/tests/hash_hmac_error.phpt
@@ -3,7 +3,6 @@ Hash: hash_hmac() function : basic functionality
--FILE--
<?php
/*
-* proto string hash_hmac ( string algo, string data, string key [, bool raw_output] )
* Function is implemented in ext/hash/hash.c
*/
@@ -12,49 +11,28 @@ echo "*** Testing hash_hmac() : error conditions ***\n";
$data = "This is a sample string used to test the hash_hmac function with various hashing algorithms";
$key = 'secret';
-echo "\n-- Testing hash_hmac() function with less than expected no. of arguments --\n";
-var_dump(hash_hmac());
-var_dump(hash_hmac('md5'));
-var_dump(hash_hmac('md5', $data));
-
-echo "\n-- Testing hash_hmac() function with more than expected no. of arguments --\n";
-$extra_arg = 10;
-var_dump(hash_hmac('md5', $data, $key, TRUE, $extra_arg));
-
echo "\n-- Testing hash_hmac() function with invalid hash algorithm --\n";
-var_dump(hash_hmac('foo', $data, $key));
+try {
+ var_dump(hash_hmac('foo', $data, $key));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
echo "\n-- Testing hash_hmac() function with non-cryptographic hash algorithm --\n";
-var_dump(hash_hmac('crc32', $data, $key));
+try {
+ var_dump(hash_hmac('crc32', $data, $key));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
?>
-===Done===
---EXPECTF--
+--EXPECT--
*** Testing hash_hmac() : error conditions ***
--- Testing hash_hmac() function with less than expected no. of arguments --
-
-Warning: hash_hmac() expects at least 3 parameters, 0 given in %s on line %d
-NULL
-
-Warning: hash_hmac() expects at least 3 parameters, 1 given in %s on line %d
-NULL
-
-Warning: hash_hmac() expects at least 3 parameters, 2 given in %s on line %d
-NULL
-
--- Testing hash_hmac() function with more than expected no. of arguments --
-
-Warning: hash_hmac() expects at most 4 parameters, 5 given in %s on line %d
-NULL
-
-- Testing hash_hmac() function with invalid hash algorithm --
-
-Warning: hash_hmac(): Unknown hashing algorithm: foo in %s on line %d
-bool(false)
+hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_hmac() function with non-cryptographic hash algorithm --
-
-Warning: hash_hmac(): Non-cryptographic hashing algorithm: crc32 in %s on line %d
-bool(false)
-===Done===
+hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
diff --git a/ext/hash/tests/hash_hmac_file_basic.phpt b/ext/hash/tests/hash_hmac_file_basic.phpt
index 6e4b4da078..2a03df05c5 100644
--- a/ext/hash/tests/hash_hmac_file_basic.phpt
+++ b/ext/hash/tests/hash_hmac_file_basic.phpt
@@ -4,18 +4,12 @@ Hash: hash_hmac_file() function : basic functionality
<?php
-/* Prototype : string hash_hmac_file ( string algo, string filename, string key [, bool raw_output] )
- * Description: Generate a keyed hash value using the HMAC method and the contents of a given file
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
-
echo "*** Testing hash_hmac_file() : basic functionality ***\n";
$file = __DIR__ . "hash_hmac_file.txt";
/* Creating a temporary file file */
if (($fp = fopen( $file, "w+")) == FALSE) {
- echo "Cannot create file ($file)";
+ echo "Cannot create file ($file)";
exit;
}
@@ -54,16 +48,10 @@ echo "whirlpool: " . hash_hmac_file('whirlpool', $file, $key) . "\n";
echo "md5(raw): " . bin2hex(hash_hmac_file('md5', $file, $key, TRUE)). "\n";
echo "sha256(raw): " . bin2hex(hash_hmac_file('sha256', $file, $key, TRUE)). "\n";
-echo "Error cases:\n";
-hash_hmac_file();
-hash_hmac_file('foo', $file);
-hash_hmac_file('foo', $file, $key, TRUE, 10);
-
unlink($file);
?>
-===Done===
---EXPECTF--
+--EXPECT--
*** Testing hash_hmac_file() : basic functionality ***
gost: 94c39a40d5db852a8dc3d24e37eebf2d53e3d711457c59cd02b614f792a9d918
haval128,3: f1cea637451097d790354a86de3f54a3
@@ -83,11 +71,3 @@ tiger192,3: ca89badf843ba68e3fae5832635aa848a72a4bc11676edd4
whirlpool: 37a0fbb90547690d5e5e11c046f6654ffdb7bab15e16d9d79c7d85765cc4bdcbfd9df8db7a3ce9558f3f244fead00ca29cf05297f75596555195a0683f15d69f
md5(raw): 8bddf39dd1c566c27acc7fa85ec36acf
sha256(raw): 9135286ca4c84dec711e4b831f6cd39e672e5ff93d011321274eb76733cc1e40
-Error cases:
-
-Warning: hash_hmac_file() expects at least 3 parameters, 0 given in %s on line %d
-
-Warning: hash_hmac_file() expects at least 3 parameters, 2 given in %s on line %d
-
-Warning: hash_hmac_file() expects at most 4 parameters, 5 given in %s on line %d
-===Done===
diff --git a/ext/hash/tests/hash_hmac_file_error.phpt b/ext/hash/tests/hash_hmac_file_error.phpt
index a3718ebb85..6e45aaef28 100644
--- a/ext/hash/tests/hash_hmac_file_error.phpt
+++ b/ext/hash/tests/hash_hmac_file_error.phpt
@@ -3,64 +3,44 @@ Hash: hash_hmac_file() function : basic functionality
--FILE--
<?php
-/* Prototype : string hash_hmac_file ( string algo, string filename, string key [, bool raw_output] )
- * Description: Generate a keyed hash value using the HMAC method and the contents of a given file
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
-
echo "*** Testing hash() : error conditions ***\n";
$file = __DIR__ . "hash_file.txt";
$key = 'secret';
-echo "\n-- Testing hash_hmac_file() function with less than expected no. of arguments --\n";
-var_dump(hash_hmac_file());
-var_dump(hash_hmac_file('crc32'));
-var_dump(hash_hmac_file('crc32', $file));
-
-echo "\n-- Testing hash_hmac_file() function with more than expected no. of arguments --\n";
-$extra_arg = 10;
-hash_hmac_file('crc32', $file, $key, TRUE, $extra_arg);
-
echo "\n-- Testing hash_hmac_file() function with invalid hash algorithm --\n";
-hash_hmac_file('foo', $file, $key, TRUE);
+try {
+ var_dump(hash_hmac_file('foo', $file, $key, TRUE));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
echo "\n-- Testing hash_hmac_file() function with non-cryptographic hash algorithm --\n";
-hash_hmac_file('crc32', $file, $key, TRUE);
+try {
+ var_dump(hash_hmac_file('crc32', $file, $key, TRUE));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
echo "\n-- Testing hash_hmac_file() function with bad path --\n";
-hash_hmac_file('md5', $file.chr(0).$file, $key, TRUE);
+try {
+ var_dump(hash_hmac_file('md5', $file.chr(0).$file, $key, TRUE));
+}
+catch (TypeError $e) {
+ echo $e->getMessage() . "\n";
+}
?>
-===Done===
---EXPECTF--
+--EXPECT--
*** Testing hash() : error conditions ***
--- Testing hash_hmac_file() function with less than expected no. of arguments --
-
-Warning: hash_hmac_file() expects at least 3 parameters, 0 given in %s on line %d
-NULL
-
-Warning: hash_hmac_file() expects at least 3 parameters, 1 given in %s on line %d
-NULL
-
-Warning: hash_hmac_file() expects at least 3 parameters, 2 given in %s on line %d
-NULL
-
--- Testing hash_hmac_file() function with more than expected no. of arguments --
-
-Warning: hash_hmac_file() expects at most 4 parameters, 5 given in %s on line %d
-
-- Testing hash_hmac_file() function with invalid hash algorithm --
-
-Warning: hash_hmac_file(): Unknown hashing algorithm: foo in %s on line %d
+hash_hmac_file(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_hmac_file() function with non-cryptographic hash algorithm --
-
-Warning: hash_hmac_file(): Non-cryptographic hashing algorithm: crc32 in %s on line %d
+hash_hmac_file(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_hmac_file() function with bad path --
-
-Warning: hash_hmac_file(): Invalid path in %s on line %d
-===Done===
+hash_hmac_file(): Argument #2 ($data) must be a valid path
diff --git a/ext/hash/tests/hash_init_error.phpt b/ext/hash/tests/hash_init_error.phpt
index e941aabca5..fdea4174d6 100644
--- a/ext/hash/tests/hash_init_error.phpt
+++ b/ext/hash/tests/hash_init_error.phpt
@@ -4,37 +4,48 @@ Hash: hash_init() function - errors test
<?php
echo "*** Testing hash_init(): error conditions ***\n";
-echo "-- Testing hash_init() function with no parameters --\n";
-var_dump(hash_init());
+echo "\n-- Testing hash_init() function with unknown algorithms --\n";
+try {
+ var_dump(hash_init('dummy'));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
+echo "\n-- Testing hash_init() function with HASH_HMAC and non-cryptographic algorithms --\n";
+try {
+ var_dump(hash_init('crc32', HASH_HMAC));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
+echo "\n-- Testing hash_init() function with HASH_HMAC and no key --\n";
+try {
+ var_dump(hash_init('md5', HASH_HMAC));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
+try {
+ var_dump(hash_init('md5', HASH_HMAC, null));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
-echo "-- Testing hash_init() function with unknown algorithms --\n";
-var_dump(hash_init('dummy'));
-echo "-- Testing hash_init() function with HASH_HMAC and non-cryptographic algorithms --\n";
-var_dump(hash_init('crc32', HASH_HMAC));
-
-echo "-- Testing hash_init() function with HASH_HMAC and no key --\n";
-var_dump(hash_init('md5', HASH_HMAC));
-var_dump(hash_init('md5', HASH_HMAC, null));
?>
---EXPECTF--
+--EXPECT--
*** Testing hash_init(): error conditions ***
--- Testing hash_init() function with no parameters --
-Warning: hash_init() expects at least 1 parameter, 0 given in %s on line %d
-NULL
-- Testing hash_init() function with unknown algorithms --
+hash_init(): Argument #1 ($algo) must be a valid hashing algorithm
-Warning: hash_init(): Unknown hashing algorithm: dummy in %s on line %d
-bool(false)
-- Testing hash_init() function with HASH_HMAC and non-cryptographic algorithms --
+hash_init(): Argument #1 ($algo) must be a cryptographic hashing algorithm if HMAC is requested
-Warning: hash_init(): HMAC requested with a non-cryptographic hashing algorithm: crc32 in %s on line %d
-bool(false)
-- Testing hash_init() function with HASH_HMAC and no key --
-
-Warning: hash_init(): HMAC requested without a key %s on line %d
-bool(false)
-
-Warning: hash_init(): HMAC requested without a key %s on line %d
-bool(false)
+hash_init(): Argument #3 ($key) cannot be empty when HMAC is requested
+hash_init(): Argument #3 ($key) cannot be empty when HMAC is requested
diff --git a/ext/hash/tests/hash_pbkdf2_basic.phpt b/ext/hash/tests/hash_pbkdf2_basic.phpt
index 71187a0fdd..d657c5886a 100644
--- a/ext/hash/tests/hash_pbkdf2_basic.phpt
+++ b/ext/hash/tests/hash_pbkdf2_basic.phpt
@@ -3,12 +3,6 @@ Hash: hash_pbkdf2() function : basic functionality
--FILE--
<?php
-/* Prototype : string hash_hmac(string $algo, string $data, string $key [, int $length = 0 [, bool $raw_output = false]])
- * Description: Generate a keyed hash value using the HMAC method
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
-
echo "*** Testing hash_pbkdf2() : basic functionality ***\n";
echo "sha1: " . hash_pbkdf2('sha1', 'password', 'salt', 1, 20)."\n";
@@ -23,7 +17,6 @@ echo "sha256(rounds): " . hash_pbkdf2('sha256', 'passwordPASSWORDpassword', 'sal
echo "sha256(rounds)(raw): " . bin2hex(hash_pbkdf2('sha256', 'passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 4096, 40, TRUE))."\n";
?>
-===Done===
--EXPECT--
*** Testing hash_pbkdf2() : basic functionality ***
sha1: 0c60c80f961f0e71f3a9
@@ -36,4 +29,3 @@ sha256(no length): 120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be
sha256(raw): 120fb6cffcf8b32c43e7225256c4f837a86548c9
sha256(rounds): 348c89dbcbd32b2f32d814b8116e84cf2b17347e
sha256(rounds)(raw): 348c89dbcbd32b2f32d814b8116e84cf2b17347ebc1800181c4e2a1fb8dd53e1c635518c7dac47e9
-===Done===
diff --git a/ext/hash/tests/hash_pbkdf2_error.phpt b/ext/hash/tests/hash_pbkdf2_error.phpt
index c0a76e17b4..35cda2b52f 100644
--- a/ext/hash/tests/hash_pbkdf2_error.phpt
+++ b/ext/hash/tests/hash_pbkdf2_error.phpt
@@ -3,8 +3,7 @@ Hash: Test hash_pbkdf2() function : error functionality
--FILE--
<?php
-/* {{{ proto string hash_pbkdf2(string algo, string password, string salt, int iterations [, int length = 0, bool raw_output = false])
-Generate a PBKDF2 hash of the given password and salt
+/* Generate a PBKDF2 hash of the given password and salt
Returns lowercase hexbits by default */
echo "*** Testing hash_pbkdf2() : error conditions ***\n";
@@ -12,72 +11,59 @@ echo "*** Testing hash_pbkdf2() : error conditions ***\n";
$password = 'password';
$salt = 'salt';
-echo "\n-- Testing hash_pbkdf2() function with less than expected no. of arguments --\n";
-var_dump(hash_pbkdf2());
-var_dump(hash_pbkdf2('md5'));
-var_dump(hash_pbkdf2('md5', $password));
-var_dump(hash_pbkdf2('md5', $password, $salt));
-
-echo "\n-- Testing hash_pbkdf2() function with more than expected no. of arguments --\n";
-var_dump(hash_pbkdf2('md5', $password, $salt, 10, 10, true, 'extra arg'));
-
echo "\n-- Testing hash_pbkdf2() function with invalid hash algorithm --\n";
-var_dump(hash_pbkdf2('foo', $password, $salt, 1));
+try {
+ var_dump(hash_pbkdf2('foo', $password, $salt, 1));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
echo "\n-- Testing hash_pbkdf2() function with non-cryptographic hash algorithm --\n";
-var_dump(hash_pbkdf2('crc32', $password, $salt, 1));
+try {
+ var_dump(hash_pbkdf2('crc32', $password, $salt, 1));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
echo "\n-- Testing hash_pbkdf2() function with invalid iterations --\n";
-var_dump(hash_pbkdf2('md5', $password, $salt, 0));
-var_dump(hash_pbkdf2('md5', $password, $salt, -1));
+try {
+ var_dump(hash_pbkdf2('md5', $password, $salt, 0));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
+try {
+ var_dump(hash_pbkdf2('md5', $password, $salt, -1));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
echo "\n-- Testing hash_pbkdf2() function with invalid length --\n";
-var_dump(hash_pbkdf2('md5', $password, $salt, 1, -1));
+try {
+ var_dump(hash_pbkdf2('md5', $password, $salt, 1, -1));
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
?>
-===Done===
---EXPECTF--
+--EXPECT--
*** Testing hash_pbkdf2() : error conditions ***
--- Testing hash_pbkdf2() function with less than expected no. of arguments --
-
-Warning: hash_pbkdf2() expects at least 4 parameters, 0 given in %s on line %d
-NULL
-
-Warning: hash_pbkdf2() expects at least 4 parameters, 1 given in %s on line %d
-NULL
-
-Warning: hash_pbkdf2() expects at least 4 parameters, 2 given in %s on line %d
-NULL
-
-Warning: hash_pbkdf2() expects at least 4 parameters, 3 given in %s on line %d
-NULL
-
--- Testing hash_pbkdf2() function with more than expected no. of arguments --
-
-Warning: hash_pbkdf2() expects at most 6 parameters, 7 given in %s on line %d
-NULL
-
-- Testing hash_pbkdf2() function with invalid hash algorithm --
-
-Warning: hash_pbkdf2(): Unknown hashing algorithm: foo in %s on line %d
-bool(false)
+hash_pbkdf2(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_pbkdf2() function with non-cryptographic hash algorithm --
-
-Warning: hash_pbkdf2(): Non-cryptographic hashing algorithm: crc32 in %s on line %d
-bool(false)
+hash_pbkdf2(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm
-- Testing hash_pbkdf2() function with invalid iterations --
-
-Warning: hash_pbkdf2(): Iterations must be a positive integer: 0 in %s on line %d
-bool(false)
-
-Warning: hash_pbkdf2(): Iterations must be a positive integer: -1 in %s on line %d
-bool(false)
+hash_pbkdf2(): Argument #4 ($iterations) must be greater than 0
+hash_pbkdf2(): Argument #4 ($iterations) must be greater than 0
-- Testing hash_pbkdf2() function with invalid length --
-
-Warning: hash_pbkdf2(): Length must be greater than or equal to 0: -1 in %s on line %d
-bool(false)
-===Done===
+hash_pbkdf2(): Argument #5 ($length) must be greater than or equal to 0
diff --git a/ext/hash/tests/hash_serialize_001.phpt b/ext/hash/tests/hash_serialize_001.phpt
new file mode 100644
index 0000000000..d515d2c5c5
--- /dev/null
+++ b/ext/hash/tests/hash_serialize_001.phpt
@@ -0,0 +1,361 @@
+--TEST--
+Hash: serialize()/unserialize()
+--FILE--
+<?php
+
+$algos = hash_algos();
+
+foreach ($algos as $algo) {
+ var_dump($algo);
+ $ctx0 = hash_init($algo);
+ $serial = serialize($ctx0);
+ assert(is_string($serial));
+
+ $ctx1 = unserialize($serial);
+ hash_update($ctx1, "I can't remember anything");
+ $serial = serialize($ctx1);
+ assert(is_string($serial));
+ var_dump(hash_final($ctx1));
+
+ $ctx2 = unserialize($serial);
+ var_dump(hash_final($ctx2));
+}
+
+// serialize/unserialize produces same results as all-on-one
+foreach ($algos as $algo) {
+ var_dump($algo);
+ $orig = hash_init($algo);
+ hash_update($orig, "I can't remember anything");
+ $serial = serialize($orig);
+
+ $fresh = hash_init($algo);
+ hash_update($fresh, "I can't remember anythingCan’t tell if this is true or dream");
+ var_dump(hash_final($fresh));
+
+ $copy = unserialize($serial);
+ hash_update($copy, "Can’t tell if this is true or dream");
+ var_dump(hash_final($copy));
+}
+
+echo "Done\n";
+?>
+--EXPECT--
+string(3) "md2"
+string(32) "d5ac4ffd08f6a57b9bd402b8068392ff"
+string(32) "d5ac4ffd08f6a57b9bd402b8068392ff"
+string(3) "md4"
+string(32) "302c45586b53a984bd3a1237cb81c15f"
+string(32) "302c45586b53a984bd3a1237cb81c15f"
+string(3) "md5"
+string(32) "e35759f6ea35db254e415b5332269435"
+string(32) "e35759f6ea35db254e415b5332269435"
+string(4) "sha1"
+string(40) "29f62a228f726cd728efa7a0ac6a2aba318baf15"
+string(40) "29f62a228f726cd728efa7a0ac6a2aba318baf15"
+string(6) "sha224"
+string(56) "51fd0aa76a00b4a86103895cad5c7c2651ec7da9f4fc1e50c43ede29"
+string(56) "51fd0aa76a00b4a86103895cad5c7c2651ec7da9f4fc1e50c43ede29"
+string(6) "sha256"
+string(64) "d3a13cf52af8e9390caed78b77b6b1e06e102204e3555d111dfd149bc5d54dba"
+string(64) "d3a13cf52af8e9390caed78b77b6b1e06e102204e3555d111dfd149bc5d54dba"
+string(6) "sha384"
+string(96) "6950d861ace4102b803ab8b3779d2f471968233010d2608974ab89804cef6f76162b4433d6e554e11e40a7cdcf510ea3"
+string(96) "6950d861ace4102b803ab8b3779d2f471968233010d2608974ab89804cef6f76162b4433d6e554e11e40a7cdcf510ea3"
+string(10) "sha512/224"
+string(56) "a2573d0e3f6c3e2d174c935a35a8ea31032f04e9e83499ac3ceda568"
+string(56) "a2573d0e3f6c3e2d174c935a35a8ea31032f04e9e83499ac3ceda568"
+string(10) "sha512/256"
+string(64) "fddacab80b3a610ba024c9d75a5fe0cafe5ae7c789f829b3c5fbea8ef11ccc1a"
+string(64) "fddacab80b3a610ba024c9d75a5fe0cafe5ae7c789f829b3c5fbea8ef11ccc1a"
+string(6) "sha512"
+string(128) "caced3db8e9e3a5543d5b933bcbe9e7834e6667545c3f5d4087b58ec8d78b4c8a4a5500c9b88f65f7368810ba9905e51f1cff3b25a5dccf76634108fb4e7ce13"
+string(128) "caced3db8e9e3a5543d5b933bcbe9e7834e6667545c3f5d4087b58ec8d78b4c8a4a5500c9b88f65f7368810ba9905e51f1cff3b25a5dccf76634108fb4e7ce13"
+string(8) "sha3-224"
+string(56) "7e1126cffee98e5c4b0e9dd5c6efabd5c9356d668e9a2d3cfab724d4"
+string(56) "7e1126cffee98e5c4b0e9dd5c6efabd5c9356d668e9a2d3cfab724d4"
+string(8) "sha3-256"
+string(64) "834abfed9197af09cbe66b7748c65a050a3755ef7a556d6764eb6eabc93b4c7a"
+string(64) "834abfed9197af09cbe66b7748c65a050a3755ef7a556d6764eb6eabc93b4c7a"
+string(8) "sha3-384"
+string(96) "c9016992586f7a8663c5379ed892349c1140ad258f7c44ee82f61f0b8cb75c675012ea94dc1314e06699be2d1465f67b"
+string(96) "c9016992586f7a8663c5379ed892349c1140ad258f7c44ee82f61f0b8cb75c675012ea94dc1314e06699be2d1465f67b"
+string(8) "sha3-512"
+string(128) "5f85341bc9c6621406bf1841c4ce01727ea8759fdf2927106c3e70a75ad9fffd095b87f995aeee844e1a2c287e1195ce809b9bdb1c31258f7fc098175b6de0b4"
+string(128) "5f85341bc9c6621406bf1841c4ce01727ea8759fdf2927106c3e70a75ad9fffd095b87f995aeee844e1a2c287e1195ce809b9bdb1c31258f7fc098175b6de0b4"
+string(9) "ripemd128"
+string(32) "5f1bc5f5aeaf747574dd34a6535cd94a"
+string(32) "5f1bc5f5aeaf747574dd34a6535cd94a"
+string(9) "ripemd160"
+string(40) "02a2a535ee10404c6b5cf9acb178a04fbed67269"
+string(40) "02a2a535ee10404c6b5cf9acb178a04fbed67269"
+string(9) "ripemd256"
+string(64) "547d2ed85ca0a0e3208b5ecf4fc6a7fc1e64db8ff13493e4beaf11e4d71648e2"
+string(64) "547d2ed85ca0a0e3208b5ecf4fc6a7fc1e64db8ff13493e4beaf11e4d71648e2"
+string(9) "ripemd320"
+string(80) "785a7df56858f550966cddfd59ce14b13bf4b18e7892c4c1ad91bf23bf67639bd2c96749ba29cfa6"
+string(80) "785a7df56858f550966cddfd59ce14b13bf4b18e7892c4c1ad91bf23bf67639bd2c96749ba29cfa6"
+string(9) "whirlpool"
+string(128) "6e60597340640e621e25f975cef2b000b0c4c09a7af7d240a52d193002b0a8426fa7da7acc5b37ed9608016d4f396db834a0ea2f2c35f900461c9ac7e5604082"
+string(128) "6e60597340640e621e25f975cef2b000b0c4c09a7af7d240a52d193002b0a8426fa7da7acc5b37ed9608016d4f396db834a0ea2f2c35f900461c9ac7e5604082"
+string(10) "tiger128,3"
+string(32) "8d68e78bc5e62ba925a67aa48595cfc6"
+string(32) "8d68e78bc5e62ba925a67aa48595cfc6"
+string(10) "tiger160,3"
+string(40) "8d68e78bc5e62ba925a67aa48595cfc62cd1e5e0"
+string(40) "8d68e78bc5e62ba925a67aa48595cfc62cd1e5e0"
+string(10) "tiger192,3"
+string(48) "8d68e78bc5e62ba925a67aa48595cfc62cd1e5e08224fc35"
+string(48) "8d68e78bc5e62ba925a67aa48595cfc62cd1e5e08224fc35"
+string(10) "tiger128,4"
+string(32) "a26ca3f58e74fb32ee44b099cb1b5122"
+string(32) "a26ca3f58e74fb32ee44b099cb1b5122"
+string(10) "tiger160,4"
+string(40) "a26ca3f58e74fb32ee44b099cb1b512203375900"
+string(40) "a26ca3f58e74fb32ee44b099cb1b512203375900"
+string(10) "tiger192,4"
+string(48) "a26ca3f58e74fb32ee44b099cb1b512203375900f30b741d"
+string(48) "a26ca3f58e74fb32ee44b099cb1b512203375900f30b741d"
+string(6) "snefru"
+string(64) "fbe88daa74c89b9e29468fa3cd3a657d31845e21bb58dd3f8d806f5179a85c26"
+string(64) "fbe88daa74c89b9e29468fa3cd3a657d31845e21bb58dd3f8d806f5179a85c26"
+string(9) "snefru256"
+string(64) "fbe88daa74c89b9e29468fa3cd3a657d31845e21bb58dd3f8d806f5179a85c26"
+string(64) "fbe88daa74c89b9e29468fa3cd3a657d31845e21bb58dd3f8d806f5179a85c26"
+string(4) "gost"
+string(64) "5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5"
+string(64) "5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5"
+string(11) "gost-crypto"
+string(64) "f7c4e35548d66aabe2b106f20515d289fde90969225d3d7b83f6dd12d694f043"
+string(64) "f7c4e35548d66aabe2b106f20515d289fde90969225d3d7b83f6dd12d694f043"
+string(7) "adler32"
+string(8) "6f7c0928"
+string(8) "6f7c0928"
+string(5) "crc32"
+string(8) "e5cfc160"
+string(8) "e5cfc160"
+string(6) "crc32b"
+string(8) "69147a4e"
+string(8) "69147a4e"
+string(6) "crc32c"
+string(8) "5e405e93"
+string(8) "5e405e93"
+string(6) "fnv132"
+string(8) "98139504"
+string(8) "98139504"
+string(7) "fnv1a32"
+string(8) "aae4e042"
+string(8) "aae4e042"
+string(6) "fnv164"
+string(16) "14522659f8138684"
+string(16) "14522659f8138684"
+string(7) "fnv1a64"
+string(16) "bebc746a33b6ab62"
+string(16) "bebc746a33b6ab62"
+string(5) "joaat"
+string(8) "aaebf370"
+string(8) "aaebf370"
+string(10) "haval128,3"
+string(32) "86362472c8895e68e223ef8b3711d8d9"
+string(32) "86362472c8895e68e223ef8b3711d8d9"
+string(10) "haval160,3"
+string(40) "fabdf6905f3ba18a3c93d6a16b91e31f7222a7a4"
+string(40) "fabdf6905f3ba18a3c93d6a16b91e31f7222a7a4"
+string(10) "haval192,3"
+string(48) "e05d0ff5723028bd5494f32c0c2494cd0b9ccf7540af7b47"
+string(48) "e05d0ff5723028bd5494f32c0c2494cd0b9ccf7540af7b47"
+string(10) "haval224,3"
+string(56) "56b196289d8de8a22296588cf90e5b09cb6fa1b01ce8e92bca40cae2"
+string(56) "56b196289d8de8a22296588cf90e5b09cb6fa1b01ce8e92bca40cae2"
+string(10) "haval256,3"
+string(64) "ff4d7ab0fac2ca437b945461f9b62fd16e71e9103524d5d140445a00e3d49239"
+string(64) "ff4d7ab0fac2ca437b945461f9b62fd16e71e9103524d5d140445a00e3d49239"
+string(10) "haval128,4"
+string(32) "ee44418e0195a0c4a35d112722919a9c"
+string(32) "ee44418e0195a0c4a35d112722919a9c"
+string(10) "haval160,4"
+string(40) "f320cce982d5201a1ccacc1c5ff835a258a97eb1"
+string(40) "f320cce982d5201a1ccacc1c5ff835a258a97eb1"
+string(10) "haval192,4"
+string(48) "a96600107463e8e97a7fe6f260d9bf4f4587a281caafa6db"
+string(48) "a96600107463e8e97a7fe6f260d9bf4f4587a281caafa6db"
+string(10) "haval224,4"
+string(56) "7147c9e1c1e67b942da3229f59a1ab18f121f5d7f5765ca88bc9f200"
+string(56) "7147c9e1c1e67b942da3229f59a1ab18f121f5d7f5765ca88bc9f200"
+string(10) "haval256,4"
+string(64) "82fec42679ed5a77a841962827b88a9cddf7d677736e50bc81f1a14b99f06061"
+string(64) "82fec42679ed5a77a841962827b88a9cddf7d677736e50bc81f1a14b99f06061"
+string(10) "haval128,5"
+string(32) "8d0b157828328ae7d34d60b4b60c1dab"
+string(32) "8d0b157828328ae7d34d60b4b60c1dab"
+string(10) "haval160,5"
+string(40) "54dab5e10dc41503f9b8aa32ffe3bab7cf1da8a3"
+string(40) "54dab5e10dc41503f9b8aa32ffe3bab7cf1da8a3"
+string(10) "haval192,5"
+string(48) "7d91265a1b27698279d8d95a5ee0a20014528070bf6415e7"
+string(48) "7d91265a1b27698279d8d95a5ee0a20014528070bf6415e7"
+string(10) "haval224,5"
+string(56) "7772b2e22f2a3bce917e08cf57ebece46bb33168619a776c6f2f7234"
+string(56) "7772b2e22f2a3bce917e08cf57ebece46bb33168619a776c6f2f7234"
+string(10) "haval256,5"
+string(64) "438a602cb1a761f7bd0a633b7bd8b3ccd0577b524d05174ca1ae1f559b9a2c2a"
+string(64) "438a602cb1a761f7bd0a633b7bd8b3ccd0577b524d05174ca1ae1f559b9a2c2a"
+string(3) "md2"
+string(32) "5c36f61062d091a8324991132c5e8dbd"
+string(32) "5c36f61062d091a8324991132c5e8dbd"
+string(3) "md4"
+string(32) "1d4196526aada3506efb4c7425651584"
+string(32) "1d4196526aada3506efb4c7425651584"
+string(3) "md5"
+string(32) "f255c114bd6ce94aad092b5141c00d46"
+string(32) "f255c114bd6ce94aad092b5141c00d46"
+string(4) "sha1"
+string(40) "a273396f056554dcd491b5dea1e7baa3b89b802b"
+string(40) "a273396f056554dcd491b5dea1e7baa3b89b802b"
+string(6) "sha224"
+string(56) "1aee028400c56ceb5539625dc2f395abf491409336ca0f3e177a50e2"
+string(56) "1aee028400c56ceb5539625dc2f395abf491409336ca0f3e177a50e2"
+string(6) "sha256"
+string(64) "268e7f4cf88504a53fd77136c4c4748169f46ff7150b376569ada9c374836944"
+string(64) "268e7f4cf88504a53fd77136c4c4748169f46ff7150b376569ada9c374836944"
+string(6) "sha384"
+string(96) "0d44981d04bb11b1ef75d5c2932bd0aa2785e7bc454daac954d77e2ca10047879b58997533fc99650b20049c6cb9a6cc"
+string(96) "0d44981d04bb11b1ef75d5c2932bd0aa2785e7bc454daac954d77e2ca10047879b58997533fc99650b20049c6cb9a6cc"
+string(10) "sha512/224"
+string(56) "cbc2bbf0028ed803af785b0f264962c84ec48d8ee0908322ef995ddb"
+string(56) "cbc2bbf0028ed803af785b0f264962c84ec48d8ee0908322ef995ddb"
+string(10) "sha512/256"
+string(64) "2cec704878ffa7128e0c4a61eef87d1f3c823184d364dfa3fed73beb00499b00"
+string(64) "2cec704878ffa7128e0c4a61eef87d1f3c823184d364dfa3fed73beb00499b00"
+string(6) "sha512"
+string(128) "28d7c721433782a880f840af0c3f3ea2cad4ef55de2114dda9d504cedeb110e1cf2519c49e4b5da3da4484bb6ba4fd1621ceadc6408f4410b2ebe9d83a4202c2"
+string(128) "28d7c721433782a880f840af0c3f3ea2cad4ef55de2114dda9d504cedeb110e1cf2519c49e4b5da3da4484bb6ba4fd1621ceadc6408f4410b2ebe9d83a4202c2"
+string(8) "sha3-224"
+string(56) "9a21a5464794c2c9784df50cf89cf72234e11941bddaee93f912753e"
+string(56) "9a21a5464794c2c9784df50cf89cf72234e11941bddaee93f912753e"
+string(8) "sha3-256"
+string(64) "57aa7a90f29b5ab66592760592780da247fd39b4c911773687450f9df8cc8ed0"
+string(64) "57aa7a90f29b5ab66592760592780da247fd39b4c911773687450f9df8cc8ed0"
+string(8) "sha3-384"
+string(96) "5d6d7e42b241288bc707b74c50f90a37d69a4afa854ca72021a22cb379356e53b6233aea1be2f33d393d6effa9b5e36c"
+string(96) "5d6d7e42b241288bc707b74c50f90a37d69a4afa854ca72021a22cb379356e53b6233aea1be2f33d393d6effa9b5e36c"
+string(8) "sha3-512"
+string(128) "9b88c689bc13a36e6983b32e8ee9464d63b619f246ca451d1fe2a6c9670f01e71d0c8eb245f3204d27d27c056f2a0fef76a1e3bc30fb74cccbc984dbd4883ae6"
+string(128) "9b88c689bc13a36e6983b32e8ee9464d63b619f246ca451d1fe2a6c9670f01e71d0c8eb245f3204d27d27c056f2a0fef76a1e3bc30fb74cccbc984dbd4883ae6"
+string(9) "ripemd128"
+string(32) "f95f5e22b8875ee0c48219ae97f0674b"
+string(32) "f95f5e22b8875ee0c48219ae97f0674b"
+string(9) "ripemd160"
+string(40) "900d615c1abe714e340f4ecd6a3d65599fd30ff4"
+string(40) "900d615c1abe714e340f4ecd6a3d65599fd30ff4"
+string(9) "ripemd256"
+string(64) "b9799db40d1af5614118c329169cdcd2c718db6af03bf945ea7f7ba72b8e14f4"
+string(64) "b9799db40d1af5614118c329169cdcd2c718db6af03bf945ea7f7ba72b8e14f4"
+string(9) "ripemd320"
+string(80) "d6d12c1fca7a9c4a59c1be4f40188e92a746a035219e0a6ca1ee53b36a8282527187f7dffaa57ecc"
+string(80) "d6d12c1fca7a9c4a59c1be4f40188e92a746a035219e0a6ca1ee53b36a8282527187f7dffaa57ecc"
+string(9) "whirlpool"
+string(128) "e8c6a921e7d8eac2fd21d4df6054bb27a02321b2beb5b01b6f88c40706164e64d67ec97519bf76c8af8df896745478b78d42a0159f1a0db16777771fd9d420dc"
+string(128) "e8c6a921e7d8eac2fd21d4df6054bb27a02321b2beb5b01b6f88c40706164e64d67ec97519bf76c8af8df896745478b78d42a0159f1a0db16777771fd9d420dc"
+string(10) "tiger128,3"
+string(32) "a99d2c0348d480dc0f3c35852926e0f1"
+string(32) "a99d2c0348d480dc0f3c35852926e0f1"
+string(10) "tiger160,3"
+string(40) "a99d2c0348d480dc0f3c35852926e0f1e1825c16"
+string(40) "a99d2c0348d480dc0f3c35852926e0f1e1825c16"
+string(10) "tiger192,3"
+string(48) "a99d2c0348d480dc0f3c35852926e0f1e1825c1651957ee3"
+string(48) "a99d2c0348d480dc0f3c35852926e0f1e1825c1651957ee3"
+string(10) "tiger128,4"
+string(32) "66e2c0322421c4e5a9208e6aeed481e5"
+string(32) "66e2c0322421c4e5a9208e6aeed481e5"
+string(10) "tiger160,4"
+string(40) "66e2c0322421c4e5a9208e6aeed481e5c4b00448"
+string(40) "66e2c0322421c4e5a9208e6aeed481e5c4b00448"
+string(10) "tiger192,4"
+string(48) "66e2c0322421c4e5a9208e6aeed481e5c4b00448e344d9d0"
+string(48) "66e2c0322421c4e5a9208e6aeed481e5c4b00448e344d9d0"
+string(6) "snefru"
+string(64) "614ca924864fa0e8fa309aa0944e047d5edbfd4964a35858f4d8ec66a0fb88b0"
+string(64) "614ca924864fa0e8fa309aa0944e047d5edbfd4964a35858f4d8ec66a0fb88b0"
+string(9) "snefru256"
+string(64) "614ca924864fa0e8fa309aa0944e047d5edbfd4964a35858f4d8ec66a0fb88b0"
+string(64) "614ca924864fa0e8fa309aa0944e047d5edbfd4964a35858f4d8ec66a0fb88b0"
+string(4) "gost"
+string(64) "a00961e371287c71c527a41c14564f13b6ed12ac7cd9d5f5dfb3542a25e28d3b"
+string(64) "a00961e371287c71c527a41c14564f13b6ed12ac7cd9d5f5dfb3542a25e28d3b"
+string(11) "gost-crypto"
+string(64) "68ca9aea6729dc07d995fbe071a4b5c6490bb27fc4dc65ec0e96200d5e082996"
+string(64) "68ca9aea6729dc07d995fbe071a4b5c6490bb27fc4dc65ec0e96200d5e082996"
+string(7) "adler32"
+string(8) "d9141747"
+string(8) "d9141747"
+string(5) "crc32"
+string(8) "59f8d3d2"
+string(8) "59f8d3d2"
+string(6) "crc32b"
+string(8) "3ee63999"
+string(8) "3ee63999"
+string(6) "crc32c"
+string(8) "516ad412"
+string(8) "516ad412"
+string(6) "fnv132"
+string(8) "59ad036f"
+string(8) "59ad036f"
+string(7) "fnv1a32"
+string(8) "fadc2cef"
+string(8) "fadc2cef"
+string(6) "fnv164"
+string(16) "5e8c64fba6a5ffcf"
+string(16) "5e8c64fba6a5ffcf"
+string(7) "fnv1a64"
+string(16) "893899e4415a920f"
+string(16) "893899e4415a920f"
+string(5) "joaat"
+string(8) "836fb0e5"
+string(8) "836fb0e5"
+string(10) "haval128,3"
+string(32) "ebeeeb05c18af1e53d2d127b561d5e0d"
+string(32) "ebeeeb05c18af1e53d2d127b561d5e0d"
+string(10) "haval160,3"
+string(40) "f1a2c9604fb40899ad502abe0dfcec65115c8a9a"
+string(40) "f1a2c9604fb40899ad502abe0dfcec65115c8a9a"
+string(10) "haval192,3"
+string(48) "d3a7315773a326678208650ed02510ed96cd488d74cd5231"
+string(48) "d3a7315773a326678208650ed02510ed96cd488d74cd5231"
+string(10) "haval224,3"
+string(56) "6d7132fabc83c9ab7913748b79ecf10e25409569d3ed144177f46731"
+string(56) "6d7132fabc83c9ab7913748b79ecf10e25409569d3ed144177f46731"
+string(10) "haval256,3"
+string(64) "7a469868ad4b92891a3a44524c58a2b8d0f3bebb92b4cf47d19bc6aba973eb95"
+string(64) "7a469868ad4b92891a3a44524c58a2b8d0f3bebb92b4cf47d19bc6aba973eb95"
+string(10) "haval128,4"
+string(32) "6ecddb39615f43fd211839287ff38461"
+string(32) "6ecddb39615f43fd211839287ff38461"
+string(10) "haval160,4"
+string(40) "bcd2e7821723ac22e122b8b7cbbd2daaa9a862df"
+string(40) "bcd2e7821723ac22e122b8b7cbbd2daaa9a862df"
+string(10) "haval192,4"
+string(48) "ae74619a88dcec1fbecde28e27f009a65ecc12170824d2cd"
+string(48) "ae74619a88dcec1fbecde28e27f009a65ecc12170824d2cd"
+string(10) "haval224,4"
+string(56) "fdaba6563f1334d40de24e311f14b324577f97c3b78b9439c408cdca"
+string(56) "fdaba6563f1334d40de24e311f14b324577f97c3b78b9439c408cdca"
+string(10) "haval256,4"
+string(64) "289a2ba4820218bdb25a6534fbdf693f9de101362584fdd41e32244c719caa37"
+string(64) "289a2ba4820218bdb25a6534fbdf693f9de101362584fdd41e32244c719caa37"
+string(10) "haval128,5"
+string(32) "ffa7993a4e183b245263fb1f63e27343"
+string(32) "ffa7993a4e183b245263fb1f63e27343"
+string(10) "haval160,5"
+string(40) "375ee5ab3a9bd07a1dbe5d071e07b2afb3165e3b"
+string(40) "375ee5ab3a9bd07a1dbe5d071e07b2afb3165e3b"
+string(10) "haval192,5"
+string(48) "c650585f93c6e041e835caedc621f8c42d8bc6829fb76789"
+string(48) "c650585f93c6e041e835caedc621f8c42d8bc6829fb76789"
+string(10) "haval224,5"
+string(56) "bc674d465a822817d939f19b38edde083fe5668759836c203c56e3e4"
+string(56) "bc674d465a822817d939f19b38edde083fe5668759836c203c56e3e4"
+string(10) "haval256,5"
+string(64) "da70ad9bd09ed7c9675329ea2b5279d57761807c7aeac6340d94b5d494809457"
+string(64) "da70ad9bd09ed7c9675329ea2b5279d57761807c7aeac6340d94b5d494809457"
+Done
diff --git a/ext/hash/tests/hash_serialize_002.phpt b/ext/hash/tests/hash_serialize_002.phpt
new file mode 100644
index 0000000000..b6b4ccfb5e
--- /dev/null
+++ b/ext/hash/tests/hash_serialize_002.phpt
@@ -0,0 +1,116 @@
+--TEST--
+Hash: serialize()/unserialize() with HASH_HMAC
+--FILE--
+<?php
+
+$algos = hash_algos();
+$non_crypto = ["adler32", "crc32", "crc32b", "crc32c", "fnv132", "fnv1a32", "fnv164", "fnv1a64", "joaat"];
+$key = "This is the key that I have";
+
+foreach ($algos as $algo) {
+ if (in_array($algo, $non_crypto)) {
+ continue;
+ }
+
+ var_dump($algo);
+ $ctx0 = hash_init($algo, HASH_HMAC, $key);
+ try {
+ $serial = serialize($ctx0);
+ assert(is_string($serial));
+ } catch (Throwable $e) {
+ echo $e->getMessage(), "\n";
+ }
+}
+
+echo "Done\n";
+?>
+--EXPECT--
+string(3) "md2"
+HashContext with HASH_HMAC option cannot be serialized
+string(3) "md4"
+HashContext with HASH_HMAC option cannot be serialized
+string(3) "md5"
+HashContext with HASH_HMAC option cannot be serialized
+string(4) "sha1"
+HashContext with HASH_HMAC option cannot be serialized
+string(6) "sha224"
+HashContext with HASH_HMAC option cannot be serialized
+string(6) "sha256"
+HashContext with HASH_HMAC option cannot be serialized
+string(6) "sha384"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "sha512/224"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "sha512/256"
+HashContext with HASH_HMAC option cannot be serialized
+string(6) "sha512"
+HashContext with HASH_HMAC option cannot be serialized
+string(8) "sha3-224"
+HashContext with HASH_HMAC option cannot be serialized
+string(8) "sha3-256"
+HashContext with HASH_HMAC option cannot be serialized
+string(8) "sha3-384"
+HashContext with HASH_HMAC option cannot be serialized
+string(8) "sha3-512"
+HashContext with HASH_HMAC option cannot be serialized
+string(9) "ripemd128"
+HashContext with HASH_HMAC option cannot be serialized
+string(9) "ripemd160"
+HashContext with HASH_HMAC option cannot be serialized
+string(9) "ripemd256"
+HashContext with HASH_HMAC option cannot be serialized
+string(9) "ripemd320"
+HashContext with HASH_HMAC option cannot be serialized
+string(9) "whirlpool"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "tiger128,3"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "tiger160,3"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "tiger192,3"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "tiger128,4"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "tiger160,4"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "tiger192,4"
+HashContext with HASH_HMAC option cannot be serialized
+string(6) "snefru"
+HashContext with HASH_HMAC option cannot be serialized
+string(9) "snefru256"
+HashContext with HASH_HMAC option cannot be serialized
+string(4) "gost"
+HashContext with HASH_HMAC option cannot be serialized
+string(11) "gost-crypto"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval128,3"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval160,3"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval192,3"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval224,3"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval256,3"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval128,4"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval160,4"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval192,4"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval224,4"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval256,4"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval128,5"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval160,5"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval192,5"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval224,5"
+HashContext with HASH_HMAC option cannot be serialized
+string(10) "haval256,5"
+HashContext with HASH_HMAC option cannot be serialized
+Done
diff --git a/ext/hash/tests/hash_serialize_003.phpt b/ext/hash/tests/hash_serialize_003.phpt
new file mode 100644
index 0000000000..a687c2aeff
--- /dev/null
+++ b/ext/hash/tests/hash_serialize_003.phpt
@@ -0,0 +1,261 @@
+--TEST--
+Hash: serialization formats
+--FILE--
+<?php
+
+$serializations = [
+ [
+ "md2",
+ "TzoxMToiSGFzaENvbnRleHQiOjU6e2k6MDtzOjM6Im1kMiI7aToxO2k6MDtpOjI7YTo0OntpOjA7czo0ODoiuyJG48A1rdYMPXAiWBDcbOrPsUaDg8lhMXhr/DQfjaN7dOqrImXTxBykKAln5L8sIjtpOjE7czoxNjoiwrfjcIJR1I8RljMyAxmcSyI7aToyO3M6MTY6IiBhbnl0aGluZwAAAAAAAAAiO2k6MztpOjk7fWk6MztpOjI7aTo0O2E6MDp7fX0="
+ ],
+ [
+ "md4",
+ "TzoxMToiSGFzaENvbnRleHQiOjU6e2k6MDtzOjM6Im1kNCI7aToxO2k6MDtpOjI7YTo3OntpOjA7aToxNzMyNTg0MTkzO2k6MTtpOi0yNzE3MzM4Nzk7aToyO2k6LTE3MzI1ODQxOTQ7aTozO2k6MjcxNzMzODc4O2k6NDtpOjIwMDtpOjU7aTowO2k6NjtzOjY0OiJJIGNhbid0IHJlbWVtYmVyIGFueXRoaW5nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIjt9aTozO2k6MjtpOjQ7YTowOnt9fQ=="
+ ],
+ [
+ "md5",
+ "TzoxMToiSGFzaENvbnRleHQiOjU6e2k6MDtzOjM6Im1kNSI7aToxO2k6MDtpOjI7YToyMzp7aTowO2k6MjU7aToxO2k6MDtpOjI7aToxNzMyNTg0MTkzO2k6MztpOi0yNzE3MzM4Nzk7aTo0O2k6LTE3MzI1ODQxOTQ7aTo1O2k6MjcxNzMzODc4O2k6NjtzOjY0OiJJIGNhbid0IHJlbWVtYmVyIGFueXRoaW5nAAAAAAAAAAAAAAAAAAAAA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E */
+ "TzoxMToiSGFzaENvbnRleHQiOjU6e2k6MDtzOjg6InNoYTMtNTEyIjtpOjE7aTowO2k6MjthOjI6e2k6MDtzOjIwMDoiSSBjYW4ndCByZW1lbWJlciBhbnl0aGluZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAiO2k6MTtpOjI1O31pOjM7aToyO2k6NDthOjA6e319" /* slow */
+ ]
+];
+
+
+function test_serialization($serial, $hash, $algo) {
+ try {
+ $ctx = unserialize(base64_decode($serial));
+ hash_update($ctx, "Can’t tell if this is true or dream");
+ $hash2 = hash_final($ctx);
+ if ($hash !== $hash2) {
+ echo "$algo: unexpected hash $hash2 for serialization {$serial}\n";
+ }
+ } catch (Throwable $e) {
+ echo "$algo: problem with serialization {$serial}\n";
+ echo " ", $e->getMessage(), "\n", $e->getTraceAsString();
+ }
+}
+
+foreach ($serializations as $slist) {
+ $algo = $slist[0];
+ $hash = hash($algo, "I can't remember anythingCan’t tell if this is true or dream");
+
+ $ctx = hash_init($algo);
+ hash_update($ctx, "I can't remember anything");
+ $serial = base64_encode(serialize($ctx));
+ if (!in_array($serial, $slist)) {
+ echo "$algo: unexpected serialization $serial\n";
+ }
+
+ test_serialization($serial, $hash, $algo);
+}
+
+echo "Done\n";
+?>
+--EXPECT--
+Done
diff --git a/ext/hash/tests/hash_serialize_004.phpt b/ext/hash/tests/hash_serialize_004.phpt
new file mode 100644
index 0000000000..ee5c08f973
--- /dev/null
+++ b/ext/hash/tests/hash_serialize_004.phpt
@@ -0,0 +1,45 @@
+--TEST--
+Hash: serialization errors
+--FILE--
+<?php
+
+// cannot unserialize onto an already-initialized object
+$ctx = hash_init("sha256");
+try {
+ $ctx->__unserialize($ctx->__serialize());
+} catch (Exception $e) {
+ echo $e->getMessage(), "\n";
+}
+
+// bad formats
+foreach ([
+ "TzoxMToiSGFzaENvbnRleHQiOjA6e30=", // no contents
+ "TzoxMToiSGFzaENvbnRleHQiOjU6e2k6MDtpOjE7aToxO2k6MDtpOjI7YTo4OntpOjA7aToxNzMyNTg0MTkzO2k6MTtpOi0yNzE3MzM4Nzk7aToyO2k6LTE3MzI1ODQxOTQ7aTozO2k6MjcxNzMzODc4O2k6NDtpOi0xMDA5NTg5Nzc2O2k6NTtpOjIwMDtpOjY7aTowO2k6NztzOjY0OiJJIGNhbid0IHJlbWVtYmVyIGFueXRoaW5nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIjt9aTozO2k6MjtpOjQ7YTowOnt9fQ==", // algorithm is int
+ "TzoxMToiSGFzaENvbnRleHQiOjU6e2k6MDtzOjQ6InNoYTEiO2k6MTtzOjA6IiI7aToyO2E6ODp7aTowO2k6MTczMjU4NDE5MztpOjE7aTotMjcxNzMzODc5O2k6MjtpOi0xNzMyNTg0MTk0O2k6MztpOjI3MTczMzg3ODtpOjQ7aTotMTAwOTU4OTc3NjtpOjU7aToyMDA7aTo2O2k6MDtpOjc7czo2NDoiSSBjYW4ndCByZW1lbWJlciBhbnl0aGluZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACI7fWk6MztpOjI7aTo0O2E6MDp7fX0=", // flags are string
+ "TzoxMToiSGFzaENvbnRleHQiOjU6e2k6MDtzOjQ6InNoYTEiO2k6MTtpOjE7aToyO2E6ODp7aTowO2k6MTczMjU4NDE5MztpOjE7aTotMjcxNzMzODc5O2k6MjtpOi0xNzMyNTg0MTk0O2k6MztpOjI3MTczMzg3ODtpOjQ7aTotMTAwOTU4OTc3NjtpOjU7aToyMDA7aTo2O2k6MDtpOjc7czo2NDoiSSBjYW4ndCByZW1lbWJlciBhbnl0aGluZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACI7fWk6MztpOjI7aTo0O2E6MDp7fX0=", // flags indicate HASH_HMAC
+ "TzoxMToiSGFzaENvbnRleHQiOjU6e2k6MDtzOjQ6InNoYTEiO2k6MTtpOjI7aToyO3M6MTA6ImFiY2RlZmdoaWoiO2k6MztpOjI7aTo0O2E6MDp7fX0=", // serialization format wrong
+ "TzoxMToiSGFzaENvbnRleHQiOjU6e2k6MDtzOjQ6InNoYTEiO2k6MTtpOjA7aToyO2E6ODp7aTowO2k6MTczMjU4NDE5MztpOjE7aTotMjcxNzMzODc5O2k6MjtpOi0xNzMyNTg0MTk0O2k6MztpOjI3MTczMzg3ODtpOjQ7aTotMTAwOTU4OTc3NjtpOjU7aToyMDA7aTo2O3M6MDoiIjtpOjc7czo2NDoiSSBjYW4ndCByZW1lbWJlciBhbnl0aGluZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACI7fWk6MztpOjI7aTo0O2E6MDp7fX0=", // serialization internals wrong
+ "TzoxMToiSGFzaENvbnRleHQiOjU6e2k6MDtzOjQ6InNoYTEiO2k6MTtpOjA7aToyO2E6ODp7aTowO2k6MTczMjU4NDE5MztpOjE7aTotMjcxNzMzODc5O2k6MjtpOi0xNzMyNTg0MTk0O2k6MztpOjI3MTczMzg3ODtpOjQ7aTotMTAwOTU4OTc3NjtpOjU7aToyMDA7aTo2O2k6MDtpOjc7czo2NDoiSSBjYW4ndCByZW1lbWJlciBhbnl0aGluZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACI7fWk6MztpOjA7aTo0O2E6MDp7fX0=", // bad magic number
+ "TzoxMToiSGFzaENvbnRleHQiOjU6e2k6MDtzOjQ6Inh4eDEiO2k6MTtpOjA7aToyO2E6ODp7aTowO2k6MTczMjU4NDE5MztpOjE7aTotMjcxNzMzODc5O2k6MjtpOi0xNzMyNTg0MTk0O2k6MztpOjI3MTczMzg3ODtpOjQ7aTotMTAwOTU4OTc3NjtpOjU7aToyMDA7aTo2O2k6MDtpOjc7czo2NDoiSSBjYW4ndCByZW1lbWJlciBhbnl0aGluZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACI7fWk6MztpOjI7aTo0O2E6MDp7fX0=" // bad algorithm
+] as $serial) {
+ try {
+ $ctx = unserialize(base64_decode($serial));
+ echo "Unexpected success\n";
+ } catch (Exception $e) {
+ echo $e->getMessage(), "\n";
+ }
+}
+
+echo "Done\n";
+?>
+--EXPECT--
+HashContext::__unserialize called on initialized object
+Incomplete or ill-formed serialization data
+Incomplete or ill-formed serialization data
+Incomplete or ill-formed serialization data
+HashContext with HASH_HMAC option cannot be serialized
+Incomplete or ill-formed serialization data ("sha1" code -1)
+Incomplete or ill-formed serialization data ("sha1" code -1024)
+Incomplete or ill-formed serialization data ("sha1" code -1)
+Unknown hash algorithm
+Done
diff --git a/ext/hash/tests/hash_update_stream_basic_001.phpt b/ext/hash/tests/hash_update_stream_basic_001.phpt
new file mode 100644
index 0000000000..c145784dc9
--- /dev/null
+++ b/ext/hash/tests/hash_update_stream_basic_001.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Ensure hash_update_stream() always returns the same hash when $length = 0
+--CREDITS--
+Symeon Charalabides <symeon@systasis.com> - @phpdublin
+--SKIPIF--
+<?php
+if (!extension_loaded('openssl')) die('skip openssl extension not available');
+?>
+--FILE--
+<?php
+
+for ($j=0; $j<3; $j++)
+{
+ // Create pseudo-random hash
+ $bytes = openssl_random_pseudo_bytes(15, $cstrong);
+ $hash = sha1(bin2hex($bytes));
+
+ // Create temp file with hash
+ $fp = tmpfile();
+ fwrite($fp, $hash);
+ rewind($fp);
+
+ // Stream it with 0 length and output hash
+ $ctx = hash_init('md5');
+ hash_update_stream($ctx, $fp, 0);
+ echo hash_final($ctx) . "\n";
+}
+
+?>
+--EXPECT--
+d41d8cd98f00b204e9800998ecf8427e
+d41d8cd98f00b204e9800998ecf8427e
+d41d8cd98f00b204e9800998ecf8427e
diff --git a/ext/hash/tests/haval.phpt b/ext/hash/tests/haval.phpt
index b01abdb8ef..514fc7c97b 100644
--- a/ext/hash/tests/haval.phpt
+++ b/ext/hash/tests/haval.phpt
@@ -4,24 +4,24 @@ Hash: haval algorithm (multi-vector, multi-pass, multi-width)
<?php
echo "Empty String\n";
for($pass=3; $pass<=5; $pass++)
- for($bits=128; $bits <= 256; $bits += 32) {
- $algo = sprintf('haval%d,%d',$bits,$pass);
- echo $algo . ': ' . hash($algo,'') . "\n";
- }
+ for($bits=128; $bits <= 256; $bits += 32) {
+ $algo = sprintf('haval%d,%d',$bits,$pass);
+ echo $algo . ': ' . hash($algo,'') . "\n";
+ }
echo "\"abc\"\n";
for($pass=3; $pass<=5; $pass++)
- for($bits=128; $bits <= 256; $bits += 32) {
- $algo = sprintf('haval%d,%d',$bits,$pass);
- echo $algo . ': ' . hash($algo,'abc') . "\n";
- }
+ for($bits=128; $bits <= 256; $bits += 32) {
+ $algo = sprintf('haval%d,%d',$bits,$pass);
+ echo $algo . ': ' . hash($algo,'abc') . "\n";
+ }
echo "\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ0123456789\"\n";
for($pass=3; $pass<=5; $pass++)
- for($bits=128; $bits <= 256; $bits += 32) {
- $algo = sprintf('haval%d,%d',$bits,$pass);
- echo $algo . ': ' . hash($algo,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ0123456789') . "\n";
- }
+ for($bits=128; $bits <= 256; $bits += 32) {
+ $algo = sprintf('haval%d,%d',$bits,$pass);
+ echo $algo . ': ' . hash($algo,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ0123456789') . "\n";
+ }
--EXPECT--
Empty String
haval128,3: c68f39913f901f3ddf44c707357a7d70
diff --git a/ext/hash/tests/joaat.phpt b/ext/hash/tests/joaat.phpt
index 819b598851..b066b37bb1 100644
--- a/ext/hash/tests/joaat.phpt
+++ b/ext/hash/tests/joaat.phpt
@@ -3,25 +3,25 @@ Hash: Jenkins's one-at-a-time
--FILE--
<?php
$tests = array(
- array("hello world", "3e4a5a57"),
- array("", 0),
- array("", "000000"),
- array("a", "ca2e9442"),
- array("aa", "7081738e"),
+ array("hello world", "3e4a5a57"),
+ array("", 0),
+ array("", "000000"),
+ array("a", "ca2e9442"),
+ array("aa", "7081738e"),
);
$i = 0;
$pass = true;
foreach ($tests as $test) {
- ++$i;
+ ++$i;
- $result = hash("joaat", $test[0]);
- if ($result != $test[1]) {
- echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n";
+ $result = hash("joaat", $test[0]);
+ if ($result != $test[1]) {
+ echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n";
- $pass = false;
- }
+ $pass = false;
+ }
}
if($pass) {
diff --git a/ext/hash/tests/mhash_001.phpt b/ext/hash/tests/mhash_001.phpt
index 71d6d20df6..b61bab6494 100644
--- a/ext/hash/tests/mhash_001.phpt
+++ b/ext/hash/tests/mhash_001.phpt
@@ -22,16 +22,16 @@ $supported_hash_al = array(
$data = "This is the test of the mhash extension...";
foreach ($supported_hash_al as $hash=>$wanted) {
- $result = mhash(constant($hash), $data);
- if (bin2hex($result)==$wanted) {
- echo "$hash\nok\n";
- } else {
- echo "$hash: ";
- var_dump($wanted);
- echo "$hash: ";
- var_dump(bin2hex($result));
- }
- echo "\n";
+ $result = mhash(constant($hash), $data);
+ if (bin2hex($result)==$wanted) {
+ echo "$hash\nok\n";
+ } else {
+ echo "$hash: ";
+ var_dump($wanted);
+ echo "$hash: ";
+ var_dump(bin2hex($result));
+ }
+ echo "\n";
}
?>
--EXPECT--
diff --git a/ext/hash/tests/mhash_002.phpt b/ext/hash/tests/mhash_002.phpt
index 2318470919..fdf886a71e 100644
--- a/ext/hash/tests/mhash_002.phpt
+++ b/ext/hash/tests/mhash_002.phpt
@@ -29,16 +29,16 @@ $hc = mhash_count() + 1;
$known_hash_al = array();
for ($i=0; $i < $hc; $i++) {
- $known_hash_al[mhash_get_hash_name($i)] = $i;
+ $known_hash_al[mhash_get_hash_name($i)] = $i;
}
foreach ($supported_hash_al as $name => $len) {
- if (array_key_exists($name, $known_hash_al)) {
- $len = mhash_get_block_size($known_hash_al[$name]);
- echo "$name = $len\n";
- } else {
- echo "$name ? $len\n";
- }
+ if (array_key_exists($name, $known_hash_al)) {
+ $len = mhash_get_block_size($known_hash_al[$name]);
+ echo "$name = $len\n";
+ } else {
+ echo "$name ? $len\n";
+ }
}
?>
--EXPECTREGEX--
diff --git a/ext/hash/tests/mhash_003.phpt b/ext/hash/tests/mhash_003.phpt
index a4d43eb8d5..99436b9ece 100644
--- a/ext/hash/tests/mhash_003.phpt
+++ b/ext/hash/tests/mhash_003.phpt
@@ -20,18 +20,18 @@ $supported_hash_al = array(
);
foreach ($supported_hash_al as $hash=>$wanted) {
- $passwd = str_repeat($hash, 10);
- $salt = str_repeat($hash, 2);
- $result = mhash_keygen_s2k(constant($hash), $passwd, $salt, 100);
- if (!strcmp(bin2hex($result), $wanted)) {
- echo "$hash\nok\n";
- } else {
- echo "$hash: ";
- var_dump($wanted);
- echo "$hash: ";
- var_dump(bin2hex($result));
- }
- echo "\n";
+ $passwd = str_repeat($hash, 10);
+ $salt = str_repeat($hash, 2);
+ $result = mhash_keygen_s2k(constant($hash), $passwd, $salt, 100);
+ if (!strcmp(bin2hex($result), $wanted)) {
+ echo "$hash\nok\n";
+ } else {
+ echo "$hash: ";
+ var_dump($wanted);
+ echo "$hash: ";
+ var_dump(bin2hex($result));
+ }
+ echo "\n";
}
?>
--EXPECT--
diff --git a/ext/hash/tests/reuse.phpt b/ext/hash/tests/reuse.phpt
index cd1419fd55..2b99801ebf 100644
--- a/ext/hash/tests/reuse.phpt
+++ b/ext/hash/tests/reuse.phpt
@@ -5,6 +5,12 @@ Hash: Attempt to reuse a closed hash context
$h = hash_init('md5');
hash_final($h);
-hash_update($h, 'foo');
---EXPECTF--
-Warning: hash_update(): supplied resource is not a valid Hash Context resource in %s%eext%ehash%etests%ereuse.php on line %d
+try {
+ hash_update($h, 'foo');
+}
+catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
+
+--EXPECT--
+hash_update(): Argument #1 ($context) must be a valid Hash Context resource
diff --git a/ext/hash/tests/serialize-context.phpt b/ext/hash/tests/serialize-context.phpt
deleted file mode 100644
index 32aa0ab806..0000000000
--- a/ext/hash/tests/serialize-context.phpt
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-Hash: Context serialization
---FILE--
-<?php
-
-$h = hash_init('md5');
-try {
- var_dump(serialize($h));
-} catch (Exception $e) {
- echo "Exception: {$e->getMessage()}\n";
-}
---EXPECT--
-Exception: Serialization of 'HashContext' is not allowed