• Home
  • Raw
  • Download

Lines Matching refs:H

172 sip_round(struct siphash *H, const int rounds) {  in sip_round()  argument
176 H->v0 += H->v1; in sip_round()
177 H->v1 = SIP_ROTL(H->v1, 13); in sip_round()
178 H->v1 ^= H->v0; in sip_round()
179 H->v0 = SIP_ROTL(H->v0, 32); in sip_round()
181 H->v2 += H->v3; in sip_round()
182 H->v3 = SIP_ROTL(H->v3, 16); in sip_round()
183 H->v3 ^= H->v2; in sip_round()
185 H->v0 += H->v3; in sip_round()
186 H->v3 = SIP_ROTL(H->v3, 21); in sip_round()
187 H->v3 ^= H->v0; in sip_round()
189 H->v2 += H->v1; in sip_round()
190 H->v1 = SIP_ROTL(H->v1, 17); in sip_round()
191 H->v1 ^= H->v2; in sip_round()
192 H->v2 = SIP_ROTL(H->v2, 32); in sip_round()
197 sip24_init(struct siphash *H, const struct sipkey *key) { in sip24_init() argument
198 H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0]; in sip24_init()
199 H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1]; in sip24_init()
200 H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0]; in sip24_init()
201 H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1]; in sip24_init()
203 H->p = H->buf; in sip24_init()
204 H->c = 0; in sip24_init()
206 return H; in sip24_init()
212 sip24_update(struct siphash *H, const void *src, size_t len) { in sip24_update() argument
217 while (p < pe && H->p < sip_endof(H->buf)) in sip24_update()
218 *H->p++ = *p++; in sip24_update()
220 if (H->p < sip_endof(H->buf)) in sip24_update()
223 m = SIP_U8TO64_LE(H->buf); in sip24_update()
224 H->v3 ^= m; in sip24_update()
225 sip_round(H, 2); in sip24_update()
226 H->v0 ^= m; in sip24_update()
228 H->p = H->buf; in sip24_update()
229 H->c += 8; in sip24_update()
232 return H; in sip24_update()
236 sip24_final(struct siphash *H) { in sip24_final() argument
237 const char left = (char)(H->p - H->buf); in sip24_final()
238 uint64_t b = (H->c + left) << 56; in sip24_final()
242 b |= (uint64_t)H->buf[6] << 48; in sip24_final()
245 b |= (uint64_t)H->buf[5] << 40; in sip24_final()
248 b |= (uint64_t)H->buf[4] << 32; in sip24_final()
251 b |= (uint64_t)H->buf[3] << 24; in sip24_final()
254 b |= (uint64_t)H->buf[2] << 16; in sip24_final()
257 b |= (uint64_t)H->buf[1] << 8; in sip24_final()
260 b |= (uint64_t)H->buf[0] << 0; in sip24_final()
266 H->v3 ^= b; in sip24_final()
267 sip_round(H, 2); in sip24_final()
268 H->v0 ^= b; in sip24_final()
269 H->v2 ^= 0xff; in sip24_final()
270 sip_round(H, 4); in sip24_final()
272 return H->v0 ^ H->v1 ^ H->v2 ^ H->v3; in sip24_final()