64 #ifndef Alembic_Util_SpookyV2_h
65 #define Alembic_Util_SpookyV2_h
94 uint64_t hash1 = seed;
95 Hash128(message, length, &hash1, &seed);
107 uint64_t hash1 = seed, hash2 = seed;
108 Hash128(message, length, &hash1, &hash2);
109 return (uint32_t)hash1;
142 static inline uint64_t
Rot64(uint64_t
x,
int k)
144 return (x << k) | (x >> (64 - k));
161 const uint64_t *
data,
162 uint64_t &s0, uint64_t &s1, uint64_t &s2, uint64_t &s3,
163 uint64_t &s4, uint64_t &s5, uint64_t &s6, uint64_t &s7,
164 uint64_t &s8, uint64_t &s9, uint64_t &s10,uint64_t &s11)
166 s0 += data[0]; s2 ^= s10; s11 ^= s0; s0 = Rot64(s0,11); s11 += s1;
167 s1 += data[1]; s3 ^= s11; s0 ^= s1; s1 = Rot64(s1,32); s0 += s2;
168 s2 += data[2]; s4 ^= s0; s1 ^= s2; s2 = Rot64(s2,43); s1 += s3;
169 s3 += data[3]; s5 ^= s1; s2 ^= s3; s3 = Rot64(s3,31); s2 += s4;
170 s4 += data[4]; s6 ^= s2; s3 ^= s4; s4 = Rot64(s4,17); s3 += s5;
171 s5 += data[5]; s7 ^= s3; s4 ^= s5; s5 = Rot64(s5,28); s4 += s6;
172 s6 += data[6]; s8 ^= s4; s5 ^= s6; s6 = Rot64(s6,39); s5 += s7;
173 s7 += data[7]; s9 ^= s5; s6 ^= s7; s7 = Rot64(s7,57); s6 += s8;
174 s8 += data[8]; s10 ^= s6; s7 ^= s8; s8 = Rot64(s8,55); s7 += s9;
175 s9 += data[9]; s11 ^= s7; s8 ^= s9; s9 = Rot64(s9,54); s8 += s10;
176 s10 += data[10]; s0 ^= s8; s9 ^= s10; s10 = Rot64(s10,22); s9 += s11;
177 s11 += data[11]; s1 ^= s9; s10 ^= s11; s11 = Rot64(s11,46); s10 += s0;
197 uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3,
198 uint64_t &h4, uint64_t &h5, uint64_t &h6, uint64_t &h7,
199 uint64_t &h8, uint64_t &h9, uint64_t &h10,uint64_t &h11)
201 h11+= h1; h2 ^= h11; h1 = Rot64(h1,44);
202 h0 += h2; h3 ^= h0; h2 = Rot64(h2,15);
203 h1 += h3; h4 ^= h1; h3 = Rot64(h3,34);
204 h2 += h4; h5 ^= h2; h4 = Rot64(h4,21);
205 h3 += h5; h6 ^= h3; h5 = Rot64(h5,38);
206 h4 += h6; h7 ^= h4; h6 = Rot64(h6,33);
207 h5 += h7; h8 ^= h5; h7 = Rot64(h7,10);
208 h6 += h8; h9 ^= h6; h8 = Rot64(h8,13);
209 h7 += h9; h10^= h7; h9 = Rot64(h9,38);
210 h8 += h10; h11^= h8; h10= Rot64(h10,53);
211 h9 += h11; h0 ^= h9; h11= Rot64(h11,42);
212 h10+= h0; h1 ^= h10; h0 = Rot64(h0,54);
216 const uint64_t *
data,
217 uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3,
218 uint64_t &h4, uint64_t &h5, uint64_t &h6, uint64_t &h7,
219 uint64_t &h8, uint64_t &h9, uint64_t &h10,uint64_t &h11)
221 h0 += data[0]; h1 += data[1]; h2 += data[2]; h3 += data[3];
222 h4 += data[4]; h5 += data[5]; h6 += data[6]; h7 += data[7];
223 h8 += data[8]; h9 += data[9]; h10 += data[10]; h11 += data[11];
224 EndPartial(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
225 EndPartial(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
226 EndPartial(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
245 uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3)
247 h2 = Rot64(h2,50); h2 += h3; h0 ^= h2;
248 h3 = Rot64(h3,52); h3 += h0; h1 ^= h3;
249 h0 = Rot64(h0,30); h0 += h1; h2 ^= h0;
250 h1 = Rot64(h1,41); h1 += h2; h3 ^= h1;
251 h2 = Rot64(h2,54); h2 += h3; h0 ^= h2;
252 h3 = Rot64(h3,48); h3 += h0; h1 ^= h3;
253 h0 = Rot64(h0,38); h0 += h1; h2 ^= h0;
254 h1 = Rot64(h1,37); h1 += h2; h3 ^= h1;
255 h2 = Rot64(h2,62); h2 += h3; h0 ^= h2;
256 h3 = Rot64(h3,34); h3 += h0; h1 ^= h3;
257 h0 = Rot64(h0,5); h0 += h1; h2 ^= h0;
258 h1 = Rot64(h1,36); h1 += h2; h3 ^= h1;
274 uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3)
276 h3 ^= h2; h2 = Rot64(h2,15); h3 += h2;
277 h0 ^= h3; h3 = Rot64(h3,52); h0 += h3;
278 h1 ^= h0; h0 = Rot64(h0,26); h1 += h0;
279 h2 ^= h1; h1 = Rot64(h1,51); h2 += h1;
280 h3 ^= h2; h2 = Rot64(h2,28); h3 += h2;
281 h0 ^= h3; h3 = Rot64(h3,9); h0 += h3;
282 h1 ^= h0; h0 = Rot64(h0,47); h1 += h0;
283 h2 ^= h1; h1 = Rot64(h1,54); h2 += h1;
284 h3 ^= h2; h2 = Rot64(h2,32); h3 += h2;
285 h0 ^= h3; h3 = Rot64(h3,25); h0 += h3;
286 h1 ^= h0; h0 = Rot64(h0,63); h1 += h0;
304 static const size_t sc_numVars = 12;
307 static const size_t sc_blockSize = sc_numVars*8;
310 static const size_t sc_bufSize = 2*sc_blockSize;
319 static const uint64_t sc_const = 0xdeadbeefdeadbeefLL;
321 uint64_t m_data[2*sc_numVars];
322 uint64_t m_state[sc_numVars];
static void EndPartial(uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3, uint64_t &h4, uint64_t &h5, uint64_t &h6, uint64_t &h7, uint64_t &h8, uint64_t &h9, uint64_t &h10, uint64_t &h11)
GLuint GLsizei const GLchar * message
static uint32_t Hash32(const void *message, size_t length, uint32_t seed)
GLuint GLsizei GLsizei * length
static uint64_t Rot64(uint64_t x, int k)
static void ShortMix(uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3)
static uint64_t Hash64(const void *message, size_t length, uint64_t seed)
static void Mix(const uint64_t *data, uint64_t &s0, uint64_t &s1, uint64_t &s2, uint64_t &s3, uint64_t &s4, uint64_t &s5, uint64_t &s6, uint64_t &s7, uint64_t &s8, uint64_t &s9, uint64_t &s10, uint64_t &s11)
static void ShortEnd(uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3)
static void End(const uint64_t *data, uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3, uint64_t &h4, uint64_t &h5, uint64_t &h6, uint64_t &h7, uint64_t &h8, uint64_t &h9, uint64_t &h10, uint64_t &h11)
STATIC_INLINE uint128_t Hash128(const char *s, size_t len)
#define ALEMBIC_VERSION_NS