Lines Matching refs:context

228 	unsigned char *buf = (unsigned char *) hash->context;  in php_hash_serialize_spec()
276 unsigned char *buf = (unsigned char *) hash->context; in php_hash_unserialize_spec()
356 void *context; in php_hash_do_hash() local
376 context = php_hash_alloc_context(ops); in php_hash_do_hash()
377 ops->hash_init(context); in php_hash_do_hash()
384 ops->hash_update(context, (unsigned char *) buf, n); in php_hash_do_hash()
388 efree(context); in php_hash_do_hash()
392 ops->hash_update(context, (unsigned char *) data, data_len); in php_hash_do_hash()
396 ops->hash_final((unsigned char *) ZSTR_VAL(digest), context); in php_hash_do_hash()
397 efree(context); in php_hash_do_hash()
467 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
471 ops->hash_init(context); in php_hash_hmac_prep_key()
472 ops->hash_update(context, key, key_len); in php_hash_hmac_prep_key()
473 ops->hash_final(K, context); in php_hash_hmac_prep_key()
481 static inline void php_hash_hmac_round(unsigned char *final, const php_hash_ops *ops, void *context in php_hash_hmac_round() argument
482 ops->hash_init(context); in php_hash_hmac_round()
483 ops->hash_update(context, key, ops->block_size); in php_hash_hmac_round()
484 ops->hash_update(context, data, data_size); in php_hash_hmac_round()
485 ops->hash_final(final, context); in php_hash_hmac_round()
494 void *context; in php_hash_do_hash_hmac() local
515 context = php_hash_alloc_context(ops); in php_hash_do_hash_hmac()
520 php_hash_hmac_prep_key(K, ops, context, (unsigned char *) key, key_len); in php_hash_do_hash_hmac()
525 ops->hash_init(context); in php_hash_do_hash_hmac()
526 ops->hash_update(context, K, ops->block_size); in php_hash_do_hash_hmac()
528 ops->hash_update(context, (unsigned char *) buf, n); in php_hash_do_hash_hmac()
532 efree(context); in php_hash_do_hash_hmac()
538 ops->hash_final((unsigned char *) ZSTR_VAL(digest), context); in php_hash_do_hash_hmac()
540 …php_hash_hmac_round((unsigned char *) ZSTR_VAL(digest), ops, context, K, (unsigned char *) data, d… in php_hash_do_hash_hmac()
545 …php_hash_hmac_round((unsigned char *) ZSTR_VAL(digest), ops, context, K, (unsigned char *) ZSTR_VA… in php_hash_do_hash_hmac()
550 efree(context); in php_hash_do_hash_hmac()
605 void *context; in PHP_FUNCTION() local
634 context = php_hash_alloc_context(ops); in PHP_FUNCTION()
635 ops->hash_init(context); in PHP_FUNCTION()
638 hash->context = context; in PHP_FUNCTION()
650 ops->hash_update(context, (unsigned char *) ZSTR_VAL(key), ZSTR_LEN(key)); in PHP_FUNCTION()
651 ops->hash_final((unsigned char *) K, context); in PHP_FUNCTION()
653 ops->hash_init(context); in PHP_FUNCTION()
663 ops->hash_update(context, (unsigned char *) K, ops->block_size); in PHP_FUNCTION()
670 if (!hash->context) { \
689 hash->ops->hash_update(hash->context, (unsigned char *) ZSTR_VAL(data), ZSTR_LEN(data)); in PHP_FUNCTION()
723 hash->ops->hash_update(hash->context, (unsigned char *) buf, n); in PHP_FUNCTION()
737 php_stream_context *context = NULL; in PHP_FUNCTION() local
749 context = php_stream_context_from_zval(zcontext, 0); in PHP_FUNCTION()
751 stream = php_stream_open_wrapper_ex(ZSTR_VAL(filename), "rb", REPORT_ERRORS, NULL, context); in PHP_FUNCTION()
758 hash->ops->hash_update(hash->context, (unsigned char *) buf, n); in PHP_FUNCTION()
784 hash->ops->hash_final((unsigned char *) ZSTR_VAL(digest), hash->context); in PHP_FUNCTION()
795 hash->ops->hash_init(hash->context); in PHP_FUNCTION()
796 hash->ops->hash_update(hash->context, hash->key, hash->ops->block_size); in PHP_FUNCTION()
797 hash->ops->hash_update(hash->context, (unsigned char *) ZSTR_VAL(digest), hash->ops->digest_size); in PHP_FUNCTION()
798 hash->ops->hash_final((unsigned char *) ZSTR_VAL(digest), hash->context); in PHP_FUNCTION()
808 efree(hash->context); in PHP_FUNCTION()
809 hash->context = NULL; in PHP_FUNCTION()
835 if (php_hashcontext_from_object(Z_OBJ_P(return_value))->context == NULL) { in PHP_FUNCTION()
888 void *context; in PHP_FUNCTION() local
915 context = php_hash_alloc_context(ops); in PHP_FUNCTION()
918 ops->hash_init(context); in PHP_FUNCTION()
920 php_hash_hmac_prep_key(K, ops, context, in PHP_FUNCTION()
924 php_hash_hmac_round(prk, ops, context, K, (unsigned char *) ZSTR_VAL(ikm), ZSTR_LEN(ikm)); in PHP_FUNCTION()
926 php_hash_hmac_round(prk, ops, context, K, prk, ops->digest_size); in PHP_FUNCTION()
937 php_hash_hmac_prep_key(K, ops, context, prk, ops->digest_size); in PHP_FUNCTION()
938 ops->hash_init(context); in PHP_FUNCTION()
939 ops->hash_update(context, K, ops->block_size); in PHP_FUNCTION()
942 ops->hash_update(context, digest, ops->digest_size); in PHP_FUNCTION()
946 ops->hash_update(context, (unsigned char *) ZSTR_VAL(info), ZSTR_LEN(info)); in PHP_FUNCTION()
949 ops->hash_update(context, c, 1); in PHP_FUNCTION()
950 ops->hash_final(digest, context); in PHP_FUNCTION()
952 php_hash_hmac_round(digest, ops, context, K, digest, ops->digest_size); in PHP_FUNCTION()
964 efree(context); in PHP_FUNCTION()
982 void *context; in PHP_FUNCTION() local
1009 context = php_hash_alloc_context(ops); in PHP_FUNCTION()
1010 ops->hash_init(context); in PHP_FUNCTION()
1018 php_hash_hmac_prep_key(K1, ops, context, (unsigned char *) pass, pass_len); in PHP_FUNCTION()
1050 php_hash_hmac_round(digest, ops, context, K1, computed_salt, (zend_long) salt_len + 4); in PHP_FUNCTION()
1051 php_hash_hmac_round(digest, ops, context, K2, digest, ops->digest_size); in PHP_FUNCTION()
1063 php_hash_hmac_round(digest, ops, context, K1, digest, ops->digest_size); in PHP_FUNCTION()
1064 php_hash_hmac_round(digest, ops, context, K2, digest, ops->digest_size); in PHP_FUNCTION()
1079 efree(context); in PHP_FUNCTION()
1311 void *context; in PHP_FUNCTION() local
1321 context = php_hash_alloc_context(ops); in PHP_FUNCTION()
1322 ops->hash_init(context); in PHP_FUNCTION()
1328 ops->hash_init(context); in PHP_FUNCTION()
1331 ops->hash_update(context, &null, 1); in PHP_FUNCTION()
1333 ops->hash_update(context, (unsigned char *)padded_salt, salt_len); in PHP_FUNCTION()
1334 ops->hash_update(context, (unsigned char *)password, password_len); in PHP_FUNCTION()
1335 ops->hash_final((unsigned char *)digest, context); in PHP_FUNCTION()
1342 efree(context); in PHP_FUNCTION()
1371 if (hash->context) { in php_hashcontext_dtor()
1372 efree(hash->context); in php_hashcontext_dtor()
1373 hash->context = NULL; in php_hashcontext_dtor()
1394 newobj->context = php_hash_alloc_context(newobj->ops); in php_hashcontext_clone()
1395 newobj->ops->hash_init(newobj->context); in php_hashcontext_clone()
1397 if (SUCCESS != newobj->ops->hash_copy(newobj->ops, oldobj->context, newobj->context)) { in php_hashcontext_clone()
1398 efree(newobj->context); in php_hashcontext_clone()
1399 newobj->context = NULL; in php_hashcontext_clone()
1494 if (hash->context) { in PHP_METHOD()
1531 hash->context = php_hash_alloc_context(ops); in PHP_METHOD()
1532 ops->hash_init(hash->context); in PHP_METHOD()