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

feat: add scalar_mult function to main.rs for Bn254 point multiplication #1708

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/bn254-add/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use sp1_curves::params::FieldParameters;
use sp1_lib::bn254::Bn254Point;
use sp1_lib::bn254::Bn254Scalar;
sp1_zkvm::entrypoint!(main);

// generator.
Expand Down Expand Up @@ -31,7 +32,10 @@ const C: [u8; 64] = [
91, 156, 11, 180, 99, 158, 49, 117, 100, 8, 141, 124, 219, 79, 85, 41, 148, 72, 224, 190, 153,
183, 42,
];

pub fn scalar_mult(point: &Bn254Point, scalar: &[u8; 32]) -> Bn254Point {
let scalar_value = Bn254Scalar::from_bytes(scalar).expect("Valid scalar bytes");
point * scalar_value
}
pub fn main() {
common_test_utils::weierstrass_add::test_weierstrass_add::<Bn254Point, { sp1_lib::bn254::N }>(
&A,
Expand Down