Lines Matching refs:K

478 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
479 memset(K, 0, ops->block_size); in php_hash_hmac_prep_key()
484 ops->hash_final(K, context); in php_hash_hmac_prep_key()
486 memcpy(K, key, key_len); in php_hash_hmac_prep_key()
489 php_hash_string_xor_char(K, K, 0x36, ops->block_size); in php_hash_hmac_prep_key()
503 unsigned char *K; in php_hash_do_hash_hmac() local
528 K = emalloc(ops->block_size); in php_hash_do_hash_hmac()
531 php_hash_hmac_prep_key(K, ops, context, (unsigned char *) key, key_len); in php_hash_do_hash_hmac()
537 ops->hash_update(context, K, ops->block_size); in php_hash_do_hash_hmac()
544 efree(K); in php_hash_do_hash_hmac()
551 …php_hash_hmac_round((unsigned char *) ZSTR_VAL(digest), ops, context, K, (unsigned char *) data, d… in php_hash_do_hash_hmac()
554 php_hash_string_xor_char(K, K, 0x6A, ops->block_size); in php_hash_do_hash_hmac()
556 …php_hash_hmac_round((unsigned char *) ZSTR_VAL(digest), ops, context, K, (unsigned char *) ZSTR_VA… in php_hash_do_hash_hmac()
559 ZEND_SECURE_ZERO(K, ops->block_size); in php_hash_do_hash_hmac()
560 efree(K); in php_hash_do_hash_hmac()
655 char *K = emalloc(ops->block_size); in PHP_FUNCTION() local
658 memset(K, 0, ops->block_size); in PHP_FUNCTION()
663 ops->hash_final((unsigned char *) K, context); in PHP_FUNCTION()
667 memcpy(K, ZSTR_VAL(key), ZSTR_LEN(key)); in PHP_FUNCTION()
673 K[i] ^= 0x36; in PHP_FUNCTION()
675 ops->hash_update(context, (unsigned char *) K, ops->block_size); in PHP_FUNCTION()
676 hash->key = (unsigned char *) K; in PHP_FUNCTION()
900 unsigned char *prk, *digest, *K; in PHP_FUNCTION() local
935 K = emalloc(ops->block_size); in PHP_FUNCTION()
936 php_hash_hmac_prep_key(K, ops, context, in PHP_FUNCTION()
940 php_hash_hmac_round(prk, ops, context, K, (unsigned char *) ZSTR_VAL(ikm), ZSTR_LEN(ikm)); in PHP_FUNCTION()
941 php_hash_string_xor_char(K, K, 0x6A, ops->block_size); in PHP_FUNCTION()
942 php_hash_hmac_round(prk, ops, context, K, prk, ops->digest_size); in PHP_FUNCTION()
943 ZEND_SECURE_ZERO(K, ops->block_size); in PHP_FUNCTION()
953 php_hash_hmac_prep_key(K, ops, context, prk, ops->digest_size); in PHP_FUNCTION()
955 ops->hash_update(context, K, ops->block_size); in PHP_FUNCTION()
967 php_hash_string_xor_char(K, K, 0x6A, ops->block_size); in PHP_FUNCTION()
968 php_hash_hmac_round(digest, ops, context, K, digest, ops->digest_size); in PHP_FUNCTION()
976 ZEND_SECURE_ZERO(K, ops->block_size); in PHP_FUNCTION()
979 efree(K); in PHP_FUNCTION()