Lines Matching refs:key
37 static void rekey(uint8_t *key, const uint8_t *new_key, unsigned int key_size) in rekey() argument
44 key[i] = inner_pad ^ new_key[i]; in rekey()
45 key[i + TC_SHA256_BLOCK_SIZE] = outer_pad ^ new_key[i]; in rekey()
48 key[i] = inner_pad; key[i + TC_SHA256_BLOCK_SIZE] = outer_pad; in rekey()
52 int tc_hmac_set_key(TCHmacState_t ctx, const uint8_t *key, in tc_hmac_set_key() argument
58 key == (const uint8_t *) 0 || in tc_hmac_set_key()
78 (void)tc_sha256_final(&dummy_state.key[TC_SHA256_DIGEST_SIZE], in tc_hmac_set_key()
82 rekey(ctx->key, key, key_size); in tc_hmac_set_key()
85 (void)tc_sha256_update(&ctx->hash_state, key, key_size); in tc_hmac_set_key()
86 (void)tc_sha256_final(&ctx->key[TC_SHA256_DIGEST_SIZE], in tc_hmac_set_key()
88 rekey(ctx->key, in tc_hmac_set_key()
89 &ctx->key[TC_SHA256_DIGEST_SIZE], in tc_hmac_set_key()
105 (void) tc_sha256_update(&ctx->hash_state, ctx->key, TC_SHA256_BLOCK_SIZE); in tc_hmac_init()
139 &ctx->key[TC_SHA256_BLOCK_SIZE], in tc_hmac_final()