Last active
December 18, 2021 11:16
-
-
Save stefandeml/7521446196b3663f53120b3f26399c53 to your computer and use it in GitHub Desktop.
ZoKrates Identity-linked Proof of Knowledge
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
import "ecc/babyjubjubParams.code" as context | |
import "ecc/proofOfOwnership.code" as proofOfOwnership | |
import "hashes/sha256/512bitPacked.code" as sha256packed | |
def hash(private field[4] secret) -> (field[2]): | |
return sha256packed(secret) | |
def main(field[2] pkA, private field[4] secret, private field skA) -> (field[2]): | |
// load BabyJubJub context | |
context = context() | |
// prove ownership of skA | |
proofOfOwnership(pkA, skA, context) == 1 | |
// return hash | |
return hash(secret) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment