ZenGo-X / multi-party-ecdsa

Rust implementation of {t,n}-threshold ECDSA (elliptic curve digital signature algorithm).
GNU General Public License v3.0
982 stars 313 forks source link

Brainstorming on unit testing for each protocol step #4

Closed gbenattar closed 5 years ago

gbenattar commented 6 years ago

I would like to start a thread about how to properly unit test two party ECDSA. Each function should be tested independently. It is obvious on how to inject edge cases as well as dummy values, the question here is how to unit test that values returned are expected (without any interaction with the other party (E.g. the client).

Thoughts?

omershlo commented 6 years ago

Can you provide a specific example?
Is it a problem to simulate the protocol locally up to a certain point where the function under test is being called ?

gbenattar commented 6 years ago

Yes in some way. Ideally you want to 1 unit test for 1 function, and here I am having hard time finding how this can be done for valid input. Maybe we can hard-code them...

gbenattar commented 6 years ago

@mortendahl can we have you input here?

mortendahl commented 6 years ago

good question. can we test that a protocol is correct at every step? eg, how would we meaningfully test that a commitment made early in a run is as expected? especially since randomness is typically involved and kept private.

thoughts on testing the two parties simultaneously?