Fixes to jubjub, curve25519 and bls-12 381 tests
This commit is contained in:
jonesmarvin8 2025-07-09 12:00:57 -04:00
parent 98d4fd2d2a
commit 909701eae4
14 changed files with 25 additions and 15 deletions

View File

@ -1,8 +0,0 @@
#![cfg_attr(target_arch = "riscv32", no_std, no_main)]
use nexus_rt::print;
#[nexus_rt::main]
fn main() {
print!("Hello, World!\n");
}

View File

@ -6,7 +6,7 @@ edition = "2024"
[dependencies]
nexus-rt = { git = "https://github.com/nexus-xyz/nexus-zkvm.git", tag = "0.3.4", version = "0.3.4" }
postcard = { version = "1.1.1", default-features = false, features = ["alloc"] }
bls12_381 = "0.8.0"
# Generated by cargo-nexus, do not remove!
#
[features]

View File

@ -0,0 +1,20 @@
#![cfg_attr(target_arch = "riscv32", no_std, no_main)]
#[nexus_rt::main]
fn main() {
// TODO: do something with the input
let g1 = bls12_381::G1Affine::generator();
let g1_proj = bls12_381::G1Projective::from(g1);
let g2 = g1_proj + g1;
let g3 = g1 + g2;
let g4 = g1 + g3;
let g5 = g1 + g4;
let s1 = bls12_381::Scalar::from(87329482u64);
let s2 = bls12_381::Scalar::from(37264829u64);
let s3 = bls12_381::Scalar::from(98098098u64);
let s4 = bls12_381::Scalar::from(63980948u64);
let s5 = bls12_381::Scalar::from(15098098u64);
let _ = s1*g1 + s2*g2 + s3*g3 + s4*g4 + s5*g5;
}

View File

@ -7,9 +7,6 @@ use curve25519_dalek::traits::MultiscalarMul;
#[nexus_rt::main]
fn main() {
// read the input
let input: u32 = env::read();
// TODO: do something with the input
let s1 = Scalar::from(87329482u64);
let s2 = Scalar::from(37264829u64);

View File

@ -8,6 +8,7 @@ nexus-rt = { git = "https://github.com/nexus-xyz/nexus-zkvm.git", tag = "0.3.4",
postcard = { version = "1.1.1", default-features = false, features = ["alloc"] }
jubjub = "0.10.0"
group = "0.13.0"
# Generated by cargo-nexus, do not remove!
#
[features]

View File

@ -8,7 +8,7 @@ fn main() {
let g3 = g1 + g2;
let g4 = g1 + g3;
let g5 = g1 + g4;
let s1 = jubjub::Fr::from(87329482u64);
let s2 = jubjub::Fr::from(37264829u64);
let s3 = jubjub::Fr::from(98098098u64);

View File

@ -1 +0,0 @@
/target

View File

@ -1,4 +1,5 @@
#![cfg_attr(target_arch = "riscv32", no_std, no_main)]
use pasta_curves::group::Group;
#[nexus_rt::main]
@ -8,7 +9,7 @@ fn main() {
let g3 = g1 + g2;
let g4 = g1 + g3;
let g5 = g1 + g4;
let s1 = pasta_curves::pallas::Scalar::from(87329482u64);
let s2 = pasta_curves::pallas::Scalar::from(37264829u64);
let s3 = pasta_curves::pallas::Scalar::from(98098098u64);