Lines Matching refs:ahc
889 static void ip_short(uhash_ctx_t ahc, UINT8 *nh_res, u_char *res) in ip_short() argument
894 t = ip_aux(0,ahc->ip_keys, nhp[0]); in ip_short()
895 STORE_UINT32_BIG((UINT32 *)res+0, ip_reduce_p36(t) ^ ahc->ip_trans[0]); in ip_short()
897 t = ip_aux(0,ahc->ip_keys+4, nhp[1]); in ip_short()
898 STORE_UINT32_BIG((UINT32 *)res+1, ip_reduce_p36(t) ^ ahc->ip_trans[1]); in ip_short()
901 t = ip_aux(0,ahc->ip_keys+8, nhp[2]); in ip_short()
902 STORE_UINT32_BIG((UINT32 *)res+2, ip_reduce_p36(t) ^ ahc->ip_trans[2]); in ip_short()
905 t = ip_aux(0,ahc->ip_keys+12, nhp[3]); in ip_short()
906 STORE_UINT32_BIG((UINT32 *)res+3, ip_reduce_p36(t) ^ ahc->ip_trans[3]); in ip_short()
914 static void ip_long(uhash_ctx_t ahc, u_char *res) in ip_long() argument
921 if (ahc->poly_accum[i] >= p64) in ip_long()
922 ahc->poly_accum[i] -= p64; in ip_long()
923 t = ip_aux(0,ahc->ip_keys+(i*4), ahc->poly_accum[i]); in ip_long()
925 ip_reduce_p36(t) ^ ahc->ip_trans[i]); in ip_long()
959 static void uhash_init(uhash_ctx_t ahc, aes_int_key prf_key) in uhash_init() argument
965 memset(ahc, 0, sizeof(uhash_ctx)); in uhash_init()
968 nh_init(&ahc->hash, prf_key); in uhash_init()
977 memcpy(ahc->poly_key_8+i, buf+24*i, 8); in uhash_init()
978 endian_convert_if_le(ahc->poly_key_8+i, 8, 8); in uhash_init()
980 ahc->poly_key_8[i] &= ((UINT64)0x01ffffffu << 32) + 0x01ffffffu; in uhash_init()
981 ahc->poly_accum[i] = 1; /* Our polyhash prepends a non-zero word */ in uhash_init()
987 memcpy(ahc->ip_keys+4*i, buf+(8*i+4)*sizeof(UINT64), in uhash_init()
989 endian_convert_if_le(ahc->ip_keys, sizeof(UINT64), in uhash_init()
990 sizeof(ahc->ip_keys)); in uhash_init()
992 ahc->ip_keys[i] %= p36; /* Bring into Z_p36 */ in uhash_init()
996 kdf(ahc->ip_trans, prf_key, 4, STREAMS * sizeof(UINT32)); in uhash_init()
997 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);