46bit / rustyregisters

Performance experiments with Linear Feedback Shift Registers
MIT License
0 stars 0 forks source link

Test LFSRs for correctness #3

Closed 46bit closed 7 years ago

46bit commented 7 years ago

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 to NaiveLFSR. Doing this for GaloisLFSR would make for faster tests but the minimal and naive NaiveLFSR 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.

46bit commented 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.