Lines Matching refs:K

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
212 memset(K, 0, ops->block_size); in php_hash_hmac_prep_key()
217 ops->hash_final(K, context); in php_hash_hmac_prep_key()
219 memcpy(K, key, key_len); in php_hash_hmac_prep_key()
222 php_hash_string_xor_char(K, K, 0x36, ops->block_size); in php_hash_hmac_prep_key()
236 unsigned char *K; in php_hash_do_hash_hmac() local
272 K = emalloc(ops->block_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()
281 ops->hash_update(context, K, ops->block_size); 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()
291 php_hash_string_xor_char(K, K, 0x6A, ops->block_size); 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()
296 ZEND_SECURE_ZERO(K, ops->block_size); in php_hash_do_hash_hmac()
297 efree(K); in php_hash_do_hash_hmac()
375 char *K = emalloc(ops->block_size); in php_hashcontext_ctor() local
378 memset(K, 0, ops->block_size); in php_hashcontext_ctor()
383 ops->hash_final((unsigned char *) K, context); in php_hashcontext_ctor()
387 memcpy(K, ZSTR_VAL(key), ZSTR_LEN(key)); in php_hashcontext_ctor()
393 K[i] ^= 0x36; in php_hashcontext_ctor()
395 ops->hash_update(context, (unsigned char *) K, ops->block_size); in php_hashcontext_ctor()
396 hash->key = (unsigned char *) K; in php_hashcontext_ctor()
622 unsigned char *prk, *digest, *K; in PHP_FUNCTION() local
661 K = emalloc(ops->block_size); 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()
667 php_hash_string_xor_char(K, K, 0x6A, ops->block_size); in PHP_FUNCTION()
668 php_hash_hmac_round(prk, ops, context, K, prk, ops->digest_size); in PHP_FUNCTION()
669 ZEND_SECURE_ZERO(K, ops->block_size); in PHP_FUNCTION()
679 php_hash_hmac_prep_key(K, ops, context, prk, ops->digest_size); in PHP_FUNCTION()
681 ops->hash_update(context, K, ops->block_size); in PHP_FUNCTION()
693 php_hash_string_xor_char(K, K, 0x6A, ops->block_size); in PHP_FUNCTION()
694 php_hash_hmac_round(digest, ops, context, K, digest, ops->digest_size); in PHP_FUNCTION()
702 ZEND_SECURE_ZERO(K, ops->block_size); in PHP_FUNCTION()
705 efree(K); in PHP_FUNCTION()