Skip to content

Commit 5562893

Browse files
Fix lint errors and typos
1 parent 8f8fa3c commit 5562893

File tree

15 files changed

+29
-7274
lines changed

15 files changed

+29
-7274
lines changed

Cargo.lock

Lines changed: 0 additions & 7249 deletions
This file was deleted.

benchmarks/programs/pairing/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn main() {
2525
setup_all_moduli();
2626
setup_all_complex_extensions();
2727
// Pairing doesn't need G1Affine intrinsics, but we trigger it anyways to test the chips
28-
setup_all_curves();
28+
setup_all_sw_curves();
2929

3030
// copied from https://github.com/bluealloy/revm/blob/9e39df5dbc5fdc98779c644629b28b8bee75794a/crates/precompile/src/bn128.rs#L395
3131
let input = hex::decode(

benchmarks/src/bin/kitchen_sink.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use num_bigint::BigUint;
66
use openvm_algebra_circuit::{Fp2Extension, ModularExtension};
77
use openvm_benchmarks::utils::BenchmarkCli;
88
use openvm_circuit::arch::{instructions::exe::VmExe, SystemConfig};
9-
use openvm_ecc_circuit::{WeierstrassExtension, P256_CONFIG, SECP256K1_CONFIG};
9+
use openvm_ecc_circuit::{EccExtension, P256_CONFIG, SECP256K1_CONFIG};
1010
use openvm_native_recursion::halo2::utils::{CacheHalo2ParamsReader, DEFAULT_PARAMS_DIR};
1111
use openvm_pairing_circuit::{PairingCurve, PairingExtension};
1212
use openvm_sdk::{
@@ -47,12 +47,15 @@ fn main() -> Result<()> {
4747
bn_config.modulus.clone(),
4848
bls_config.modulus.clone(),
4949
]))
50-
.ecc(WeierstrassExtension::new(vec![
51-
SECP256K1_CONFIG.clone(),
52-
P256_CONFIG.clone(),
53-
bn_config.clone(),
54-
bls_config.clone(),
55-
]))
50+
.ecc(EccExtension::new(
51+
vec![
52+
SECP256K1_CONFIG.clone(),
53+
P256_CONFIG.clone(),
54+
bn_config.clone(),
55+
bls_config.clone(),
56+
],
57+
vec![],
58+
))
5659
.pairing(PairingExtension::new(vec![
5760
PairingCurve::Bn254,
5861
PairingCurve::Bls12_381,

benchmarks/src/bin/pairing.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use eyre::Result;
33
use openvm_algebra_circuit::{Fp2Extension, ModularExtension};
44
use openvm_benchmarks::utils::BenchmarkCli;
55
use openvm_circuit::arch::SystemConfig;
6-
use openvm_ecc_circuit::WeierstrassExtension;
6+
use openvm_ecc_circuit::EccExtension;
77
use openvm_pairing_circuit::{PairingCurve, PairingExtension};
88
use openvm_pairing_guest::bn254::{BN254_MODULUS, BN254_ORDER};
99
use openvm_sdk::{config::SdkVmConfig, Sdk, StdIn};
@@ -24,9 +24,10 @@ fn main() -> Result<()> {
2424
BN254_ORDER.clone(),
2525
]))
2626
.fp2(Fp2Extension::new(vec![BN254_MODULUS.clone()]))
27-
.ecc(WeierstrassExtension::new(vec![
28-
PairingCurve::Bn254.curve_config()
29-
]))
27+
.ecc(EccExtension::new(
28+
vec![PairingCurve::Bn254.curve_config()],
29+
vec![],
30+
))
3031
.pairing(PairingExtension::new(vec![PairingCurve::Bn254]))
3132
.build();
3233
let sdk = Sdk::new();

examples/ecc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ members = []
88

99
[dependencies]
1010
openvm = { path = "../../crates/toolchain/openvm", features = ["std"] }
11+
openvm-custom-insn = { path = "../../crates/toolchain/custom_insn", default-features = false }
1112
openvm-algebra-guest = { path = "../../extensions/algebra/guest" }
1213
openvm-ecc-guest = { path = "../../extensions/ecc/guest", features = ["k256"] }
1314
openvm-rv32im-guest = { path = "../../extensions/rv32im/guest" }

examples/ecc/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ use openvm_ecc_guest::{
77
weierstrass::WeierstrassPoint,
88
Group,
99
};
10+
extern crate alloc;
11+
1012
// ANCHOR_END: imports
1113
openvm_algebra_guest::moduli_macros::moduli_declare! {
1214
// The Secp256k1 modulus and scalar field modulus are already declared in the k256 module

extensions/ecc/circuit/src/edwards_chip/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use utils::jacobi;
2525
/// For secp256k1, BLOCK_SIZE = 32, BLOCKS = 2.
2626
#[derive(Chip, ChipUsageGetter, InstructionExecutor)]
2727
pub struct TeAddChip<F: PrimeField32, const BLOCKS: usize, const BLOCK_SIZE: usize>(
28-
VmChipWrapper<
28+
pub VmChipWrapper<
2929
F,
3030
Rv32VecHeapAdapterChip<F, 2, BLOCKS, BLOCKS, BLOCK_SIZE, BLOCK_SIZE>,
3131
FieldExpressionCoreChip,

extensions/ecc/circuit/src/weierstrass_chip/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use openvm_stark_backend::p3_field::PrimeField32;
2727
/// For secp256k1, BLOCK_SIZE = 32, BLOCKS = 2.
2828
#[derive(Chip, ChipUsageGetter, InstructionExecutor)]
2929
pub struct SwAddNeChip<F: PrimeField32, const BLOCKS: usize, const BLOCK_SIZE: usize>(
30-
pub VmChipWrapper<
30+
pub VmChipWrapper<
3131
F,
3232
Rv32VecHeapAdapterChip<F, 2, BLOCKS, BLOCKS, BLOCK_SIZE, BLOCK_SIZE>,
3333
FieldExpressionCoreChip,
@@ -63,7 +63,7 @@ impl<F: PrimeField32, const BLOCKS: usize, const BLOCK_SIZE: usize>
6363

6464
#[derive(Chip, ChipUsageGetter, InstructionExecutor)]
6565
pub struct SwDoubleChip<F: PrimeField32, const BLOCKS: usize, const BLOCK_SIZE: usize>(
66-
pub VmChipWrapper<
66+
pub VmChipWrapper<
6767
F,
6868
Rv32VecHeapAdapterChip<F, 1, BLOCKS, BLOCKS, BLOCK_SIZE, BLOCK_SIZE>,
6969
FieldExpressionCoreChip,

extensions/ecc/te-macros/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ repository.workspace = true
1010
syn = { version = "2.0", features = ["full"] }
1111
quote = "1.0"
1212
openvm-macros-common = { workspace = true, default-features = false }
13-
num-bigint.workspace = true
14-
proc-macro2 = "1.0.38"
1513

1614
[lib]
1715
proc-macro = true

extensions/ecc/tests/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ openvm-stark-sdk.workspace = true
1212
openvm-circuit = { workspace = true, features = ["test-utils"] }
1313
openvm-transpiler.workspace = true
1414
openvm-algebra-circuit.workspace = true
15-
openvm-algebra-guest.workspace = true
1615
openvm-algebra-transpiler.workspace = true
1716
openvm-ecc-transpiler.workspace = true
1817
openvm-ecc-circuit.workspace = true

extensions/ecc/tests/programs/examples/decompress_invalid_hint.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use openvm::io::read_vec;
99
use openvm_ecc_guest::{
1010
algebra::{Field, IntMod},
1111
k256::{Secp256k1Coord, Secp256k1Point},
12-
weierstrass::{DecompressionHint, FromCompressed, WeierstrassPoint},
13-
Group,
12+
weierstrass::WeierstrassPoint,
13+
DecompressionHint, FromCompressed, Group,
1414
};
1515

1616
openvm::entry!(main);
@@ -209,7 +209,6 @@ pub fn main() {
209209
setup_2();
210210
setup_4();
211211
setup_all_sw_curves();
212-
setup_all_te_curves();
213212

214213
let bytes = read_vec();
215214

extensions/ecc/tests/programs/examples/ec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#![cfg_attr(not(feature = "std"), no_std)]
33

44
use hex_literal::hex;
5-
use openvm_algebra_guest::IntMod;
65
use openvm_ecc_guest::{
6+
algebra::IntMod,
77
k256::{Secp256k1Coord, Secp256k1Point, Secp256k1Scalar},
88
msm,
99
weierstrass::WeierstrassPoint,

extensions/ecc/tests/programs/examples/ec_nonzero_a.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#![cfg_attr(not(feature = "std"), no_std)]
33

44
use hex_literal::hex;
5-
use openvm_algebra_guest::IntMod;
65
use openvm_ecc_guest::{
6+
algebra::IntMod,
77
p256::{P256Coord, P256Point},
88
weierstrass::WeierstrassPoint,
99
CyclicGroup, Group,

extensions/ecc/tests/programs/examples/ec_two_curves.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#![cfg_attr(not(feature = "std"), no_std)]
33

44
use hex_literal::hex;
5-
use openvm_algebra_guest::IntMod;
65
use openvm_ecc_guest::{
6+
algebra::IntMod,
77
k256::{Secp256k1Coord, Secp256k1Point, Secp256k1Scalar},
88
msm,
99
p256::{P256Coord, P256Point},

extensions/ecc/tests/programs/examples/edwards_ec.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
#![cfg_attr(not(feature = "std"), no_std)]
33

44
use hex_literal::hex;
5-
use openvm_algebra_guest::{moduli_macros::moduli_init, IntMod};
5+
use openvm_algebra_guest::moduli_macros::moduli_init;
66
use openvm_ecc_guest::{
7+
algebra::IntMod,
78
ed25519::{Ed25519Coord, Ed25519Point},
89
edwards::TwistedEdwardsPoint,
910
te_macros::te_init,

0 commit comments

Comments
 (0)