diff options
Diffstat (limited to 'commitment/commitment.go')
-rw-r--r-- | commitment/commitment.go | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/commitment/commitment.go b/commitment/commitment.go new file mode 100644 index 0000000..31de03a --- /dev/null +++ b/commitment/commitment.go @@ -0,0 +1,50 @@ +// Implements the data structures and methods for +// creating a commitment for the SEAL protocol +package commitment + +import ( + "kesim.org/seal/curve" +) + +type Scalar = curve.Curve25519Scalar +type Point = curve.Curve25519Point + +var Curve = curve.Curve25519 + +type Bidder struct { + private struct { + id *Scalar + } + Id *Point +} + +type Bid struct { + Bidder *Point + zbid uint64 // bigendian encoding of the bid + bits []Bit // derived from zbid +} + +type Bit struct { + id *Scalar + v bool + x *Scalar + r *Scalar + e *BitCommitment +} + +type BitCommitment struct { + Id *Point + XRV *Point + X *Point + R *Point + + Proofs struct { + X *Proof + R *Proof + } +} + +type Proof struct { + PV *Point `json:"V"` + Sr *Scalar `json:"r"` +} |