boltlabs-inc / tss-ecdsa

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

Add presign tests and testing infrastructure #424

Closed marsella closed 1 year ago

marsella commented 1 year ago

Right now if we want to test signing we need to run all of presiging first to get a PresignRecord (or, more interestingly, a set of consistent PresignRecords). It would be nice to have a test-only function to quickly simulate the presign protocol without actually running it. There are similar methods for keygen and auxinfo outputs.

To do this, we need to figure out what properties the presign record must satisfy. A record is a tuple (R, k_i, chi_i) such that:

A set of valid presign records should have the following properties, but I'm not completely confident that these are necessary or sufficient. We'll need to generate a key pair to start with (doesn't have to be distributed); denote the public key X and private key x.

marsella commented 1 year ago

Observation while working on this issue: Testing the last condition is kind of awkward because our secret keys are BigNumbers but they're being compared to k256::Scalars. I wonder if we should be using that k256::Scalar type more throughout the library, specifically for every time we generate something in 𝔽_q.