MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / siphash_round

Function siphash_round

test/functional/test_framework/siphash.py:13–28  ·  view source on GitHub ↗
(v0, v1, v2, v3)

Source from the content-addressed store, hash-verified

11 return n >> (64 - b) | (n & ((1 << (64 - b)) - 1)) << b
12
13def siphash_round(v0, v1, v2, v3):
14 v0 = (v0 + v1) & ((1 << 64) - 1)
15 v1 = rotl64(v1, 13)
16 v1 ^= v0
17 v0 = rotl64(v0, 32)
18 v2 = (v2 + v3) & ((1 << 64) - 1)
19 v3 = rotl64(v3, 16)
20 v3 ^= v2
21 v0 = (v0 + v3) & ((1 << 64) - 1)
22 v3 = rotl64(v3, 21)
23 v3 ^= v0
24 v2 = (v2 + v1) & ((1 << 64) - 1)
25 v1 = rotl64(v1, 17)
26 v1 ^= v2
27 v2 = rotl64(v2, 32)
28 return (v0, v1, v2, v3)
29
30def siphash256(k0, k1, h):
31 n0 = h & ((1 << 64) - 1)

Callers 1

siphash256Function · 0.85

Calls 1

rotl64Function · 0.85

Tested by

no test coverage detected