cyphar / paperback

Paper backup generator suitable for long-term storage.
GNU General Public License v3.0
1.1k stars 40 forks source link

quickcheck limited_recover_fail failure? #93

Open cyphar opened 1 month ago

cyphar commented 1 month ago

Just saw this failure.

thread 'shamir::dealer::test::limited_recover_fail' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/quickcheck-1.0.3/src/tester.rs:165:28:
[quickcheck] TEST FAILED. Arguments: (8, [255], [GfElem(1797454381), GfElem(2770396913), GfElem(998084813), GfElem(463965418), GfElem(373228609), GfElem(1448295553), GfElem(424671901), GfElem(1), GfElem(1857253999), GfElem(2454037938)])
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
cyphar commented 1 month ago

Ah, so the issue is that if the secret is one byte then there is a 1-in-256 chance that we will accidentally get the same secret. I guess we could restrict the test to be >=2 bytes, but being able to test single-byte secrets is also worthwhile...

cyphar commented 1 month ago

Ah, this was issue 2 in #21.