• Home
  • Raw
  • Download

Lines Matching refs:hc

533 static void nh_transform(nh_ctx *hc, const UINT8 *buf, UINT32 nbytes)  in nh_transform()  argument
542 key = hc->nh_key + hc->bytes_hashed; in nh_transform()
543 nh_aux(key, buf, hc->state, nbytes); in nh_transform()
578 static void nh_reset(nh_ctx *hc) in nh_reset() argument
581 hc->bytes_hashed = 0; in nh_reset()
582 hc->next_data_empty = 0; in nh_reset()
583 hc->state[0] = 0; in nh_reset()
585 hc->state[1] = 0; in nh_reset()
588 hc->state[2] = 0; in nh_reset()
591 hc->state[3] = 0; in nh_reset()
598 static void nh_init(nh_ctx *hc, aes_int_key prf_key) in nh_init() argument
601 kdf(hc->nh_key, prf_key, 1, sizeof(hc->nh_key)); in nh_init()
602 endian_convert_if_le(hc->nh_key, 4, sizeof(hc->nh_key)); in nh_init()
603 nh_reset(hc); in nh_init()
608 static void nh_update(nh_ctx *hc, const UINT8 *buf, UINT32 nbytes) in nh_update() argument
614 j = hc->next_data_empty; in nh_update()
618 memcpy(hc->data+j, buf, i); in nh_update()
619 nh_transform(hc,hc->data,HASH_BUF_BYTES); in nh_update()
622 hc->bytes_hashed += HASH_BUF_BYTES; in nh_update()
626 nh_transform(hc, buf, i); in nh_update()
629 hc->bytes_hashed += i; in nh_update()
633 memcpy(hc->data + j, buf, nbytes); in nh_update()
634 hc->next_data_empty = j + nbytes; in nh_update()
663 static void nh_final(nh_ctx *hc, UINT8 *result) in nh_final() argument
674 if (hc->next_data_empty != 0) { in nh_final()
675 nh_len = ((hc->next_data_empty + (L1_PAD_BOUNDARY - 1)) & in nh_final()
677 zero_pad(hc->data + hc->next_data_empty, in nh_final()
678 nh_len - hc->next_data_empty); in nh_final()
679 nh_transform(hc, hc->data, nh_len); in nh_final()
680 hc->bytes_hashed += hc->next_data_empty; in nh_final()
681 } else if (hc->bytes_hashed == 0) { in nh_final()
683 zero_pad(hc->data, L1_PAD_BOUNDARY); in nh_final()
684 nh_transform(hc, hc->data, nh_len); in nh_final()
687 nbits = (hc->bytes_hashed << 3); in nh_final()
688 ((UINT64 *)result)[0] = ((UINT64 *)hc->state)[0] + nbits; in nh_final()
690 ((UINT64 *)result)[1] = ((UINT64 *)hc->state)[1] + nbits; in nh_final()
693 ((UINT64 *)result)[2] = ((UINT64 *)hc->state)[2] + nbits; in nh_final()
696 ((UINT64 *)result)[3] = ((UINT64 *)hc->state)[3] + nbits; in nh_final()
698 nh_reset(hc); in nh_final()
703 static void nh(nh_ctx *hc, const UINT8 *buf, UINT32 padded_len, in nh() argument
726 nh_aux(hc->nh_key, buf, result, padded_len); in nh()
828 static void poly_hash(uhash_ctx_t hc, UINT32 data_in[]) in poly_hash() argument
835 hc->poly_accum[i] = poly64(hc->poly_accum[i], in poly_hash()
836 hc->poly_key_8[i], p64 - 1); in poly_hash()
837 hc->poly_accum[i] = poly64(hc->poly_accum[i], in poly_hash()
838 hc->poly_key_8[i], (data[i] - 59)); in poly_hash()
840 hc->poly_accum[i] = poly64(hc->poly_accum[i], in poly_hash()
841 hc->poly_key_8[i], data[i]); in poly_hash()