• Home
  • Raw
  • Download

Lines Matching refs:H

172 static void 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 static struct siphash *sip24_init(struct siphash *H, in sip24_init() argument
199 H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0]; in sip24_init()
200 H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1]; in sip24_init()
201 H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0]; in sip24_init()
202 H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1]; in sip24_init()
204 H->p = H->buf; in sip24_init()
205 H->c = 0; in sip24_init()
207 return H; in sip24_init()
213 static struct siphash *sip24_update(struct siphash *H, const void *src, in sip24_update() argument
219 while (p < pe && H->p < sip_endof(H->buf)) in sip24_update()
220 *H->p++ = *p++; in sip24_update()
222 if (H->p < sip_endof(H->buf)) in sip24_update()
225 m = SIP_U8TO64_LE(H->buf); in sip24_update()
226 H->v3 ^= m; in sip24_update()
227 sip_round(H, 2); in sip24_update()
228 H->v0 ^= m; in sip24_update()
230 H->p = H->buf; in sip24_update()
231 H->c += 8; in sip24_update()
234 return H; in sip24_update()
238 static uint64_t sip24_final(struct siphash *H) { in sip24_final() argument
239 const char left = (char)(H->p - H->buf); in sip24_final()
240 uint64_t b = (H->c + left) << 56; in sip24_final()
243 case 7: b |= (uint64_t)H->buf[6] << 48; in sip24_final()
245 case 6: b |= (uint64_t)H->buf[5] << 40; in sip24_final()
247 case 5: b |= (uint64_t)H->buf[4] << 32; in sip24_final()
249 case 4: b |= (uint64_t)H->buf[3] << 24; in sip24_final()
251 case 3: b |= (uint64_t)H->buf[2] << 16; in sip24_final()
253 case 2: b |= (uint64_t)H->buf[1] << 8; in sip24_final()
255 case 1: b |= (uint64_t)H->buf[0] << 0; in sip24_final()
260 H->v3 ^= b; in sip24_final()
261 sip_round(H, 2); in sip24_final()
262 H->v0 ^= b; in sip24_final()
263 H->v2 ^= 0xff; in sip24_final()
264 sip_round(H, 4); in sip24_final()
266 return H->v0 ^ H->v1 ^ H->v2 ^ H->v3; in sip24_final()