Lines Matching +full:1 +full:- +full:v0
1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
2 /* Copyright (C) 2016-2022 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
4 * SipHash: a fast short-input PRF
7 * This implementation is specifically for SipHash2-4 for a secure PRF
8 * and HalfSipHash1-3/SipHash1-3 for an insecure PRF only suitable for
17 #include <asm/word-at-a-time.h>
20 #define SIPROUND SIPHASH_PERMUTATION(v0, v1, v2, v3)
23 u64 v0 = SIPHASH_CONST_0; \
28 v3 ^= key->key[1]; \
29 v2 ^= key->key[0]; \
30 v1 ^= key->key[1]; \
31 v0 ^= key->key[0];
37 v0 ^= b; \
43 return (v0 ^ v1) ^ (v2 ^ v3);
48 const u8 *end = data + len - (len % sizeof(u64)); in __siphash_aligned()
49 const u8 left = len & (sizeof(u64) - 1); in __siphash_aligned()
57 v0 ^= m; in __siphash_aligned()
71 case 1: b |= end[0]; in __siphash_aligned()
81 const u8 *end = data + len - (len % sizeof(u64)); in __siphash_unaligned()
82 const u8 left = len & (sizeof(u64) - 1); in __siphash_unaligned()
90 v0 ^= m; in __siphash_unaligned()
104 case 1: b |= end[0]; in __siphash_unaligned()
112 * siphash_1u64 - compute 64-bit siphash PRF value of a u64
122 v0 ^= first; in siphash_1u64()
128 * siphash_2u64 - compute 64-bit siphash PRF value of 2 u64
139 v0 ^= first; in siphash_2u64()
143 v0 ^= second; in siphash_2u64()
149 * siphash_3u64 - compute 64-bit siphash PRF value of 3 u64
162 v0 ^= first; in siphash_3u64()
166 v0 ^= second; in siphash_3u64()
170 v0 ^= third; in siphash_3u64()
176 * siphash_4u64 - compute 64-bit siphash PRF value of 4 u64
190 v0 ^= first; in siphash_4u64()
194 v0 ^= second; in siphash_4u64()
198 v0 ^= third; in siphash_4u64()
202 v0 ^= forth; in siphash_4u64()
223 v0 ^= combined; in siphash_3u32()
230 /* Note that on 64-bit, we make HalfSipHash1-3 actually be SipHash1-3, for
231 * performance reasons. On 32-bit, below, we actually implement HalfSipHash1-3.
239 v0 ^= b; \
244 return (v0 ^ v1) ^ (v2 ^ v3);
249 const u8 *end = data + len - (len % sizeof(u64)); in __hsiphash_aligned()
250 const u8 left = len & (sizeof(u64) - 1); in __hsiphash_aligned()
257 v0 ^= m; in __hsiphash_aligned()
271 case 1: b |= end[0]; in __hsiphash_aligned()
282 const u8 *end = data + len - (len % sizeof(u64)); in __hsiphash_unaligned()
283 const u8 left = len & (sizeof(u64) - 1); in __hsiphash_unaligned()
290 v0 ^= m; in __hsiphash_unaligned()
304 case 1: b |= end[0]; in __hsiphash_unaligned()
312 * hsiphash_1u32 - compute 64-bit hsiphash PRF value of a u32
325 * hsiphash_2u32 - compute 32-bit hsiphash PRF value of 2 u32
336 v0 ^= combined; in hsiphash_2u32()
342 * hsiphash_3u32 - compute 32-bit hsiphash PRF value of 3 u32
355 v0 ^= combined; in hsiphash_3u32()
362 * hsiphash_4u32 - compute 32-bit hsiphash PRF value of 4 u32
376 v0 ^= combined; in hsiphash_4u32()
380 v0 ^= combined; in hsiphash_4u32()
385 #define HSIPROUND HSIPHASH_PERMUTATION(v0, v1, v2, v3)
388 u32 v0 = HSIPHASH_CONST_0; \
393 v3 ^= key->key[1]; \
394 v2 ^= key->key[0]; \
395 v1 ^= key->key[1]; \
396 v0 ^= key->key[0];
401 v0 ^= b; \
411 const u8 *end = data + len - (len % sizeof(u32)); in __hsiphash_aligned()
412 const u8 left = len & (sizeof(u32) - 1); in __hsiphash_aligned()
419 v0 ^= m; in __hsiphash_aligned()
424 case 1: b |= end[0]; in __hsiphash_aligned()
434 const u8 *end = data + len - (len % sizeof(u32)); in __hsiphash_unaligned()
435 const u8 left = len & (sizeof(u32) - 1); in __hsiphash_unaligned()
442 v0 ^= m; in __hsiphash_unaligned()
447 case 1: b |= end[0]; in __hsiphash_unaligned()
454 * hsiphash_1u32 - compute 32-bit hsiphash PRF value of a u32
463 v0 ^= first; in hsiphash_1u32()
469 * hsiphash_2u32 - compute 32-bit hsiphash PRF value of 2 u32
479 v0 ^= first; in hsiphash_2u32()
482 v0 ^= second; in hsiphash_2u32()
488 * hsiphash_3u32 - compute 32-bit hsiphash PRF value of 3 u32
500 v0 ^= first; in hsiphash_3u32()
503 v0 ^= second; in hsiphash_3u32()
506 v0 ^= third; in hsiphash_3u32()
512 * hsiphash_4u32 - compute 32-bit hsiphash PRF value of 4 u32
525 v0 ^= first; in hsiphash_4u32()
528 v0 ^= second; in hsiphash_4u32()
531 v0 ^= third; in hsiphash_4u32()
534 v0 ^= forth; in hsiphash_4u32()