Skip to content

Commit

Permalink
add mathematical spec for C32
Browse files Browse the repository at this point in the history
  • Loading branch information
tromp committed Nov 17, 2020
1 parent fd21fd2 commit ebe5cb5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions doc/mathspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Let siphash24 be the standard siphash-2-4 function [0]
with a 256 bit key K=<k0,k1,k2,k3> instead of the 128-bit one,
and a modified Initialization phase that sets v_i to k_i for 0 <= i < 4.

Set N = 2^32
Define a bipartite graph [1] G_K=(V,E) with N edges on N + N nodes as follows:
For 0 <= i < N, E_i = (V_i_0, V_i_1) = (siphash24(K,2*i) % N, siphash24(K,2*i+1) % N)

Define the associated bipartite node-pairs graph G'_K=(V',E') with N edges on N/2 + N/2 node-pairs as follows:
For 0 <= i < N, E'_i = (V_i_0>>1, V_i_1>>1)

A Cuckatoo32 solution for key K is a 42-cycle [2] in G'_K that is a matching [3] in G_K.

For verification purposes, the solution is given as the sequence of 42 edge indices in increasing order.

[0] https://cr.yp.to/siphash/siphash-20120918.pdf
[1] https://en.wikipedia.org/wiki/Bipartite_graph
[2] https://en.wikipedia.org/wiki/Cycle_(graph_theory)
[3] https://en.wikipedia.org/wiki/Matching_(graph_theory)

0 comments on commit ebe5cb5

Please sign in to comment.