Commit 9d1f1a1a authored by Johan Pascal's avatar Johan Pascal
Browse files

Modify tests to avoid runtime errors due to null parameters

No related merge requests found
Showing with 3 additions and 2 deletions
......@@ -148,6 +148,7 @@ static void test_arithmetic() {
for (int i=0; i<NTESTS*10 && test.passing_now; i++) {
size_t sob = i % (2*Group::Scalar::SER_BYTES);
if (sob == 0) continue;
SecureBuffer xx = rng.read(sob), yy = rng.read(sob), zz = rng.read(sob);
......@@ -588,14 +589,14 @@ static void test_eddsa() {
typename Group::Scalar more_than_size = 1;
for (int i=0; i<lg_scalar; i++) more_than_size *= 2;
for (int i=0; i<NTESTS && test.passing_now; i++) {
for (int i=1; i<NTESTS && test.passing_now; i++) {
typename EdDSA<Group>::PrivateKey priv(rng);
typename EdDSA<Group>::PublicKey pub(priv);
SecureBuffer message(i);
rng.read(message);
SecureBuffer context(i%256);
SecureBuffer context(i%255 + 1);
rng.read(context);
SecureBuffer sig = priv.sign(message,context);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment