cpace
cpace copied to clipboard
Add test vectors to compare with the Go implementation.
There should be test vectors that compare with @filosottile's implementation: https://github.com/FiloSottile/go-cpace-ristretto255
Since there's an RNG involved, making test vectors will require controlling the RNG. This implementation takes a generic RNG, but the Go implementation doesn't, using rand.Rng
internally.
A quick glance at cpace_test.go
suggests that there's some kind of trickery involving defer to override the RNG for test purposes. Maybe something like that could be used for test vectors.
Yep, TestTranscript contains a vector that should be possible for you to match.
https://github.com/FiloSottile/go-cpace-ristretto255/blob/6ff507385bae4bb06cb79b46494e394aa39aa47c/cpace_test.go#L47-L83
You can also make interop tests by using a recording of the Go side as a peer.