-
Notifications
You must be signed in to change notification settings - Fork 410
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(precompile): add bn254 precompile #384
feat(precompile): add bn254 precompile #384
Conversation
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
eff4894
to
e977a32
Compare
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
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.
generally looks pretty good! few minor comments
zkvm/precompiles/src/bn254.rs
Outdated
} | ||
|
||
impl Bn254AffinePoint { | ||
pub fn from(x: [u32; 8], y: [u32; 8]) -> Self { |
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 reuse code with the other AffinePoint
? this seems like a lot of this copy-pasted from another file
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.
please let me know on your thoughts on https://github.com/succinctlabs/sp1/pull/384/files#diff-dd2618465bbb8d8253e07f153eae3ec526ce00926191f797ff418ed4d710dc0f
Signed-off-by: 0xkanekiken <[email protected]>
Just an update on the VM cycles: |
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
Signed-off-by: 0xkanekiken <[email protected]>
This PR adds support for the
bn254
curve'sadd
anddouble
operations by leveraging the existingweierstrass
precompile.bn254_mul
by leveragingbn254_add
andbn254_double
. One operation ofbn254
is taking 3,806,937 vm cycles.