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

bounty: Algorithm to find generator points #11

Open
5 tasks
0xJepsen opened this issue May 2, 2024 · 2 comments
Open
5 tasks

bounty: Algorithm to find generator points #11

0xJepsen opened this issue May 2, 2024 · 2 comments
Labels
bounty 🏴‍☠️ Closing this rewards a bounty! feature ✨ New feature or request good first issue 👋 Good for newcomers

Comments

@0xJepsen
Copy link
Contributor

0xJepsen commented May 2, 2024

Bounty Description

Implement a compile-time (const fn) algorithm to find generator points on elliptic curves so that we may have arbitrary generators used as compile-time constants in traits. Generator points are used to generate the cyclic subgroup used in various cryptographic protocols.

Implementation requirements

A clear and comprehensive list of the requirements for the bounty to be considered complete.

  • Implement a const function to find generator points on a given elliptic curve
    • Should accept curve parameters as input and utilize ronkathon's existing random point generation function / sqrt algorithm
  • Update traits that utilize generators to use this compile-time function
  • Implement proper error handling and input validation
  • Documentation and tests
    • Implement tests to verify the algorithm yields generators for small groups
    • Test for groups over extension fields as well as prime fields
    • Should verify that the point generates the entire group or a subgroup of desired order
    • Create comprehensive unit tests, e.g. with well-known curves (secp256k1, Curve25519)
    • Test edge cases and invalid inputs
    • Provide clear documentation and code commenting on the algorithm's operation and usage

Bonus Features

Any additional features that will enhance the value of the bounty.

  • Optimize the algorithm for efficiency:
    • Implement early termination conditions
    • Use efficient methods for scalar multiplication
    • Optimizations that may obfuscate understanding must be given as an optional feature

Resources

Elliptic Curve Cryptography: A Gentle Introduction
Standards for Efficient Cryptography (SEC) 2: Recommended Elliptic Curve Domain Parameters
Elliptic Curves for Security (RFC 7748)
Handbook of Elliptic and Hyperelliptic Curve Cryptography, Chapter 9: Generating Elliptic Curves

Criteria

Bounties will be rewarded based on the following criteria:

  1. Correctness and security: A thorough review of the implementation should convince our team that they are correct and secure, with all requirements met.
  2. Code clarity and quality: Succinct, easy-to-follow code with appropriate naming conventions. Utilize Rust’s type system for flexibility and security (e.g., compile-time checks where possible), and avoid external crates. Optimizations should be a lower priority than clarity, but can be included behind a feature flag as a bonus.
  3. Documentation quality: Provide comprehensive README’s, Cargo docs, and inline comments where code itself is not self-explanatory. Prioritize clarity and readability.
@Autoparallel
Copy link
Contributor

I think this could now be implemented since we can draw random points on the curve / have access to sqrt algorithm.

@pluto pluto deleted a comment from brunny-eth Sep 9, 2024
@pluto pluto deleted a comment from Autoparallel Sep 11, 2024
@brunny-eth brunny-eth changed the title feat: Algorithm to find generator points Bounty: Algorithm to find generator points Sep 11, 2024
@brunny-eth brunny-eth pinned this issue Sep 11, 2024
@brunny-eth brunny-eth changed the title Bounty: Algorithm to find generator points bounty: Algorithm to find generator points Sep 11, 2024
@Autoparallel Autoparallel added the feature ✨ New feature or request label Dec 19, 2024
@Autoparallel
Copy link
Contributor

Just to be clear, if a test of the const fn is made, the prime should be small, otherwise compilation time will explode.

@Autoparallel Autoparallel added good first issue 👋 Good for newcomers bounty 🏴‍☠️ Closing this rewards a bounty! labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty 🏴‍☠️ Closing this rewards a bounty! feature ✨ New feature or request good first issue 👋 Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants