boltlabs-inc / tss-ecdsa

An implementation of a threshold ECDSA signature scheme
Other
12 stars 5 forks source link

114 PiMod Tests #460

Closed hridambasu closed 1 year ago

hridambasu commented 1 year ago

Closes #114

hridambasu commented 1 year ago

These tests look pretty good, but I don't think we've fully tested the constraint we're trying to test

N is a Paillier-Blum modulus, i.e. gcd(N, φ(N )) = 1 and N = pq where p, q are primes satisfying p, q ≡ 3 mod 4

I think we should add another couple of tests that manually construct bad inputs where N = p*q but p and q are invalid; for example maybe one of them is 1 or they're not congruent to 3 mod 4 more generally, or they're not prime.

@marsella When I add these cases, the tests fail much earlier: stdout ---- Error: InternalInvariantFailed. So I guess those checks are already incorporated much earlier in the code.

marsella commented 1 year ago

What do you mean by "they fail much earlier"? Like, in proving instead of verifying? I think that's fine, as long as it fails at some point -- if you can't construct a proof that validates the thing, that's worth knowing.