Commit 79fc2f9d authored by Roman Walch's avatar Roman Walch
Browse files

add rc bounty instances

parent ef447fe5
......@@ -9,7 +9,6 @@ edition = "2018"
ff = {package = "ff_ce", version = "0.13", features = ["derive"] }
rand = "0.4" # held back for ff_ce
lazy_static = "1.4"
cfg-if = "1.0"
sha3 = "0.9"
[[example]]
......@@ -72,6 +71,18 @@ path = "examples/feistel_mimc/feistel_mimc_hard1.rs"
name = "feistel_mimc_hard2"
path = "examples/feistel_mimc/feistel_mimc_hard2.rs"
[[example]]
name = "reinforced_concrete_easy"
path = "examples/reinforced_concrete/reinforced_concrete_easy.rs"
[[example]]
name = "reinforced_concrete_medium"
path = "examples/reinforced_concrete/reinforced_concrete_medium.rs"
[[example]]
name = "reinforced_concrete_hard"
path = "examples/reinforced_concrete/reinforced_concrete_hard.rs"
[profile.release]
lto = true
codegen-units = 1
......
use ff::{from_hex, Field};
use zkhash_bounties::{
feistel_mimc::{feistel_mimc::FeistelMimc, feistel_mimc_instances::FM_PARAMS_EASY1},
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
feistel_mimc::{feistel_mimc::FeistelMimc, feistel_mimc_instances::FM_PARAMS_EASY2},
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
feistel_mimc::{feistel_mimc::FeistelMimc, feistel_mimc_instances::FM_PARAMS_HARD1},
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
feistel_mimc::{feistel_mimc::FeistelMimc, feistel_mimc_instances::FM_PARAMS_HARD2},
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
feistel_mimc::{feistel_mimc::FeistelMimc, feistel_mimc_instances::FM_PARAMS_MEDIUM},
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
poseidon::{poseidon::Poseidon, poseidon_instances::POSEIDON_PARAMS_EASY1},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
poseidon::{poseidon::Poseidon, poseidon_instances::POSEIDON_PARAMS_EASY2},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
poseidon::{poseidon::Poseidon, poseidon_instances::POSEIDON_PARAMS_HARD1},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
poseidon::{poseidon::Poseidon, poseidon_instances::POSEIDON_PARAMS_HARD2},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
poseidon::{poseidon::Poseidon, poseidon_instances::POSEIDON_PARAMS_MEDIUM},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field48::Fp48, utils},
reinforced_concrete::{
reinforced_concrete::ReinforcedConcrete, reinforced_concrete_instances::RC_PARAMS_EASY,
},
};
type Scalar = Fp48;
static RANDOM_INPUT: bool = false;
fn main() {
let params = &RC_PARAMS_EASY;
let rc = ReinforcedConcrete::new(params);
println!("Reinforced Concrete Challange easy");
// insert your solution here:
let solution1: Scalar = from_hex("0x0000000000000000").unwrap();
let solution2: Scalar = from_hex("0x0000000000000000").unwrap();
let input = if RANDOM_INPUT {
[
utils::random_scalar(true),
utils::random_scalar(true),
Scalar::zero(),
]
} else {
[solution1, solution2, Scalar::zero()]
};
let output = rc.permutation(&input);
println!("Input = {:?}", input);
println!("Output = {:?}", output);
if output[output.len() - 1] == Scalar::zero() {
println!("Challenge solved!");
} else {
println!("Challenge not solved!");
}
}
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field64::Fp64, utils},
reinforced_concrete::{
reinforced_concrete::ReinforcedConcrete, reinforced_concrete_instances::RC_PARAMS_HARD,
},
};
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
fn main() {
let params = &RC_PARAMS_HARD;
let rc = ReinforcedConcrete::new(params);
println!("Reinforced Concrete Challange hard");
// insert your solution here:
let solution1: Scalar = from_hex("0x0000000000000000").unwrap();
let solution2: Scalar = from_hex("0x0000000000000000").unwrap();
let input = if RANDOM_INPUT {
[
utils::random_scalar(true),
utils::random_scalar(true),
Scalar::zero(),
]
} else {
[solution1, solution2, Scalar::zero()]
};
let output = rc.permutation(&input);
println!("Input = {:?}", input);
println!("Output = {:?}", output);
if output[output.len() - 1] == Scalar::zero() {
println!("Challenge solved!");
} else {
println!("Challenge not solved!");
}
}
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field56::Fp56, utils},
reinforced_concrete::{
reinforced_concrete::ReinforcedConcrete, reinforced_concrete_instances::RC_PARAMS_MEDIUM,
},
};
type Scalar = Fp56;
static RANDOM_INPUT: bool = false;
fn main() {
let params = &RC_PARAMS_MEDIUM;
let rc = ReinforcedConcrete::new(params);
println!("Reinforced Concrete Challange medium");
// insert your solution here:
let solution1: Scalar = from_hex("0x0000000000000000").unwrap();
let solution2: Scalar = from_hex("0x0000000000000000").unwrap();
let input = if RANDOM_INPUT {
[
utils::random_scalar(true),
utils::random_scalar(true),
Scalar::zero(),
]
} else {
[solution1, solution2, Scalar::zero()]
};
let output = rc.permutation(&input);
println!("Input = {:?}", input);
println!("Output = {:?}", output);
if output[output.len() - 1] == Scalar::zero() {
println!("Challenge solved!");
} else {
println!("Challenge not solved!");
}
}
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
rescue_prime::{rescue_prime::RescuePrime, rescue_prime_instances::RESCUE_PRIME_PARAMS_EASY1},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
rescue_prime::{rescue_prime::RescuePrime, rescue_prime_instances::RESCUE_PRIME_PARAMS_EASY2},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
rescue_prime::{rescue_prime::RescuePrime, rescue_prime_instances::RESCUE_PRIME_PARAMS_HARD1},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
rescue_prime::{rescue_prime::RescuePrime, rescue_prime_instances::RESCUE_PRIME_PARAMS_HARD2},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
use ff::{from_hex, Field};
use zkhash_bounties::{
fields::{field::Fp, utils},
fields::{field64::Fp64, utils},
rescue_prime::{rescue_prime::RescuePrime, rescue_prime_instances::RESCUE_PRIME_PARAMS_MEDIUM},
};
type Scalar = Fp;
type Scalar = Fp64;
static RANDOM_INPUT: bool = false;
......
......@@ -57,11 +57,11 @@ mod feistel_mimc_kats {
use super::*;
use crate::feistel_mimc::feistel_mimc_instances::*;
use crate::fields::field::Fp;
use crate::fields::field64::Fp64;
use ff::{from_hex, Field};
type Scalar = Fp;
type Scalar = Fp64;
#[test]
fn easy1_kats() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment