Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bit fix #821

Merged
merged 2 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nightfall-client/src/classes/commitment.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Commitment {
// we encode the top four bytes of the tokenId into the empty bytes at the top of the erc address.
// this is consistent to what we do in the ZKP circuits
const [top4Bytes, remainder] = this.preimage.tokenId.limbs(224, 2).map(l => BigInt(l));
const SHIFT = 2923003274661805836407369665432566039311865085952n;
const SHIFT = 1461501637330902918203684832716283019655932542976n;
this.hash = poseidon(
generalise([
this.preimage.ercAddress.bigInt + top4Bytes * SHIFT,
Expand Down
4 changes: 2 additions & 2 deletions nightfall-deployer/circuits/deposit.zok
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ from "./common/casts/u32_array_to_field.zok" import main as u32_array_to_field

type Point = field[2]

// 2 ^ 161
const field SHIFT = 2923003274661805836407369665432566039311865085952
// 2 ^ 160
const field SHIFT = 1461501637330902918203684832716283019655932542976

def main(\
field ercContractAddress,\
Expand Down
4 changes: 2 additions & 2 deletions nightfall-deployer/circuits/double_transfer.zok
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ from "./common/merkle-tree/path-check.zok" import main as pathCheck

type Point = field[2]

// 2 ^ 161
const field SHIFT = 2923003274661805836407369665432566039311865085952
// 2 ^ 160
const field SHIFT = 1461501637330902918203684832716283019655932542976

struct OldCommitmentPreimage {
u32[8] id
Expand Down
4 changes: 2 additions & 2 deletions nightfall-deployer/circuits/single_transfer.zok
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ from "./common/casts/u32_array_to_field.zok" import main as u32_array_to_field

type Point = field[2]

// 2 ^ 161
const field SHIFT = 2923003274661805836407369665432566039311865085952
// 2 ^ 160
const field SHIFT = 1461501637330902918203684832716283019655932542976

struct OldCommitmentPreimage {
u32[8] id
Expand Down
4 changes: 2 additions & 2 deletions nightfall-deployer/circuits/withdraw.zok
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ from "./common/casts/u32_array_to_field.zok" import main as u32_array_to_field
from "hashes/poseidon/poseidon.zok" import main as poseidon
from "./common/merkle-tree/path-check.zok" import main as pathCheck

// 2 ^ 161
const field SHIFT = 2923003274661805836407369665432566039311865085952
// 2 ^ 160
const field SHIFT = 1461501637330902918203684832716283019655932542976

struct OldCommitmentPreimage {
field salt
Expand Down