1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/zokrates_stdlib/tests/bench/ecc/proofOfOwnership.code
2019-03-29 08:51:11 +01:00

35 lines
No EOL
1.2 KiB
Text

import "ecc/babyjubjubParams.code" as context
import "ecc/proofOfOwnership.code" as proofOfOwnership
import "ecc/edwardsScalarMult.code" as multiply
import "utils/pack/unpack256.code" as unpack256
// Code to create test cases:
// https://github.com/Zokrates/pycrypto
def testOwnershipTrue() -> (field):
context = context()
field[2] G = [context[4], context[5]]
field[2] Pk = [14897476871502190904409029696666322856887678969656209656241038339251270171395, 16668832459046858928951622951481252834155254151733002984053501254009901876174]
field sk = 1997011358982923168928344992199991480689546837621580239342656433234255379025
field out = proofOfOwnership(Pk, sk, context)
out == 1
return 1
def testtOwnershipFalse() -> (field):
context = context()
field[2] Pk = [16328093915569409528980874702678312730273137210288183490878184636452430630129, 9377227749598842756429258362864743065769435972445705966557343775367597326529]
field sk = 1997011358982923168928344992199991480689546837621580239342656433234255379025
field out = proofOfOwnership(Pk, sk, context)
out == 0
return 1
def main() -> (field):
1 == testOwnershipTrue()
1 == testtOwnershipFalse()
return 1