Skip to content

Commit

Permalink
Merge pull request #821 from EYBlockchain/westlad/bit-fix
Browse files Browse the repository at this point in the history
bit fix
  • Loading branch information
Ilyas Ridhuan authored Jul 19, 2022
2 parents f8cd130 + e018c41 commit 88eea4d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
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

0 comments on commit 88eea4d

Please sign in to comment.