Lines Matching refs:H
167 sip_round(struct siphash *H, const int rounds) { in sip_round() argument
171 H->v0 += H->v1; in sip_round()
172 H->v1 = SIP_ROTL(H->v1, 13); in sip_round()
173 H->v1 ^= H->v0; in sip_round()
174 H->v0 = SIP_ROTL(H->v0, 32); in sip_round()
176 H->v2 += H->v3; in sip_round()
177 H->v3 = SIP_ROTL(H->v3, 16); in sip_round()
178 H->v3 ^= H->v2; in sip_round()
180 H->v0 += H->v3; in sip_round()
181 H->v3 = SIP_ROTL(H->v3, 21); in sip_round()
182 H->v3 ^= H->v0; in sip_round()
184 H->v2 += H->v1; in sip_round()
185 H->v1 = SIP_ROTL(H->v1, 17); in sip_round()
186 H->v1 ^= H->v2; in sip_round()
187 H->v2 = SIP_ROTL(H->v2, 32); in sip_round()
192 sip24_init(struct siphash *H, const struct sipkey *key) { in sip24_init() argument
193 H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0]; in sip24_init()
194 H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1]; in sip24_init()
195 H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0]; in sip24_init()
196 H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1]; in sip24_init()
198 H->p = H->buf; in sip24_init()
199 H->c = 0; in sip24_init()
201 return H; in sip24_init()
207 sip24_update(struct siphash *H, const void *src, size_t len) { in sip24_update() argument
212 while (p < pe && H->p < sip_endof(H->buf)) in sip24_update()
213 *H->p++ = *p++; in sip24_update()
215 if (H->p < sip_endof(H->buf)) in sip24_update()
218 m = SIP_U8TO64_LE(H->buf); in sip24_update()
219 H->v3 ^= m; in sip24_update()
220 sip_round(H, 2); in sip24_update()
221 H->v0 ^= m; in sip24_update()
223 H->p = H->buf; in sip24_update()
224 H->c += 8; in sip24_update()
227 return H; in sip24_update()
231 sip24_final(struct siphash *H) { in sip24_final() argument
232 const char left = (char)(H->p - H->buf); in sip24_final()
233 uint64_t b = (H->c + left) << 56; in sip24_final()
237 b |= (uint64_t)H->buf[6] << 48; in sip24_final()
240 b |= (uint64_t)H->buf[5] << 40; in sip24_final()
243 b |= (uint64_t)H->buf[4] << 32; in sip24_final()
246 b |= (uint64_t)H->buf[3] << 24; in sip24_final()
249 b |= (uint64_t)H->buf[2] << 16; in sip24_final()
252 b |= (uint64_t)H->buf[1] << 8; in sip24_final()
255 b |= (uint64_t)H->buf[0] << 0; in sip24_final()
261 H->v3 ^= b; in sip24_final()
262 sip_round(H, 2); in sip24_final()
263 H->v0 ^= b; in sip24_final()
264 H->v2 ^= 0xff; in sip24_final()
265 sip_round(H, 4); in sip24_final()
267 return H->v0 ^ H->v1 ^ H->v2 ^ H->v3; in sip24_final()