Skip to content

Commit

Permalink
Merge c786b86 into 85d71a5
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc authored Jun 6, 2024
2 parents 85d71a5 + c786b86 commit 55ae0e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions rln/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn json_to_g1(json: &Value, key: &str) -> Result<G1Affine> {
.map(|x| x.map(|v| v.to_owned()))
.collect::<Result<Vec<String>>>()?;

Ok(G1Affine::from(G1Projective::new(
Ok(G1Affine::from(G1Projective::new_unchecked(
fq_from_str(&els[0])?,
fq_from_str(&els[1])?,
fq_from_str(&els[2])?,
Expand Down Expand Up @@ -210,7 +210,7 @@ fn json_to_g1_vec(json: &Value, key: &str) -> Result<Vec<G1Affine>> {

let mut res = vec![];
for coords in els {
res.push(G1Affine::from(G1Projective::new(
res.push(G1Affine::from(G1Projective::new_unchecked(
fq_from_str(&coords[0])?,
fq_from_str(&coords[1])?,
fq_from_str(&coords[2])?,
Expand Down Expand Up @@ -244,7 +244,7 @@ fn json_to_g2(json: &Value, key: &str) -> Result<G2Affine> {
let x = Fq2::new(fq_from_str(&els[0][0])?, fq_from_str(&els[0][1])?);
let y = Fq2::new(fq_from_str(&els[1][0])?, fq_from_str(&els[1][1])?);
let z = Fq2::new(fq_from_str(&els[2][0])?, fq_from_str(&els[2][1])?);
Ok(G2Affine::from(G2Projective::new(x, y, z)))
Ok(G2Affine::from(G2Projective::new_unchecked(x, y, z)))
}

// Converts JSON to a VerifyingKey
Expand Down
4 changes: 2 additions & 2 deletions rln/src/public_api_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ fn g1_from_str(g1: &[String]) -> ark_bn254::G1Affine {
let x = fq_from_str(g1[0].clone());
let y = fq_from_str(g1[1].clone());
let z = fq_from_str(g1[2].clone());
ark_bn254::G1Affine::from(ark_bn254::G1Projective::new(x, y, z))
ark_bn254::G1Affine::from(ark_bn254::G1Projective::new_unchecked(x, y, z))
}

fn g2_from_str(g2: &[Vec<String>]) -> ark_bn254::G2Affine {
Expand All @@ -385,7 +385,7 @@ fn g2_from_str(g2: &[Vec<String>]) -> ark_bn254::G2Affine {
let c1 = fq_from_str(g2[2][1].clone());
let z = ark_bn254::Fq2::new(c0, c1);

ark_bn254::G2Affine::from(ark_bn254::G2Projective::new(x, y, z))
ark_bn254::G2Affine::from(ark_bn254::G2Projective::new_unchecked(x, y, z))
}

fn value_to_string_vec(value: &Value) -> Vec<String> {
Expand Down

0 comments on commit 55ae0e1

Please sign in to comment.