Lines Matching refs:context
236 unsigned char *buf = (unsigned char *) hash->context; in php_hash_serialize_spec()
284 unsigned char *buf = (unsigned char *) hash->context; in php_hash_unserialize_spec()
364 void *context; in php_hash_do_hash() local
384 context = php_hash_alloc_context(ops); in php_hash_do_hash()
385 ops->hash_init(context, args); in php_hash_do_hash()
392 ops->hash_update(context, (unsigned char *) buf, n); in php_hash_do_hash()
396 efree(context); in php_hash_do_hash()
400 ops->hash_update(context, (unsigned char *) data, data_len); in php_hash_do_hash()
404 ops->hash_final((unsigned char *) ZSTR_VAL(digest), context); in php_hash_do_hash()
405 efree(context); in php_hash_do_hash()
479 static inline void php_hash_hmac_prep_key(unsigned char *K, const php_hash_ops *ops, void *context,… in php_hash_hmac_prep_key() argument
483 ops->hash_init(context, NULL); in php_hash_hmac_prep_key()
484 ops->hash_update(context, key, key_len); in php_hash_hmac_prep_key()
485 ops->hash_final(K, context); in php_hash_hmac_prep_key()
493 static inline void php_hash_hmac_round(unsigned char *final, const php_hash_ops *ops, void *context… in php_hash_hmac_round() argument
494 ops->hash_init(context, NULL); in php_hash_hmac_round()
495 ops->hash_update(context, key, ops->block_size); in php_hash_hmac_round()
496 ops->hash_update(context, data, data_size); in php_hash_hmac_round()
497 ops->hash_final(final, context); in php_hash_hmac_round()
506 void *context; in php_hash_do_hash_hmac() local
527 context = php_hash_alloc_context(ops); in php_hash_do_hash_hmac()
532 php_hash_hmac_prep_key(K, ops, context, (unsigned char *) key, key_len); in php_hash_do_hash_hmac()
537 ops->hash_init(context, NULL); in php_hash_do_hash_hmac()
538 ops->hash_update(context, K, ops->block_size); in php_hash_do_hash_hmac()
540 ops->hash_update(context, (unsigned char *) buf, n); in php_hash_do_hash_hmac()
544 efree(context); in php_hash_do_hash_hmac()
550 ops->hash_final((unsigned char *) ZSTR_VAL(digest), context); in php_hash_do_hash_hmac()
552 …php_hash_hmac_round((unsigned char *) ZSTR_VAL(digest), ops, context, K, (unsigned char *) data, d… in php_hash_do_hash_hmac()
557 …php_hash_hmac_round((unsigned char *) ZSTR_VAL(digest), ops, context, K, (unsigned char *) ZSTR_VA… in php_hash_do_hash_hmac()
562 efree(context); in php_hash_do_hash_hmac()
617 void *context; in PHP_FUNCTION() local
647 context = php_hash_alloc_context(ops); in PHP_FUNCTION()
648 ops->hash_init(context, args); in PHP_FUNCTION()
651 hash->context = context; in PHP_FUNCTION()
663 ops->hash_update(context, (unsigned char *) ZSTR_VAL(key), ZSTR_LEN(key)); in PHP_FUNCTION()
664 ops->hash_final((unsigned char *) K, context); in PHP_FUNCTION()
666 ops->hash_init(context, args); in PHP_FUNCTION()
676 ops->hash_update(context, (unsigned char *) K, ops->block_size); in PHP_FUNCTION()
683 if (!hash->context) { \
702 hash->ops->hash_update(hash->context, (unsigned char *) ZSTR_VAL(data), ZSTR_LEN(data)); in PHP_FUNCTION()
736 hash->ops->hash_update(hash->context, (unsigned char *) buf, n); in PHP_FUNCTION()
750 php_stream_context *context = NULL; in PHP_FUNCTION() local
762 context = php_stream_context_from_zval(zcontext, 0); in PHP_FUNCTION()
764 stream = php_stream_open_wrapper_ex(ZSTR_VAL(filename), "rb", REPORT_ERRORS, NULL, context); in PHP_FUNCTION()
771 hash->ops->hash_update(hash->context, (unsigned char *) buf, n); in PHP_FUNCTION()
797 hash->ops->hash_final((unsigned char *) ZSTR_VAL(digest), hash->context); in PHP_FUNCTION()
808 hash->ops->hash_init(hash->context, NULL); in PHP_FUNCTION()
809 hash->ops->hash_update(hash->context, hash->key, hash->ops->block_size); in PHP_FUNCTION()
810 hash->ops->hash_update(hash->context, (unsigned char *) ZSTR_VAL(digest), hash->ops->digest_size); in PHP_FUNCTION()
811 hash->ops->hash_final((unsigned char *) ZSTR_VAL(digest), hash->context); in PHP_FUNCTION()
821 efree(hash->context); in PHP_FUNCTION()
822 hash->context = NULL; in PHP_FUNCTION()
841 php_hashcontext_object *context; in PHP_FUNCTION() local
847 context = php_hashcontext_from_object(Z_OBJ_P(zhash)); in PHP_FUNCTION()
848 PHP_HASHCONTEXT_VERIFY(context); in PHP_FUNCTION()
852 if (php_hashcontext_from_object(Z_OBJ_P(return_value))->context == NULL) { in PHP_FUNCTION()
905 void *context; in PHP_FUNCTION() local
932 context = php_hash_alloc_context(ops); in PHP_FUNCTION()
935 ops->hash_init(context, NULL); in PHP_FUNCTION()
937 php_hash_hmac_prep_key(K, ops, context, in PHP_FUNCTION()
941 php_hash_hmac_round(prk, ops, context, K, (unsigned char *) ZSTR_VAL(ikm), ZSTR_LEN(ikm)); in PHP_FUNCTION()
943 php_hash_hmac_round(prk, ops, context, K, prk, ops->digest_size); in PHP_FUNCTION()
954 php_hash_hmac_prep_key(K, ops, context, prk, ops->digest_size); in PHP_FUNCTION()
955 ops->hash_init(context, NULL); in PHP_FUNCTION()
956 ops->hash_update(context, K, ops->block_size); in PHP_FUNCTION()
959 ops->hash_update(context, digest, ops->digest_size); in PHP_FUNCTION()
963 ops->hash_update(context, (unsigned char *) ZSTR_VAL(info), ZSTR_LEN(info)); in PHP_FUNCTION()
966 ops->hash_update(context, c, 1); in PHP_FUNCTION()
967 ops->hash_final(digest, context); in PHP_FUNCTION()
969 php_hash_hmac_round(digest, ops, context, K, digest, ops->digest_size); in PHP_FUNCTION()
981 efree(context); in PHP_FUNCTION()
999 void *context; in PHP_FUNCTION() local
1027 context = php_hash_alloc_context(ops); in PHP_FUNCTION()
1028 ops->hash_init(context, args); in PHP_FUNCTION()
1036 php_hash_hmac_prep_key(K1, ops, context, (unsigned char *) pass, pass_len); in PHP_FUNCTION()
1068 php_hash_hmac_round(digest, ops, context, K1, computed_salt, (zend_long) salt_len + 4); in PHP_FUNCTION()
1069 php_hash_hmac_round(digest, ops, context, K2, digest, ops->digest_size); in PHP_FUNCTION()
1081 php_hash_hmac_round(digest, ops, context, K1, digest, ops->digest_size); in PHP_FUNCTION()
1082 php_hash_hmac_round(digest, ops, context, K2, digest, ops->digest_size); in PHP_FUNCTION()
1097 efree(context); in PHP_FUNCTION()
1322 void *context; in PHP_FUNCTION() local
1332 context = php_hash_alloc_context(ops); in PHP_FUNCTION()
1333 ops->hash_init(context, NULL); in PHP_FUNCTION()
1339 ops->hash_init(context, NULL); in PHP_FUNCTION()
1342 ops->hash_update(context, &null, 1); in PHP_FUNCTION()
1344 ops->hash_update(context, (unsigned char *)padded_salt, salt_len); in PHP_FUNCTION()
1345 ops->hash_update(context, (unsigned char *)password, password_len); in PHP_FUNCTION()
1346 ops->hash_final((unsigned char *)digest, context); in PHP_FUNCTION()
1353 efree(context); in PHP_FUNCTION()
1382 if (hash->context) { in php_hashcontext_dtor()
1383 efree(hash->context); in php_hashcontext_dtor()
1384 hash->context = NULL; in php_hashcontext_dtor()
1406 if (!oldobj->context) { in php_hashcontext_clone()
1415 newobj->context = php_hash_alloc_context(newobj->ops); in php_hashcontext_clone()
1416 newobj->ops->hash_init(newobj->context, NULL); in php_hashcontext_clone()
1418 if (SUCCESS != newobj->ops->hash_copy(newobj->ops, oldobj->context, newobj->context)) { in php_hashcontext_clone()
1419 efree(newobj->context); in php_hashcontext_clone()
1420 newobj->context = NULL; in php_hashcontext_clone()
1515 if (hash->context) { in PHP_METHOD()
1552 hash->context = php_hash_alloc_context(ops); in PHP_METHOD()
1554 ops->hash_init(hash->context, NULL); in PHP_METHOD()