Lines Matching refs:context
122 void *context; in php_hash_do_hash() local
146 context = emalloc(ops->context_size); in php_hash_do_hash()
147 ops->hash_init(context); in php_hash_do_hash()
154 ops->hash_update(context, (unsigned char *) buf, n); in php_hash_do_hash()
158 ops->hash_update(context, (unsigned char *) data, data_len); in php_hash_do_hash()
162 ops->hash_final((unsigned char *) ZSTR_VAL(digest), context); in php_hash_do_hash()
163 efree(context); in php_hash_do_hash()
211 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
215 ops->hash_init(context); in php_hash_hmac_prep_key()
216 ops->hash_update(context, key, key_len); in php_hash_hmac_prep_key()
217 ops->hash_final(K, context); in php_hash_hmac_prep_key()
225 static inline void php_hash_hmac_round(unsigned char *final, const php_hash_ops *ops, void *context… in php_hash_hmac_round() argument
226 ops->hash_init(context); in php_hash_hmac_round()
227 ops->hash_update(context, key, ops->block_size); in php_hash_hmac_round()
228 ops->hash_update(context, data, data_size); in php_hash_hmac_round()
229 ops->hash_final(final, context); in php_hash_hmac_round()
240 void *context; in php_hash_do_hash_hmac() local
270 context = emalloc(ops->context_size); in php_hash_do_hash_hmac()
275 php_hash_hmac_prep_key(K, ops, context, (unsigned char *) key, key_len); in php_hash_do_hash_hmac()
280 ops->hash_init(context); in php_hash_do_hash_hmac()
281 ops->hash_update(context, K, ops->block_size); in php_hash_do_hash_hmac()
283 ops->hash_update(context, (unsigned char *) buf, n); in php_hash_do_hash_hmac()
286 ops->hash_final((unsigned char *) ZSTR_VAL(digest), context); in php_hash_do_hash_hmac()
288 …php_hash_hmac_round((unsigned char *) ZSTR_VAL(digest), ops, context, K, (unsigned char *) data, d… in php_hash_do_hash_hmac()
293 …php_hash_hmac_round((unsigned char *) ZSTR_VAL(digest), ops, context, K, (unsigned char *) ZSTR_VA… in php_hash_do_hash_hmac()
298 efree(context); in php_hash_do_hash_hmac()
336 void *context; in php_hashcontext_ctor() local
366 context = emalloc(ops->context_size); in php_hashcontext_ctor()
367 ops->hash_init(context); in php_hashcontext_ctor()
370 hash->context = context; in php_hashcontext_ctor()
382 ops->hash_update(context, (unsigned char *) ZSTR_VAL(key), ZSTR_LEN(key)); in php_hashcontext_ctor()
383 ops->hash_final((unsigned char *) K, context); in php_hashcontext_ctor()
385 ops->hash_init(context); in php_hashcontext_ctor()
395 ops->hash_update(context, (unsigned char *) K, ops->block_size); in php_hashcontext_ctor()
410 if (!hash->context) { \
430 hash->ops->hash_update(hash->context, (unsigned char *) ZSTR_VAL(data), ZSTR_LEN(data)); in PHP_FUNCTION()
465 hash->ops->hash_update(hash->context, (unsigned char *) buf, n); in PHP_FUNCTION()
480 php_stream_context *context; in PHP_FUNCTION() local
492 context = php_stream_context_from_zval(zcontext, 0); in PHP_FUNCTION()
494 stream = php_stream_open_wrapper_ex(ZSTR_VAL(filename), "rb", REPORT_ERRORS, NULL, context); in PHP_FUNCTION()
501 hash->ops->hash_update(hash->context, (unsigned char *) buf, n); in PHP_FUNCTION()
528 hash->ops->hash_final((unsigned char *) ZSTR_VAL(digest), hash->context); in PHP_FUNCTION()
539 hash->ops->hash_init(hash->context); in PHP_FUNCTION()
540 hash->ops->hash_update(hash->context, hash->key, hash->ops->block_size); in PHP_FUNCTION()
541 hash->ops->hash_update(hash->context, (unsigned char *) ZSTR_VAL(digest), hash->ops->digest_size); in PHP_FUNCTION()
542 hash->ops->hash_final((unsigned char *) ZSTR_VAL(digest), hash->context); in PHP_FUNCTION()
552 efree(hash->context); in PHP_FUNCTION()
553 hash->context = NULL; in PHP_FUNCTION()
580 if (php_hashcontext_from_object(Z_OBJ_P(return_value))->context == NULL) { in PHP_FUNCTION()
625 void *context; in PHP_FUNCTION() local
657 context = emalloc(ops->context_size); in PHP_FUNCTION()
660 ops->hash_init(context); in PHP_FUNCTION()
662 php_hash_hmac_prep_key(K, ops, context, in PHP_FUNCTION()
666 php_hash_hmac_round(prk, ops, context, K, (unsigned char *) ZSTR_VAL(ikm), ZSTR_LEN(ikm)); in PHP_FUNCTION()
668 php_hash_hmac_round(prk, ops, context, K, prk, ops->digest_size); in PHP_FUNCTION()
679 php_hash_hmac_prep_key(K, ops, context, prk, ops->digest_size); in PHP_FUNCTION()
680 ops->hash_init(context); in PHP_FUNCTION()
681 ops->hash_update(context, K, ops->block_size); in PHP_FUNCTION()
684 ops->hash_update(context, digest, ops->digest_size); in PHP_FUNCTION()
688 ops->hash_update(context, (unsigned char *) ZSTR_VAL(info), ZSTR_LEN(info)); in PHP_FUNCTION()
691 ops->hash_update(context, c, 1); in PHP_FUNCTION()
692 ops->hash_final(digest, context); in PHP_FUNCTION()
694 php_hash_hmac_round(digest, ops, context, K, digest, ops->digest_size); in PHP_FUNCTION()
706 efree(context); in PHP_FUNCTION()
725 void *context; in PHP_FUNCTION() local
756 context = emalloc(ops->context_size); in PHP_FUNCTION()
757 ops->hash_init(context); in PHP_FUNCTION()
765 php_hash_hmac_prep_key(K1, ops, context, (unsigned char *) pass, pass_len); in PHP_FUNCTION()
797 php_hash_hmac_round(digest, ops, context, K1, computed_salt, (zend_long) salt_len + 4); in PHP_FUNCTION()
798 php_hash_hmac_round(digest, ops, context, K2, digest, ops->digest_size); in PHP_FUNCTION()
810 php_hash_hmac_round(digest, ops, context, K1, digest, ops->digest_size); in PHP_FUNCTION()
811 php_hash_hmac_round(digest, ops, context, K2, digest, ops->digest_size); in PHP_FUNCTION()
826 efree(context); in PHP_FUNCTION()
1067 void *context; in PHP_FUNCTION() local
1074 context = emalloc(ops->context_size); in PHP_FUNCTION()
1075 ops->hash_init(context); in PHP_FUNCTION()
1081 ops->hash_init(context); in PHP_FUNCTION()
1084 ops->hash_update(context, &null, 1); in PHP_FUNCTION()
1086 ops->hash_update(context, (unsigned char *)padded_salt, salt_len); in PHP_FUNCTION()
1087 ops->hash_update(context, (unsigned char *)password, password_len); in PHP_FUNCTION()
1088 ops->hash_final((unsigned char *)digest, context); in PHP_FUNCTION()
1095 efree(context); in PHP_FUNCTION()
1125 if (hash->context) { in php_hashcontext_dtor()
1127 hash->ops->hash_final(dummy, hash->context); in php_hashcontext_dtor()
1129 efree(hash->context); in php_hashcontext_dtor()
1130 hash->context = NULL; in php_hashcontext_dtor()
1151 newobj->context = emalloc(newobj->ops->context_size); in php_hashcontext_clone()
1152 newobj->ops->hash_init(newobj->context); in php_hashcontext_clone()
1154 if (SUCCESS != newobj->ops->hash_copy(newobj->ops, oldobj->context, newobj->context)) { in php_hashcontext_clone()
1155 efree(newobj->context); in php_hashcontext_clone()
1156 newobj->context = NULL; in php_hashcontext_clone()
1352 ZEND_ARG_INFO(0, context)
1357 ZEND_ARG_INFO(0, context)
1363 ZEND_ARG_INFO(0, context)
1369 ZEND_ARG_INFO(0, context)
1374 ZEND_ARG_INFO(0, context)