wycheproof icon indicating copy to clipboard operation
wycheproof copied to clipboard

Pick a strategy for accumulated or "compressed" vectors

Open FiloSottile opened this issue 9 months ago • 0 comments

Some vectors are too large to put in JSON, but sometimes there are strategies to still define them.

One example is accumulated (or Monte Carlo) vectors, where you perform a bunch of operations on inputs derived from a deterministic source (like SHAKE) and hash the outputs, and check you get the right result at the end. https://words.filippo.io/accumulated/

A similar technique is "compressing" vectors that test particularly large inputs and/or outputs, by instead specifying how to generate the input and/or the hash of the output. (The difference from the previous case being that this is for a single large invocation, instead of a sequence of many invocations.) https://github.com/golang/go/blob/24b395119/src/crypto/sha3/sha3_test.go#L374-L383

Finally, one can massage vectors to have repeating patterns that compress well with regular compression algorithms. https://github.com/C2SP/CCTV/commit/9a140526866400baf22bd4d61441b2284f8424e2

We should decide if we want these tests in Wycheproof, and if so how to represent them and specify them.

FiloSottile avatar Mar 19 '25 10:03 FiloSottile