Closed Mahsa-Bastankhah closed 5 years ago
It is true that the operation x>y is not supported. Pleas refer to the documentation in runtime.py to see what operations you can perform on pysnark Vars.
What you can do for example is (x-y-1).assert_positive(BL) in order to assert that x-y-1>=0 or equivalently, x>y, where BL is a constant maximum bit length that you know the value x-y-1 will have.
If you don't know whether x will be smaller than y and want to store the result obliviously in a pysnark Var, that should be possible in verifiable computation as well but I would need to think a bit how that is best done. I don't think the runtime currently supports it.
This is now supported, see https://github.com/Charterhouse/pysnark/blob/master/examples/compare.py
hi. I tried to compare two integer and report the maximum and then prove to the verifier that the value I'm reporting is maximum of two integers.but I figured out that Var variables don't support comparing.in another word following code does't print True when a = 10 and b = 5 a = int(input()) b = int(input()) x = Var(a,"in1") y = Var(b,"in2") print x > y