diff --git a/packages/eddsa-poseidon/src/eddsa-poseidon.ts b/packages/eddsa-poseidon/src/eddsa-poseidon.ts index e77332a3c..818bba6a4 100644 --- a/packages/eddsa-poseidon/src/eddsa-poseidon.ts +++ b/packages/eddsa-poseidon/src/eddsa-poseidon.ts @@ -53,7 +53,7 @@ export function deriveSecretScalar(privateKey: Buffer | Uint8Array | string): bi hash = hash.slice(0, 32) hash = pruneBuffer(hash) - return scalar.shiftRight(leBufferToBigInt(hash), BigInt(3)) + return scalar.shiftRight(leBufferToBigInt(hash), BigInt(3)) % subOrder } /**