Lines Matching refs:ahc
890 static void ip_short(uhash_ctx_t ahc, UINT8 *nh_res, u_char *res) in ip_short() argument
895 t = ip_aux(0,ahc->ip_keys, nhp[0]); in ip_short()
896 STORE_UINT32_BIG((UINT32 *)res+0, ip_reduce_p36(t) ^ ahc->ip_trans[0]); in ip_short()
898 t = ip_aux(0,ahc->ip_keys+4, nhp[1]); in ip_short()
899 STORE_UINT32_BIG((UINT32 *)res+1, ip_reduce_p36(t) ^ ahc->ip_trans[1]); in ip_short()
902 t = ip_aux(0,ahc->ip_keys+8, nhp[2]); in ip_short()
903 STORE_UINT32_BIG((UINT32 *)res+2, ip_reduce_p36(t) ^ ahc->ip_trans[2]); in ip_short()
906 t = ip_aux(0,ahc->ip_keys+12, nhp[3]); in ip_short()
907 STORE_UINT32_BIG((UINT32 *)res+3, ip_reduce_p36(t) ^ ahc->ip_trans[3]); in ip_short()
915 static void ip_long(uhash_ctx_t ahc, u_char *res) in ip_long() argument
922 if (ahc->poly_accum[i] >= p64) in ip_long()
923 ahc->poly_accum[i] -= p64; in ip_long()
924 t = ip_aux(0,ahc->ip_keys+(i*4), ahc->poly_accum[i]); in ip_long()
926 ip_reduce_p36(t) ^ ahc->ip_trans[i]); in ip_long()
960 static void uhash_init(uhash_ctx_t ahc, aes_int_key prf_key) in uhash_init() argument
966 memset(ahc, 0, sizeof(uhash_ctx)); in uhash_init()
969 nh_init(&ahc->hash, prf_key); in uhash_init()
978 memcpy(ahc->poly_key_8+i, buf+24*i, 8); in uhash_init()
979 endian_convert_if_le(ahc->poly_key_8+i, 8, 8); in uhash_init()
981 ahc->poly_key_8[i] &= ((UINT64)0x01ffffffu << 32) + 0x01ffffffu; in uhash_init()
982 ahc->poly_accum[i] = 1; /* Our polyhash prepends a non-zero word */ in uhash_init()
988 memcpy(ahc->ip_keys+4*i, buf+(8*i+4)*sizeof(UINT64), in uhash_init()
990 endian_convert_if_le(ahc->ip_keys, sizeof(UINT64), in uhash_init()
991 sizeof(ahc->ip_keys)); in uhash_init()
993 ahc->ip_keys[i] %= p36; /* Bring into Z_p36 */ in uhash_init()
997 kdf(ahc->ip_trans, prf_key, 4, STREAMS * sizeof(UINT32)); in uhash_init()
998 endian_convert_if_le(ahc->ip_trans, sizeof(UINT32), in uhash_init()
1126 static int uhash(uhash_ctx_t ahc, u_char *msg, long len, u_char *res)
1144 nh(&ahc->hash, (UINT8 *)msg, nh_len, len, nh_result);
1145 ip_short(ahc,nh_result, res);
1151 nh(&ahc->hash, (UINT8 *)msg, L1_KEY_LEN, L1_KEY_LEN, nh_result);
1152 poly_hash(ahc,(UINT32 *)nh_result);
1160 nh(&ahc->hash, (UINT8 *)msg, nh_len, len, nh_result);
1161 poly_hash(ahc,(UINT32 *)nh_result);
1164 ip_long(ahc, res);
1167 uhash_reset(ahc);