Closed 46bit closed 7 years ago
https://github.com/46bit/rustyregisters/commit/c63db7ae69f94cfb3a98af4a49d695d5ca4bc1a1 added tests to NaiveLFSR
and the other LFSR implementations:
Added basic tests upon LFSR output.
* NaiveLFSR is compared against test vectors from my CTAP Assignment.
* CountOnesLFSR and PopCntLFSR are tested against 32KiB of NaiveLFSR output.
- Quicktest would work at hunting for any valid parameters where this fails.
Testing is now at a basic level. Issue will remain open to explore improvements such as checking for diverse widths, taps and seeds.
Tricky to do this without just reimplementing one in tests. I think I'll test
NaiveLFSR
heavily alone, and then test the sequences of other LFSRs by comparing their output toNaiveLFSR
. Doing this forGaloisLFSR
would make for faster tests but the minimal and naiveNaiveLFSR
implementation offers fewer nasty bugs to then imply other things fail.Second pass on this idea: compare output to known-good LFSR outputs from my CTAP Assignment.