From bcf902991da36ef9b4e348c26c46c3ded8ca2d5a Mon Sep 17 00:00:00 2001 From: jackryanservia <90076280+jackryanservia@users.noreply.github.com> Date: Mon, 4 Mar 2024 21:34:26 +0000 Subject: [PATCH] Revert "Add extra 0 to end of Bool.toBits so that Scalar.fromBits is happy" as this is handled in Scalar now This reverts commit c14178afa92fb702734f41a88c0e9abc533084ef. --- src/lib/nullifier.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/lib/nullifier.ts b/src/lib/nullifier.ts index 033187685d..c8e84984ef 100644 --- a/src/lib/nullifier.ts +++ b/src/lib/nullifier.ts @@ -5,7 +5,6 @@ import { Poseidon } from './hash.js'; import { MerkleMapWitness } from './merkle-map.js'; import { PrivateKey, PublicKey, scaleShifted } from './signature.js'; import { Provable } from './provable.js'; -import { Bool } from './bool.js'; export { Nullifier }; @@ -71,10 +70,7 @@ class Nullifier extends Struct({ // shifted scalar see https://github.com/o1-labs/o1js/blob/5333817a62890c43ac1b9cb345748984df271b62/src/lib/signature.ts#L220 // pk^c - let pk_c = scaleShifted( - this.publicKey, - Scalar.fromBits(c.toBits().concat(new Bool(false))) - ); + let pk_c = scaleShifted(this.publicKey, Scalar.fromBits(c.toBits())); // g^r = g^s / pk^c let g_r = G.scale(s).sub(pk_c); @@ -84,10 +80,7 @@ class Nullifier extends Struct({ // h_m_pk_r = h(m,pk)^s / nullifier^c let h_m_pk_s_div_nullifier_s = h_m_pk_s.sub( - scaleShifted( - nullifier, - Scalar.fromBits(c.toBits().concat(new Bool(false))) - ) + scaleShifted(nullifier, Scalar.fromBits(c.toBits())) ); // this is supposed to match the entries generated on "the other side" of the nullifier (mina-signer, in an wallet enclave)