Skip to content

Commit

Permalink
Drop bls12-381 dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaker committed Dec 16, 2024
1 parent b6f0a78 commit 13f992f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
4 changes: 1 addition & 3 deletions nimue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ ark-ff = { version = "^0.4", optional = true }
ark-ec = { version = "^0.4", optional = true }
ark-serialize = { version = "^0.4", optional = true, features = ["std"] }
group = { version = "0.13.0", optional = true }
ark-bls12-381 = { version = "^0.4", optional = true }
hex = "0.4.3"

[features]
default = []
ark = ["dep:ark-ff", "dep:ark-ec", "dep:ark-serialize"]
group = ["dep:group"]
ark-bls12-381 = ["ark", "dep:ark-bls12-381"]
asm = ["keccak/asm", "keccak/simd"]

[dev-dependencies]
Expand All @@ -39,7 +37,7 @@ curve25519-dalek = { version = "4.0.0", features = ["group"] }
ark-curve25519 = "0.4.0"
# test algebraic hashers
bls12_381 = "0.8.0"
ark-bls12-381 = { version = "^0.4", features = ["std"] }
# ark-bls12-381 = { version = "^0.4", features = ["std"] }
anyhow = { version = "1.0.75", features = ["backtrace"] }
ark-pallas = { version = "^0.4", features = ["std"] }
pallas = "^0.31"
Expand Down
24 changes: 12 additions & 12 deletions nimue/src/plugins/ark/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,24 @@ fn test_arkworks_end_to_end<F: Field, H: DuplexHash>() -> ProofResult<()> {
Ok(())
}

#[test]
fn test_squeeze_bytes_from_modp() {
use ark_bls12_381::{Fq, Fr};
use ark_ff::PrimeField;
// #[test]
// fn test_squeeze_bytes_from_modp() {
// use ark_bls12_381::{Fq, Fr};
// use ark_ff::PrimeField;

use crate::plugins::random_bytes_in_random_modp;
let useful_bytes = random_bytes_in_random_modp(Fr::MODULUS);
assert_eq!(useful_bytes, 127 / 8);
// use crate::plugins::random_bytes_in_random_modp;
// let useful_bytes = random_bytes_in_random_modp(Fr::MODULUS);
// assert_eq!(useful_bytes, 127 / 8);

let useful_bytes = random_bytes_in_random_modp(Fq::MODULUS);
assert_eq!(useful_bytes, 253 / 8);
}
// let useful_bytes = random_bytes_in_random_modp(Fq::MODULUS);
// assert_eq!(useful_bytes, 253 / 8);
// }

#[test]
fn test_arkworks() {
use ark_bls12_381::{Fq2, Fr};
use ark_curve25519::{Fq, Fr};
type F = Fr;
type F2 = Fq2;
type F2 = Fq;

test_arkworks_end_to_end::<F, DefaultHash>().unwrap();
test_arkworks_end_to_end::<F2, DefaultHash>().unwrap();
Expand Down
13 changes: 7 additions & 6 deletions nimue/src/plugins/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ fn test_compatible_curve25519() {
compatible_groups::<ArkG, GroupG>();
}

#[test]
fn test_compatible_bls12_381() {
type ArkG = ark_bls12_381::G1Projective;
type GroupG = bls12_381::G1Projective;
compatible_groups::<ArkG, GroupG>();
}
// Ignored: ark_bls12_381 does not compile.
// #[test]
// fn test_compatible_bls12_381() {
// type ArkG = ark_bls12_381::G1Projective;
// type GroupG = bls12_381::G1Projective;
// compatible_groups::<ArkG, GroupG>();
// }

#[ignore = "arkworks adds trailing 0-byte"]
#[test]
Expand Down

0 comments on commit 13f992f

Please sign in to comment.