-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: ecdsa on BabyJubJub #17
Conversation
git commit -m "feat: skeleton code for ECDSA" --no-verify
add: calculate_signature ECDSA
refactor: reduce_field
refactor: mod_inv
…ypecasting bug: mod_inv, calculating_signature complete, focus on typecasting
feat: ECDSA => Integration Tests
git commit -m "feat: ECDSA implementation" --no-verify
yarn fmt -- 4 files
I am still working on the integration test, but the code for ECDSA is complete. Compiles without any errors. Please can you comment on the logic, etc? |
@@ -0,0 +1,12 @@ | |||
mod lib; | |||
|
|||
fn main(private_key: [u8; 32], message: [u8; 32], random_nonce: [u8; 32]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a test and a proper README with instructions on how to use, import, test, and with a benchmark? Seems like this library would benefit from using noir-edwards too.
A lot of this code is AI-generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On it.
Yes, AI Generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimised version of BabyJubJub already implements noir-edwards I believe.
Closing this PR as we have significant evidence of you asking community members to do the remaining work on your behalf. |
Hi, Implementing ECDSA was not a part of the work for the grant that I received. So I have not asked people to complete work that is "on my behalf", but I wanted to collaborate further with the community and add value. Moreover, I merely asked you to comment on the logic. Hence, I believe closing this PR signals poor judgement. |
Implement ECDSA Signature Generation and Verification in Noir
Overview
This PR introduces a comprehensive ECDSA (Elliptic Curve Digital Signature Algorithm) implementation in Noir, utilizing the Baby JubJub curve. The implementation includes functions for signature generation, verification, and related utility operations.
Key Features
Function Definitions
calculate_signature
Generates an ESDSA signature for a given message using a private key and random nonce.
verify_signature
Verifies an ECDSA signature against a given message hash and public key.
mod_inv
Computes the modular inverse of a field element with respect to a given modulus.
field_from_bytes
Converts a byte array to a field element, supporting both big-endian and little-endian formats.
derive_public_key
Computes a public key from a private key using the Baby JubJub curve.
derive_public_key_optimized
Provides an optimized version of public key derivation using pre-computed curve parameters.
Usage
This implementation can be used for secure digital signature generation and verification in Noir projects. It's particularly useful for blockchain and cryptographic applications requiring ECDSA functionality.
Notes
Future Improvements