Skip to content
This repository has been archived by the owner on Jul 25, 2019. It is now read-only.

generator test uses random source #15

Open
simbo1905 opened this issue Jun 15, 2019 · 1 comment
Open

generator test uses random source #15

simbo1905 opened this issue Jun 15, 2019 · 1 comment

Comments

@simbo1905
Copy link

The following test:

 @Test
  void generate() {
    final SecureRandom random = new SecureRandom(); // <- random 
    final byte[] p = GF256.generate(random, 5, (byte) 20);
   // removed for brevity
   assertThat(p[p.length - 1]).isNotZero();
  }

Will find it hard to catch a bug where generate doesn't loop on the random source until p[p.length - 1] != (byte) 0. If a regression is introduced it is unlikely to be caught before the code is released.

simbo1905 added a commit to simbo1905/shamir that referenced this issue Jun 15, 2019
@simbo1905
Copy link
Author

I have submitted PR 16 for this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant