• Home
  • Raw
  • Download

Lines Matching refs:ahc

884 static void ip_short(uhash_ctx_t ahc, UINT8 *nh_res, u_char *res)  in ip_short()  argument
889 t = ip_aux(0,ahc->ip_keys, nhp[0]); in ip_short()
890 STORE_UINT32_BIG((UINT32 *)res+0, ip_reduce_p36(t) ^ ahc->ip_trans[0]); in ip_short()
892 t = ip_aux(0,ahc->ip_keys+4, nhp[1]); in ip_short()
893 STORE_UINT32_BIG((UINT32 *)res+1, ip_reduce_p36(t) ^ ahc->ip_trans[1]); in ip_short()
896 t = ip_aux(0,ahc->ip_keys+8, nhp[2]); in ip_short()
897 STORE_UINT32_BIG((UINT32 *)res+2, ip_reduce_p36(t) ^ ahc->ip_trans[2]); in ip_short()
900 t = ip_aux(0,ahc->ip_keys+12, nhp[3]); in ip_short()
901 STORE_UINT32_BIG((UINT32 *)res+3, ip_reduce_p36(t) ^ ahc->ip_trans[3]); in ip_short()
909 static void ip_long(uhash_ctx_t ahc, u_char *res) in ip_long() argument
916 if (ahc->poly_accum[i] >= p64) in ip_long()
917 ahc->poly_accum[i] -= p64; in ip_long()
918 t = ip_aux(0,ahc->ip_keys+(i*4), ahc->poly_accum[i]); in ip_long()
920 ip_reduce_p36(t) ^ ahc->ip_trans[i]); in ip_long()
954 static void uhash_init(uhash_ctx_t ahc, aes_int_key prf_key) in uhash_init() argument
960 memset(ahc, 0, sizeof(uhash_ctx)); in uhash_init()
963 nh_init(&ahc->hash, prf_key); in uhash_init()
972 memcpy(ahc->poly_key_8+i, buf+24*i, 8); in uhash_init()
973 endian_convert_if_le(ahc->poly_key_8+i, 8, 8); in uhash_init()
975 ahc->poly_key_8[i] &= ((UINT64)0x01ffffffu << 32) + 0x01ffffffu; in uhash_init()
976 ahc->poly_accum[i] = 1; /* Our polyhash prepends a non-zero word */ in uhash_init()
982 memcpy(ahc->ip_keys+4*i, buf+(8*i+4)*sizeof(UINT64), in uhash_init()
984 endian_convert_if_le(ahc->ip_keys, sizeof(UINT64), in uhash_init()
985 sizeof(ahc->ip_keys)); in uhash_init()
987 ahc->ip_keys[i] %= p36; /* Bring into Z_p36 */ in uhash_init()
991 kdf(ahc->ip_trans, prf_key, 4, STREAMS * sizeof(UINT32)); in uhash_init()
992 endian_convert_if_le(ahc->ip_trans, sizeof(UINT32), in uhash_init()
1120 static int uhash(uhash_ctx_t ahc, u_char *msg, long len, u_char *res)
1138 nh(&ahc->hash, (UINT8 *)msg, nh_len, len, nh_result);
1139 ip_short(ahc,nh_result, res);
1145 nh(&ahc->hash, (UINT8 *)msg, L1_KEY_LEN, L1_KEY_LEN, nh_result);
1146 poly_hash(ahc,(UINT32 *)nh_result);
1154 nh(&ahc->hash, (UINT8 *)msg, nh_len, len, nh_result);
1155 poly_hash(ahc,(UINT32 *)nh_result);
1158 ip_long(ahc, res);
1161 uhash_reset(ahc);