Skip to content

Commit

Permalink
chore: use Noir implementation of pedersen in public (uses MSM instea…
Browse files Browse the repository at this point in the history
…d of pedersen BBs) (#8798)
  • Loading branch information
dbanks12 authored Sep 27, 2024
1 parent aadd9d5 commit 02821d0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions noir/noir-repo/noir_stdlib/src/hash/mod.nr
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,11 @@ pub fn pedersen_commitment<let N: u32>(input: [Field; N]) -> EmbeddedCurvePoint
}

pub fn pedersen_hash_with_separator<let N: u32>(input: [Field; N], separator: u32) -> Field {
__pedersen_hash_with_separator(input, separator)
pedersen_hash_with_separator_noir(input, separator)
}

pub fn pedersen_commitment_with_separator<let N: u32>(input: [Field; N], separator: u32) -> EmbeddedCurvePoint {
let value = __pedersen_commitment_with_separator(input, separator);
if (value[0] == 0) & (value[1] == 0) {
EmbeddedCurvePoint { x: 0, y: 0, is_infinite: true }
} else {
EmbeddedCurvePoint { x: value[0], y: value[1], is_infinite: false }
}
pedersen_commitment_with_separator_noir(input, separator)
}

#[no_predicates]
Expand Down Expand Up @@ -78,7 +73,7 @@ fn pedersen_hash_with_separator_noir<let N: u32>(input: [Field; N], separator: u
pub fn pedersen_hash<let N: u32>(input: [Field; N]) -> Field
// docs:end:pedersen_hash
{
__pedersen_hash_with_separator(input, 0)
pedersen_hash_with_separator_noir(input, 0)
}

#[foreign(pedersen_hash)]
Expand Down

0 comments on commit 02821d0

Please sign in to comment.