Skip to content

Commit

Permalink
zkrunner: fix broken witness_gen.py
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfi committed Feb 20, 2025
1 parent 295590a commit 2af96b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/zkrunner/witness_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
This reflects /darkfi/tests/zkvm_opcodes.rs
"""
import json
from darkfi_sdk.pasta import Ep, Fp, Fq, nullifier_k, EpAffine, mod_r_p
from darkfi_sdk.pasta import Ep, Fp, Fq, nullifier_k, EpAffine, fp_mod_fv
from darkfi_sdk.crypto import poseidon_hash, pedersen_commitment_u64
from darkfi_sdk.merkle import MerkleTree

Expand Down Expand Up @@ -56,16 +56,16 @@

# Elliptic curve multiplication
ephem_secret = Fp.random()
pubkey = Ep.from_affine(nullifier_k()) * mod_r_p(ephem_secret)
pubkey = Ep.from_affine(nullifier_k()) * fp_mod_fv(ephem_secret)

ephem_public = pubkey * mod_r_p(ephem_secret)
ephem_public = pubkey * fp_mod_fv(ephem_secret)
ephem_x, ephem_y = EpAffine.from_projective(ephem_public).coordinates()

value_commit = pedersen_commitment_u64(value, value_blind)
value_coords = EpAffine.from_projective(value_commit).coordinates()
d = poseidon_hash([Fp.one(), blind, value_coords[0], value_coords[1]])

public = Ep.from_affine(nullifier_k()) * mod_r_p(secret)
public = Ep.from_affine(nullifier_k()) * fp_mod_fv(secret)
pub_x, pub_y = EpAffine.from_projective(public).coordinates()

# Create the object representing the JSON witnesses file.
Expand Down

0 comments on commit 2af96b9

Please # to comment.