find-stretch.sage: Calculate stretch shifts for various block sizes.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 16 Jul 2017 13:55:28 +0000 (14:55 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 16 Jul 2017 14:58:18 +0000 (15:58 +0100)
commite1655173d8fb9e94beef194ef84a54648c71245d
tree832229e9c21f2ccb59fe816c9d71472e4a6b4410
parentc4ee8eb73c0e7957fa1341e83ada3a921ceeb2dd
find-stretch.sage: Calculate stretch shifts for various block sizes.

This is an improved version which searches in the expected order.

For a block size w and shift c, define the domain length D(w, c) to be
the largest D such that

x, i |-> (x || x XOR (x << c))[i..i + w]

is strongly XOR-universal over {0, 1}^w, {0, 1, ... D - 1}.

The algorithm is to choose the shift c which maximizes

  * maximizes floor(log_2(D(w, c))),
  * minimizes c mod 8, and
  * maximizes c

in that priority order.
.gitignore
find-stretch.sage [new file with mode: 0644]