Skip to content

Property Tests#2

Draft
curiecrypt wants to merge 1 commit intomainfrom
curiecrypt/proptest
Draft

Property Tests#2
curiecrypt wants to merge 1 commit intomainfrom
curiecrypt/proptest

Conversation

@curiecrypt
Copy link

This PR includes the proptests. Tests cover the following cases:

  • fft_mul
    • Single coefficient polynomials
    • Polynomials with different lengths
    • Empty polynomials
    • Zero and Non-zero polynomials with varying sizes
    • Polynomial multiplication with random inputs and large sizes
  • get_coeff_from_roots
    • TBA
  • get_poly_commitment_g1
    • TBA

Closes #1

}

// Test: Empty polynomials
proptest! {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record

@perturbing We might want to cover the case for empty polynomials in fft_mul, since we get the following fail:

thread 'tests::test_fft_mul_empty_polys' panicked at src/lib.rs:201:5:
Test failed: assertion failed: `(left == right)` 
  left: `[]`, 
 right: `[Scalar(0x0000000000000000000000000000000000000000000000000000000000000000)]`: Failed on case left = empty, right = non-empty with right.len() = 1 at src/lib.rs:209.
minimal failing input: non_empty_vec = [
    Scalar(0x0000000000000000000000000000000000000000000000000000000000000000),
]
	successes: 0
	local rejects: 0
	global rejects: 0

Yeah, sounds good.

It's also a balance between safety and speed. In the code as it is now, I highly favored speed and less complexity.

But we can also make the interface safer, in that we introduce a type for a polynomial and create an interface where polynomials are always normalized and no trailing zero's etc. Then the zero is uniquely the empty list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Property Tests

1 participant