Lines Matching refs:K
479 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
480 memset(K, 0, ops->block_size); in php_hash_hmac_prep_key()
485 ops->hash_final(K, context); in php_hash_hmac_prep_key()
487 memcpy(K, key, key_len); in php_hash_hmac_prep_key()
490 php_hash_string_xor_char(K, K, 0x36, ops->block_size); in php_hash_hmac_prep_key()
504 unsigned char *K; in php_hash_do_hash_hmac() local
529 K = emalloc(ops->block_size); in php_hash_do_hash_hmac()
532 php_hash_hmac_prep_key(K, ops, context, (unsigned char *) key, key_len); in php_hash_do_hash_hmac()
538 ops->hash_update(context, K, ops->block_size); in php_hash_do_hash_hmac()
545 efree(K); in php_hash_do_hash_hmac()
552 …php_hash_hmac_round((unsigned char *) ZSTR_VAL(digest), ops, context, K, (unsigned char *) data, d… in php_hash_do_hash_hmac()
555 php_hash_string_xor_char(K, K, 0x6A, ops->block_size); in php_hash_do_hash_hmac()
557 …php_hash_hmac_round((unsigned char *) ZSTR_VAL(digest), ops, context, K, (unsigned char *) ZSTR_VA… in php_hash_do_hash_hmac()
560 ZEND_SECURE_ZERO(K, ops->block_size); in php_hash_do_hash_hmac()
561 efree(K); in php_hash_do_hash_hmac()
656 char *K = emalloc(ops->block_size); in PHP_FUNCTION() local
659 memset(K, 0, ops->block_size); in PHP_FUNCTION()
664 ops->hash_final((unsigned char *) K, context); in PHP_FUNCTION()
668 memcpy(K, ZSTR_VAL(key), ZSTR_LEN(key)); in PHP_FUNCTION()
674 K[i] ^= 0x36; in PHP_FUNCTION()
676 ops->hash_update(context, (unsigned char *) K, ops->block_size); in PHP_FUNCTION()
677 hash->key = (unsigned char *) K; in PHP_FUNCTION()
901 unsigned char *prk, *digest, *K; in PHP_FUNCTION() local
936 K = emalloc(ops->block_size); in PHP_FUNCTION()
937 php_hash_hmac_prep_key(K, ops, context, in PHP_FUNCTION()
941 php_hash_hmac_round(prk, ops, context, K, (unsigned char *) ZSTR_VAL(ikm), ZSTR_LEN(ikm)); in PHP_FUNCTION()
942 php_hash_string_xor_char(K, K, 0x6A, ops->block_size); in PHP_FUNCTION()
943 php_hash_hmac_round(prk, ops, context, K, prk, ops->digest_size); in PHP_FUNCTION()
944 ZEND_SECURE_ZERO(K, ops->block_size); in PHP_FUNCTION()
954 php_hash_hmac_prep_key(K, ops, context, prk, ops->digest_size); in PHP_FUNCTION()
956 ops->hash_update(context, K, ops->block_size); in PHP_FUNCTION()
968 php_hash_string_xor_char(K, K, 0x6A, ops->block_size); in PHP_FUNCTION()
969 php_hash_hmac_round(digest, ops, context, K, digest, ops->digest_size); in PHP_FUNCTION()
977 ZEND_SECURE_ZERO(K, ops->block_size); in PHP_FUNCTION()
980 efree(K); in PHP_FUNCTION()