mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-01-07 15:43:07 +00:00
22 lines
582 B
Python
22 lines
582 B
Python
from dataclasses import dataclass
|
|
|
|
from noir_constraint import NoirConstraint, NoirProof
|
|
|
|
|
|
@dataclass
|
|
class Bigger:
|
|
"""
|
|
The statement "I know an `x` that is bigger than `y`".
|
|
- `y` is a public parameter provided when the constraint is initialized
|
|
- `x` is a secret parameter provided at proving time
|
|
"""
|
|
|
|
y: int
|
|
_noir = NoirConstraint("bigger")
|
|
|
|
def prove(self, x: int) -> NoirProof:
|
|
return self._noir.prove({"x": str(x), "y": str(self.y)})
|
|
|
|
def verify(self, proof: NoirProof):
|
|
return self._noir.verify({"y": str(self.y)}, proof)
|