forked from privacy-scaling-explorations/zk-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(eddsa-proof): update docs and tests
- Loading branch information
1 parent
a988587
commit 34adf20
Showing
8 changed files
with
38 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import { verify as _verify } from "@zk-kit/groth16" | ||
import hash from "./hash" | ||
import { EddsaProof } from "./types" | ||
import unpackProof from "./unpack-proof" | ||
import verificationKey from "./verification-key.json" | ||
import hash from "./hash" | ||
|
||
/** | ||
* Verifies that a Poseidon proof is valid. | ||
* @param eddsaProof The Poseidon zero-knowledge proof. | ||
* Verifies that a Eddsa proof is valid. | ||
* @param eddsaProof The Eddsa zero-knowledge proof. | ||
* @returns True if the proof is valid, false otherwise. | ||
*/ | ||
export default function verify({ scope, commitment, nullifier, proof }: EddsaProof): Promise<boolean> { | ||
export default function verify({ proof, commitment, nullifier, scope }: EddsaProof): Promise<boolean> { | ||
return _verify(verificationKey, { | ||
proof: unpackProof(proof), | ||
publicSignals: [nullifier, commitment, hash(scope)] | ||
publicSignals: [commitment, nullifier, hash(scope)], | ||
proof: unpackProof(proof) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters