Skip to content

Commit

Permalink
Merge pull request #179 from iden3/adding_primes
Browse files Browse the repository at this point in the history
Adding primes: pallas, vesta, grumpkin
  • Loading branch information
clararod9 authored May 12, 2023
2 parents de47e12 + 023bafe commit ce903c6
Show file tree
Hide file tree
Showing 24 changed files with 64,934 additions and 372 deletions.
709 changes: 353 additions & 356 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions circom/src/input_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,11 @@ mod input_processing {
let prime_value = matches.value_of("prime").unwrap();
if prime_value == "bn128"
|| prime_value == "bls12381"
|| prime_value == "goldilocks"{
|| prime_value == "goldilocks"
|| prime_value == "grumpkin"
|| prime_value == "pallas"
|| prime_value == "vesta"
{
Ok(String::from(matches.value_of("prime").unwrap()))
}
else{
Expand Down Expand Up @@ -486,7 +490,7 @@ mod input_processing {
.takes_value(true)
.default_value("bn128")
.display_order(300)
.help("To choose the prime number to use to generate the circuit. Receives the name of the curve (bn128, bls12381, goldilocks)"),
.help("To choose the prime number to use to generate the circuit. Receives the name of the curve (bn128, bls12381, goldilocks, grumpkin, pallas, vesta)"),
)
.get_matches()
}
Expand Down
10 changes: 10 additions & 0 deletions code_producers/src/c_elements/c_code_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,9 @@ pub fn generate_fr_hpp_file(c_folder: &PathBuf, prime: &String) -> std::io::Resu
"bn128" => include_str!("bn128/fr.hpp"),
"bls12381" => include_str!("bls12381/fr.hpp"),
"goldilocks" => include_str!("goldilocks/fr.hpp"),
"grumpkin" => include_str!("grumpkin/fr.hpp"),
"pallas" => include_str!("pallas/fr.hpp"),
"vesta" => include_str!("vesta/fr.hpp"),
_ => unreachable!(),
};
for line in file.lines() {
Expand Down Expand Up @@ -851,6 +854,10 @@ pub fn generate_fr_cpp_file(c_folder: &PathBuf, prime: &String) -> std::io::Resu
"bn128" => include_str!("bn128/fr.cpp"),
"bls12381" => include_str!("bls12381/fr.cpp"),
"goldilocks" => include_str!("goldilocks/fr.cpp"),
"grumpkin" => include_str!("grumpkin/fr.cpp"),
"pallas" => include_str!("pallas/fr.cpp"),
"vesta" => include_str!("vesta/fr.cpp"),

_ => unreachable!(),
};
for line in file.lines() {
Expand Down Expand Up @@ -890,6 +897,9 @@ pub fn generate_fr_asm_file(c_folder: &PathBuf, prime: &String) -> std::io::Resu
"bn128" => include_str!("bn128/fr.asm"),
"bls12381" => include_str!("bls12381/fr.asm"),
"goldilocks" => include_str!("goldilocks/fr.asm"),
"grumpkin" => include_str!("grumpkin/fr.asm"),
"pallas" => include_str!("pallas/fr.asm"),
"vesta" => include_str!("vesta/fr.asm"),
_ => unreachable!(),
};
for line in file.lines() {
Expand Down
Loading

0 comments on commit ce903c6

Please sign in to comment.