diff --git a/Cargo.toml b/Cargo.toml index e839791511f54bafbcf527a52763451292ffac3d..17ad977fcb932acc52823c713fa7291b7cb02d6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,8 +23,6 @@ rand = "0.8.5" [workspace] members = [ "benchmarks", - "bins/curves", "bins/inbreeding", "bins/rank", - "bins/rng", ] diff --git a/bins/curves/Cargo.toml b/bins/curves/Cargo.toml deleted file mode 100644 index 11dbf377bec67863695e4cd0051654a0efef807d..0000000000000000000000000000000000000000 --- a/bins/curves/Cargo.toml +++ /dev/null @@ -1,36 +0,0 @@ -[package] -name = "curves" -version = "0.1.0" -edition = "2021" -description = "Explore Arkworks elliptic curves." - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -ark-bls12-377 = "0.4.0" -ark-bls12-381 = "0.4.0" -ark-bn254 = "0.4.0" -ark-bw6-761 = "0.4.0" -ark-cp6-782 = "0.4.0" -ark-curve25519 = "0.4.0" -ark-ed-on-bls12-377 = "0.4.0" -ark-ed-on-bls12-381 = "0.4.0" -ark-ed-on-bls12-381-bandersnatch = "0.4.0" -ark-ed-on-bn254 = "0.4.0" -ark-ed-on-bw6-761 = "0.4.0" -ark-ed-on-cp6-782 = "0.4.0" -ark-ed-on-mnt4-298 = "0.4.0" -ark-ed-on-mnt4-753 = "0.4.0" -ark-ed25519 = "0.4.0" -ark-ff = "0.4.2" -ark-mnt4-298 = "0.4.0" -ark-mnt4-753 = "0.4.0" -ark-mnt6-298 = "0.4.0" -ark-mnt6-753 = "0.4.0" -ark-pallas = "0.4.0" -ark-poly-commit = "0.4.0" -ark-secp256k1 = "0.4.0" -ark-secp256r1 = "0.4.0" -ark-secp384r1 = "0.4.0" -ark-secq256k1 = "0.4.0" -ark-vesta = "0.4.0" diff --git a/bins/curves/README.md b/bins/curves/README.md deleted file mode 100644 index 6d4da6aa8bc56726b567566f8619a0b1d7aad373..0000000000000000000000000000000000000000 --- a/bins/curves/README.md +++ /dev/null @@ -1,37 +0,0 @@ -```shell -cargo run - | lines - | parse "{curve}: {fq} -> {fr}" - | into int fq fr - | insert x { (1 - $in.fr / $in.fq) * 100 | math round --precision 1 } -``` - -which gives the followin table - -| curve | fq | fr | x | -| -------------------------------- | --- | --- | ---- | -| ark_bls12_377 | 377 | 253 | 32.9 | -| ark_bls12_381 | 381 | 255 | 33.1 | -| ark_bn254 | 254 | 254 | 0 | -| ark_bw6_761 | 761 | 377 | 50.5 | -| ark_cp6_782 | 782 | 377 | 51.8 | -| ark_curve25519 | 255 | 253 | 0.8 | -| ark_ed25519 | 255 | 253 | 0.8 | -| ark_ed_on_bls12_377 | 253 | 251 | 0.8 | -| ark_ed_on_bls12_381 | 255 | 252 | 1.2 | -| ark_ed_on_bls12_381_bandersnatch | 255 | 253 | 0.8 | -| ark_ed_on_bn254 | 254 | 251 | 1.2 | -| ark_ed_on_bw6_761 | 377 | 374 | 0.8 | -| ark_ed_on_cp6_782 | 377 | 374 | 0.8 | -| ark_ed_on_mnt4_298 | 298 | 296 | 0.7 | -| ark_ed_on_mnt4_753 | 753 | 750 | 0.4 | -| ark_mnt4_298 | 298 | 298 | 0 | -| ark_mnt4_753 | 753 | 753 | 0 | -| ark_mnt6_298 | 298 | 298 | 0 | -| ark_mnt6_753 | 753 | 753 | 0 | -| ark_pallas | 255 | 255 | 0 | -| ark_secp256k1 | 256 | 256 | 0 | -| ark_secp256r1 | 256 | 256 | 0 | -| ark_secp384r1 | 384 | 384 | 0 | -| ark_secq256k1 | 256 | 256 | 0 | -| ark_vesta | 255 | 255 | 0 | diff --git a/bins/curves/src/main.rs b/bins/curves/src/main.rs deleted file mode 100644 index 037976ed47abea4fa592d6a560d99457d8c78080..0000000000000000000000000000000000000000 --- a/bins/curves/src/main.rs +++ /dev/null @@ -1,74 +0,0 @@ -use ark_ff::PrimeField; - -fn show_curve<Fr: PrimeField, Fq: PrimeField>(name: &str) { - println!( - "{}: {} -> {}", - name, - Fq::MODULUS_BIT_SIZE, - Fr::MODULUS_BIT_SIZE - ); -} - -/// takes a sequence of curve crate names and calls the [`show_curve`] function -/// for you -/// -/// this macro accepts a trailling comma in case you have a big list that spans -/// over multiple lines, e.g. -/// -/// ## examples -/// ```rust -/// show_curve(ark_bls12_381) -/// ``` -/// or -/// ```rust -/// show_curve( -/// ark_bls12_381, -/// ark_bn254, -/// ark_pallas, -/// ark_vesta -/// ) -/// ``` -/// or -/// ```rust -/// show_curve( -/// ark_bls12_381, -/// ark_bn254, -/// ark_pallas, -/// ark_vesta, -/// ) -/// ``` -macro_rules! show_curve { - ($($c:ident),+ $(,)?) => { - $(show_curve::<$c::Fr, $c::Fq>(stringify!($c));)* - } -} - -fn main() { - show_curve!( - ark_bls12_377, - ark_bls12_381, - ark_bn254, - ark_bw6_761, - ark_cp6_782, - ark_curve25519, - ark_ed_on_bls12_377, - ark_ed_on_bls12_381, - ark_ed_on_bls12_381_bandersnatch, - ark_ed_on_bn254, - ark_ed_on_bw6_761, - ark_ed_on_cp6_782, - ark_ed_on_mnt4_298, - ark_ed_on_mnt4_753, - ark_ed25519, - ark_mnt4_298, - ark_mnt4_753, - ark_mnt6_298, - ark_mnt6_753, - ark_pallas, - ark_secp256k1, - ark_secp256r1, - ark_secp384r1, - ark_secq256k1, - ark_vesta, - ); -} diff --git a/bins/rng/Cargo.toml b/bins/rng/Cargo.toml deleted file mode 100644 index f209c7e3afb139cdfd2d20a0b0f4de4b64814c55..0000000000000000000000000000000000000000 --- a/bins/rng/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "rng" -version = "0.1.0" -edition = "2021" -description = "Generate random numbers from a seed." - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -clap = { version = "4.5.4", features = ["derive"] } -hex = "0.4.3" -rand = "0.8.5" diff --git a/bins/rng/src/main.rs b/bins/rng/src/main.rs deleted file mode 100644 index 32223c9fca320339413fdc94d923219f24bd8152..0000000000000000000000000000000000000000 --- a/bins/rng/src/main.rs +++ /dev/null @@ -1,35 +0,0 @@ -use clap::Parser; -use rand::{rngs::StdRng, Rng, SeedableRng}; - -fn parse_hex_string(s: &str) -> Result<[u8; 32], String> { - if s.len() != 64 { - return Err("Input string must be exactly 64 characters long".to_string()); - } - - match hex::decode(s) { - // `bytes` will be a `Vec<u8>` of size `32`, so it's safe to `unwrap` - // the conversion to `[u8: 32]` - Ok(bytes) => Ok(bytes.try_into().unwrap()), - Err(e) => Err(format!("Failed to decode hex string: {}", e)), - } -} - -#[derive(Parser)] -#[command(version, about, long_about = None)] -struct Cli { - #[arg(short)] - n: usize, - - #[arg(long, value_parser = parse_hex_string)] - prng_seed: [u8; 32], -} - -fn main() { - let cli = Cli::parse(); - - let mut rng = StdRng::from_seed(cli.prng_seed); - - for _ in 0..cli.n { - println!("{}", rng.gen::<u8>()); - } -}