Lines Matching refs:hash

187 PHP_FUNCTION(hash)  in PHP_FUNCTION()  argument
353 php_hashcontext_object *hash; in PHP_FUNCTION() local
378 hash = php_hashcontext_from_object(Z_OBJ_P(return_value)); in PHP_FUNCTION()
383 hash->ops = ops; in PHP_FUNCTION()
384 hash->context = context; in PHP_FUNCTION()
385 hash->options = options; in PHP_FUNCTION()
386 hash->key = NULL; in PHP_FUNCTION()
410 hash->key = (unsigned char *) K; in PHP_FUNCTION()
415 #define PHP_HASHCONTEXT_VERIFY(func, hash) { \ argument
416 if (!hash->context) { \
427 php_hashcontext_object *hash; in PHP_FUNCTION() local
434 hash = php_hashcontext_from_object(Z_OBJ_P(zhash)); in PHP_FUNCTION()
435 PHP_HASHCONTEXT_VERIFY("hash_update", hash); in PHP_FUNCTION()
436 hash->ops->hash_update(hash->context, (unsigned char *) ZSTR_VAL(data), ZSTR_LEN(data)); in PHP_FUNCTION()
447 php_hashcontext_object *hash; in PHP_FUNCTION() local
455 hash = php_hashcontext_from_object(Z_OBJ_P(zhash)); in PHP_FUNCTION()
456 PHP_HASHCONTEXT_VERIFY("hash_update_stream", hash); in PHP_FUNCTION()
471 hash->ops->hash_update(hash->context, (unsigned char *) buf, n); in PHP_FUNCTION()
485 php_hashcontext_object *hash; in PHP_FUNCTION() local
496 hash = php_hashcontext_from_object(Z_OBJ_P(zhash)); in PHP_FUNCTION()
497 PHP_HASHCONTEXT_VERIFY("hash_update_file", hash); in PHP_FUNCTION()
507 hash->ops->hash_update(hash->context, (unsigned char *) buf, n); in PHP_FUNCTION()
520 php_hashcontext_object *hash; in PHP_FUNCTION() local
529 hash = php_hashcontext_from_object(Z_OBJ_P(zhash)); in PHP_FUNCTION()
530 PHP_HASHCONTEXT_VERIFY("hash_final", hash); in PHP_FUNCTION()
532 digest_len = hash->ops->digest_size; in PHP_FUNCTION()
534 hash->ops->hash_final((unsigned char *) ZSTR_VAL(digest), hash->context); in PHP_FUNCTION()
535 if (hash->options & PHP_HASH_HMAC) { in PHP_FUNCTION()
539 block_size = hash->ops->block_size; in PHP_FUNCTION()
541 hash->key[i] ^= 0x6A; in PHP_FUNCTION()
545 hash->ops->hash_init(hash->context); in PHP_FUNCTION()
546 hash->ops->hash_update(hash->context, hash->key, hash->ops->block_size); in PHP_FUNCTION()
547 hash->ops->hash_update(hash->context, (unsigned char *) ZSTR_VAL(digest), hash->ops->digest_size); in PHP_FUNCTION()
548 hash->ops->hash_final((unsigned char *) ZSTR_VAL(digest), hash->context); in PHP_FUNCTION()
551 ZEND_SECURE_ZERO(hash->key, hash->ops->block_size); in PHP_FUNCTION()
552 efree(hash->key); in PHP_FUNCTION()
553 hash->key = NULL; in PHP_FUNCTION()
558 efree(hash->context); in PHP_FUNCTION()
559 hash->context = NULL; in PHP_FUNCTION()
1132 php_hashcontext_object *hash = php_hashcontext_from_object(obj); in php_hashcontext_dtor() local
1135 if (hash->context) { in php_hashcontext_dtor()
1136 unsigned char *dummy = emalloc(hash->ops->digest_size); in php_hashcontext_dtor()
1137 hash->ops->hash_final(dummy, hash->context); in php_hashcontext_dtor()
1139 efree(hash->context); in php_hashcontext_dtor()
1140 hash->context = NULL; in php_hashcontext_dtor()
1143 if (hash->key) { in php_hashcontext_dtor()
1144 ZEND_SECURE_ZERO(hash->key, hash->ops->block_size); in php_hashcontext_dtor()
1145 efree(hash->key); in php_hashcontext_dtor()
1146 hash->key = NULL; in php_hashcontext_dtor()
1181 PHP_MINIT_FUNCTION(hash) in PHP_MINIT_FUNCTION() argument
1269 PHP_MSHUTDOWN_FUNCTION(hash) in PHP_MSHUTDOWN_FUNCTION() argument
1279 PHP_MINFO_FUNCTION(hash) in PHP_MINFO_FUNCTION() argument
1416 ZEND_ARG_INFO(0, hash)
1420 ZEND_ARG_INFO(0, hash)
1424 ZEND_ARG_INFO(0, hash)
1434 ZEND_ARG_INFO(0, hash)
1445 PHP_FE(hash, arginfo_hash)
1493 PHP_MINIT(hash),
1494 PHP_MSHUTDOWN(hash),
1497 PHP_MINFO(hash),