Skip to content

Commit

Permalink
fix: apply pedersen separator correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Jun 24, 2024
1 parent c9dddbb commit b77204a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions noir/noir-repo/noir_stdlib/src/hash.nr
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ fn derive_generators<N, M>(domain_separator_bytes: [u8; M], starting_index: u32)
fn __derive_generators<N, M>(domain_separator_bytes: [u8; M], starting_index: u32) -> [EmbeddedCurvePoint; N] {}

pub fn pedersen_hash_with_separator<N>(input: [Field; N], separator: u32) -> Field {
let v1 = pedersen_commitment(input);
let length_generator :[EmbeddedCurvePoint;1] = derive_generators("pedersen_hash_length".as_bytes(), separator);
let v1 = pedersen_commitment_with_separator(input, separator);
let length_generator: [EmbeddedCurvePoint; 1] = derive_generators("pedersen_hash_length".as_bytes(), 0);
multi_scalar_mul(
[length_generator[0], v1],
[EmbeddedCurveScalar { lo: N as Field, hi: 0 }, EmbeddedCurveScalar { lo: 1, hi: 0 }]
Expand Down

0 comments on commit b77204a

Please sign in to comment.