entropyxyz/synedrion

Generalize the library to use any curve

fjarri opened this issue · 3 comments

fjarri commented

Right now we have k256 encoded, but it doesn't have to be. The scheme is applicable to any group with hard logarithm. At the very least we can generalize it to anything implementing the necessary traits from RustCrypto stack.

The main problem would be to make sure, as statically as possible, that the chosen Uint size exceeds the order of the curve scalar.

@fjarri elliptic_curve::Curve::Uint will always exceed the order because it's used to represent the order (as elliptic_curve::Curve::ORDER)

The problem is that it doesn't just need to exceed it, but be a certain amount of times larger (x2/4/8). Although it may still be possible to declare statically (or use BoxedUint)

You can use Concat::Output to get 2X, and if that type also impl's Concat, you can do <<T as Concat>::Output> as Concat>::Output to get 4X.