Lines Matching refs:context

123 	void *context;  in php_hash_do_hash()  local
147 context = emalloc(ops->context_size); in php_hash_do_hash()
148 ops->hash_init(context); in php_hash_do_hash()
155 ops->hash_update(context, (unsigned char *) buf, n); in php_hash_do_hash()
159 efree(context); in php_hash_do_hash()
163 ops->hash_update(context, (unsigned char *) data, data_len); in php_hash_do_hash()
167 ops->hash_final((unsigned char *) ZSTR_VAL(digest), context); in php_hash_do_hash()
168 efree(context); in php_hash_do_hash()
216 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
220 ops->hash_init(context); in php_hash_hmac_prep_key()
221 ops->hash_update(context, key, key_len); in php_hash_hmac_prep_key()
222 ops->hash_final(K, context); in php_hash_hmac_prep_key()
230 static inline void php_hash_hmac_round(unsigned char *final, const php_hash_ops *ops, void *context in php_hash_hmac_round() argument
231 ops->hash_init(context); in php_hash_hmac_round()
232 ops->hash_update(context, key, ops->block_size); in php_hash_hmac_round()
233 ops->hash_update(context, data, data_size); in php_hash_hmac_round()
234 ops->hash_final(final, context); in php_hash_hmac_round()
245 void *context; in php_hash_do_hash_hmac() local
275 context = emalloc(ops->context_size); in php_hash_do_hash_hmac()
280 php_hash_hmac_prep_key(K, ops, context, (unsigned char *) key, key_len); in php_hash_do_hash_hmac()
285 ops->hash_init(context); in php_hash_do_hash_hmac()
286 ops->hash_update(context, K, ops->block_size); in php_hash_do_hash_hmac()
288 ops->hash_update(context, (unsigned char *) buf, n); in php_hash_do_hash_hmac()
292 efree(context); in php_hash_do_hash_hmac()
298 ops->hash_final((unsigned char *) ZSTR_VAL(digest), context); in php_hash_do_hash_hmac()
300 …php_hash_hmac_round((unsigned char *) ZSTR_VAL(digest), ops, context, K, (unsigned char *) data, d… in php_hash_do_hash_hmac()
305 …php_hash_hmac_round((unsigned char *) ZSTR_VAL(digest), ops, context, K, (unsigned char *) ZSTR_VA… in php_hash_do_hash_hmac()
310 efree(context); in php_hash_do_hash_hmac()
351 void *context; in PHP_FUNCTION() local
380 context = emalloc(ops->context_size); in PHP_FUNCTION()
381 ops->hash_init(context); in PHP_FUNCTION()
384 hash->context = context; in PHP_FUNCTION()
396 ops->hash_update(context, (unsigned char *) ZSTR_VAL(key), ZSTR_LEN(key)); in PHP_FUNCTION()
397 ops->hash_final((unsigned char *) K, context); in PHP_FUNCTION()
399 ops->hash_init(context); in PHP_FUNCTION()
409 ops->hash_update(context, (unsigned char *) K, ops->block_size); in PHP_FUNCTION()
416 if (!hash->context) { \
436 hash->ops->hash_update(hash->context, (unsigned char *) ZSTR_VAL(data), ZSTR_LEN(data)); in PHP_FUNCTION()
471 hash->ops->hash_update(hash->context, (unsigned char *) buf, n); in PHP_FUNCTION()
486 php_stream_context *context; in PHP_FUNCTION() local
498 context = php_stream_context_from_zval(zcontext, 0); in PHP_FUNCTION()
500 stream = php_stream_open_wrapper_ex(ZSTR_VAL(filename), "rb", REPORT_ERRORS, NULL, context); in PHP_FUNCTION()
507 hash->ops->hash_update(hash->context, (unsigned char *) buf, n); in PHP_FUNCTION()
534 hash->ops->hash_final((unsigned char *) ZSTR_VAL(digest), hash->context); 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()
558 efree(hash->context); in PHP_FUNCTION()
559 hash->context = NULL; in PHP_FUNCTION()
586 if (php_hashcontext_from_object(Z_OBJ_P(return_value))->context == NULL) { in PHP_FUNCTION()
632 void *context; in PHP_FUNCTION() local
664 context = emalloc(ops->context_size); in PHP_FUNCTION()
667 ops->hash_init(context); in PHP_FUNCTION()
669 php_hash_hmac_prep_key(K, ops, context, in PHP_FUNCTION()
673 php_hash_hmac_round(prk, ops, context, K, (unsigned char *) ZSTR_VAL(ikm), ZSTR_LEN(ikm)); in PHP_FUNCTION()
675 php_hash_hmac_round(prk, ops, context, K, prk, ops->digest_size); in PHP_FUNCTION()
686 php_hash_hmac_prep_key(K, ops, context, prk, ops->digest_size); in PHP_FUNCTION()
687 ops->hash_init(context); in PHP_FUNCTION()
688 ops->hash_update(context, K, ops->block_size); in PHP_FUNCTION()
691 ops->hash_update(context, digest, ops->digest_size); in PHP_FUNCTION()
695 ops->hash_update(context, (unsigned char *) ZSTR_VAL(info), ZSTR_LEN(info)); in PHP_FUNCTION()
698 ops->hash_update(context, c, 1); in PHP_FUNCTION()
699 ops->hash_final(digest, context); in PHP_FUNCTION()
701 php_hash_hmac_round(digest, ops, context, K, digest, ops->digest_size); in PHP_FUNCTION()
713 efree(context); in PHP_FUNCTION()
732 void *context; in PHP_FUNCTION() local
763 context = emalloc(ops->context_size); in PHP_FUNCTION()
764 ops->hash_init(context); in PHP_FUNCTION()
772 php_hash_hmac_prep_key(K1, ops, context, (unsigned char *) pass, pass_len); in PHP_FUNCTION()
804 php_hash_hmac_round(digest, ops, context, K1, computed_salt, (zend_long) salt_len + 4); in PHP_FUNCTION()
805 php_hash_hmac_round(digest, ops, context, K2, digest, ops->digest_size); in PHP_FUNCTION()
817 php_hash_hmac_round(digest, ops, context, K1, digest, ops->digest_size); in PHP_FUNCTION()
818 php_hash_hmac_round(digest, ops, context, K2, digest, ops->digest_size); in PHP_FUNCTION()
833 efree(context); in PHP_FUNCTION()
1074 void *context; in PHP_FUNCTION() local
1084 context = emalloc(ops->context_size); in PHP_FUNCTION()
1085 ops->hash_init(context); in PHP_FUNCTION()
1091 ops->hash_init(context); in PHP_FUNCTION()
1094 ops->hash_update(context, &null, 1); in PHP_FUNCTION()
1096 ops->hash_update(context, (unsigned char *)padded_salt, salt_len); in PHP_FUNCTION()
1097 ops->hash_update(context, (unsigned char *)password, password_len); in PHP_FUNCTION()
1098 ops->hash_final((unsigned char *)digest, context); in PHP_FUNCTION()
1105 efree(context); in PHP_FUNCTION()
1135 if (hash->context) { 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()
1161 newobj->context = emalloc(newobj->ops->context_size); in php_hashcontext_clone()
1162 newobj->ops->hash_init(newobj->context); in php_hashcontext_clone()
1164 if (SUCCESS != newobj->ops->hash_copy(newobj->ops, oldobj->context, newobj->context)) { in php_hashcontext_clone()
1165 efree(newobj->context); in php_hashcontext_clone()
1166 newobj->context = NULL; in php_hashcontext_clone()
1363 ZEND_ARG_INFO(0, context)
1368 ZEND_ARG_INFO(0, context)
1374 ZEND_ARG_INFO(0, context)
1380 ZEND_ARG_INFO(0, context)
1385 ZEND_ARG_INFO(0, context)