Lines Matching refs:ahc
909 static void ip_short(uhash_ctx_t ahc, UINT8 *nh_res, u_char *res)
914 t = ip_aux(0,ahc->ip_keys, nhp[0]);
915 STORE_UINT32_BIG((UINT32 *)res+0, ip_reduce_p36(t) ^ ahc->ip_trans[0]);
917 t = ip_aux(0,ahc->ip_keys+4, nhp[1]);
918 STORE_UINT32_BIG((UINT32 *)res+1, ip_reduce_p36(t) ^ ahc->ip_trans[1]);
921 t = ip_aux(0,ahc->ip_keys+8, nhp[2]);
922 STORE_UINT32_BIG((UINT32 *)res+2, ip_reduce_p36(t) ^ ahc->ip_trans[2]);
925 t = ip_aux(0,ahc->ip_keys+12, nhp[3]);
926 STORE_UINT32_BIG((UINT32 *)res+3, ip_reduce_p36(t) ^ ahc->ip_trans[3]);
934 static void ip_long(uhash_ctx_t ahc, u_char *res)
941 if (ahc->poly_accum[i] >= p64)
942 ahc->poly_accum[i] -= p64;
943 t = ip_aux(0,ahc->ip_keys+(i*4), ahc->poly_accum[i]);
945 ip_reduce_p36(t) ^ ahc->ip_trans[i]);
979 static void uhash_init(uhash_ctx_t ahc, aes_int_key prf_key)
985 memset(ahc, 0, sizeof(uhash_ctx));
988 nh_init(&ahc->hash, prf_key);
997 memcpy(ahc->poly_key_8+i, buf+24*i, 8);
998 endian_convert_if_le(ahc->poly_key_8+i, 8, 8);
1000 ahc->poly_key_8[i] &= ((UINT64)0x01ffffffu << 32) + 0x01ffffffu;
1001 ahc->poly_accum[i] = 1; /* Our polyhash prepends a non-zero word */
1007 memcpy(ahc->ip_keys+4*i, buf+(8*i+4)*sizeof(UINT64),
1009 endian_convert_if_le(ahc->ip_keys, sizeof(UINT64),
1010 sizeof(ahc->ip_keys));
1012 ahc->ip_keys[i] %= p36; /* Bring into Z_p36 */
1016 kdf(ahc->ip_trans, prf_key, 4, STREAMS * sizeof(UINT32));
1017 endian_convert_if_le(ahc->ip_trans, sizeof(UINT32),
1146 static int uhash(uhash_ctx_t ahc, u_char *msg, long len, u_char *res)
1164 nh(&ahc->hash, (UINT8 *)msg, nh_len, len, nh_result);
1165 ip_short(ahc,nh_result, res);
1171 nh(&ahc->hash, (UINT8 *)msg, L1_KEY_LEN, L1_KEY_LEN, nh_result);
1172 poly_hash(ahc,(UINT32 *)nh_result);
1180 nh(&ahc->hash, (UINT8 *)msg, nh_len, len, nh_result);
1181 poly_hash(ahc,(UINT32 *)nh_result);
1184 ip_long(ahc, res);
1187 uhash_reset(ahc);