pedersenHash method
Pedersen hash over packed LSB-first bits → 32-byte Jubjub compressed.
personal selects the generator set (0 = note commitment,
1 = Merkle tree at layer); bitLen is the number of significant
bits in packedBits. Routes to the active backend (pure-Dart
PedersenHash, or native Rust). Throws on crypto failure.
Implementation
@override
BuBytes pedersenHash({
required int personal,
int layer = 0,
required BuBytes packedBits,
required int bitLen,
}) {
if (bitLen < 0 || (bitLen + 7) ~/ 8 > packedBits.length) {
throw CoreErrors.invalidOperationArguments(
"pedersenHash",
name: "bitLen",
reason: "bitLen exceeds packedBits length.",
);
}
return inner.pedersenHash(
personal: personal,
layer: layer,
packedBits: packedBits,
bitLen: bitLen,
);
}