mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-05-02 14:26:06 -04:00
reduce nullifier bits to 31
This commit is contained in:
parent
e387025992
commit
c7953ae2c6
3 changed files with 16 additions and 16 deletions
|
@ -29,7 +29,7 @@ function generateDeposit() {
|
|||
secret: rbigint(31),
|
||||
nullifier: rbigint(31),
|
||||
}
|
||||
const preimage = Buffer.concat([deposit.nullifier.leInt2Buff(32), deposit.secret.leInt2Buff(32)])
|
||||
const preimage = Buffer.concat([deposit.nullifier.leInt2Buff(31), deposit.secret.leInt2Buff(31)])
|
||||
deposit.commitment = pedersenHash(preimage)
|
||||
return deposit
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ contract('Mixer', accounts => {
|
|||
|
||||
const input = stringifyBigInts({
|
||||
root,
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(31)),
|
||||
nullifier: deposit.nullifier,
|
||||
receiver,
|
||||
fee,
|
||||
|
@ -180,7 +180,7 @@ contract('Mixer', accounts => {
|
|||
const input = stringifyBigInts({
|
||||
// public
|
||||
root,
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(31)),
|
||||
receiver,
|
||||
fee,
|
||||
|
||||
|
@ -228,7 +228,7 @@ contract('Mixer', accounts => {
|
|||
|
||||
const input = stringifyBigInts({
|
||||
root,
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(31)),
|
||||
nullifier: deposit.nullifier,
|
||||
receiver,
|
||||
fee,
|
||||
|
@ -252,7 +252,7 @@ contract('Mixer', accounts => {
|
|||
|
||||
const input = stringifyBigInts({
|
||||
root,
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(31)),
|
||||
nullifier: deposit.nullifier,
|
||||
receiver,
|
||||
fee,
|
||||
|
@ -276,7 +276,7 @@ contract('Mixer', accounts => {
|
|||
const oneEtherFee = bigInt(1e18) // 1 ether
|
||||
const input = stringifyBigInts({
|
||||
root,
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(31)),
|
||||
nullifier: deposit.nullifier,
|
||||
receiver,
|
||||
fee: oneEtherFee,
|
||||
|
@ -299,7 +299,7 @@ contract('Mixer', accounts => {
|
|||
const { root, path_elements, path_index } = await tree.path(0)
|
||||
|
||||
const input = stringifyBigInts({
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(31)),
|
||||
root,
|
||||
nullifier: deposit.nullifier,
|
||||
receiver,
|
||||
|
@ -327,7 +327,7 @@ contract('Mixer', accounts => {
|
|||
|
||||
const input = stringifyBigInts({
|
||||
root,
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(31)),
|
||||
nullifier: deposit.nullifier,
|
||||
receiver,
|
||||
fee,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue