// Implements the data structures and methods for // creating a commitment for the SEAL protocol package commitment import ( "fmt" "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 n uint8 // number of bits encoded in zbid. bits []Bit // derived from zbid } type Bit struct { set bool a *Scalar b *Scalar com *BitCommitment } type BitCommitment struct { Gab *Point A *Point B *Point Proofs struct { A *Proof B *Proof } } type Proof struct { V *Point `json:"V"` R *Scalar `json:"r"` } func NewBid(price uint64, bitlength uint8) (*Bidder, error) { if bitlength > 63 { return nil, fmt.Errorf("bitlength too large, maximum is 63") } return nil, fmt.Errorf("NewBid not implemented") }