From 5c74274895db80954730ae2d9bc8e7891d783c03 Mon Sep 17 00:00:00 2001 From: dbanks12 Date: Wed, 25 Sep 2024 19:18:22 +0000 Subject: [PATCH] chore: use Noir implementation of pedersen that uses MSM instead of pedersen BBs --- noir/noir-repo/noir_stdlib/src/hash/mod.nr | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/noir/noir-repo/noir_stdlib/src/hash/mod.nr b/noir/noir-repo/noir_stdlib/src/hash/mod.nr index c69c3f9c49e..f555e63d385 100644 --- a/noir/noir-repo/noir_stdlib/src/hash/mod.nr +++ b/noir/noir-repo/noir_stdlib/src/hash/mod.nr @@ -33,16 +33,11 @@ pub fn pedersen_commitment(input: [Field; N]) -> EmbeddedCurvePoint } pub fn pedersen_hash_with_separator(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(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] @@ -78,7 +73,7 @@ fn pedersen_hash_with_separator_noir(input: [Field; N], separator: u pub fn pedersen_hash(input: [Field; N]) -> Field // docs:end:pedersen_hash { - __pedersen_hash_with_separator(input, 0) + pedersen_hash_with_separator_noir(input, 0) } #[foreign(pedersen_hash)]