Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize the library to use any curve #27

Open
fjarri opened this issue Apr 13, 2023 · 3 comments
Open

Generalize the library to use any curve #27

fjarri opened this issue Apr 13, 2023 · 3 comments
Labels
API Involves backwards-incompatible changes of the public API enhancement New feature or request
Milestone

Comments

@fjarri
Copy link
Member

fjarri commented Apr 13, 2023

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 fjarri added the enhancement New feature or request label Apr 13, 2023
@fjarri fjarri added the API Involves backwards-incompatible changes of the public API label May 20, 2023
@fjarri fjarri added this to the v1.0.0 milestone Nov 26, 2023
@tarcieri
Copy link

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

@fjarri
Copy link
Member Author

fjarri commented Dec 19, 2023

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)

@tarcieri
Copy link

tarcieri commented Dec 19, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Involves backwards-incompatible changes of the public API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants