diff options
Diffstat (limited to 'commitment/commitment.go')
-rw-r--r-- | commitment/commitment.go | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/commitment/commitment.go b/commitment/commitment.go index 31de03a..c958987 100644 --- a/commitment/commitment.go +++ b/commitment/commitment.go @@ -3,6 +3,8 @@ package commitment import ( + "fmt" + "kesim.org/seal/curve" ) @@ -21,30 +23,37 @@ type Bidder struct { 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 { - id *Scalar - v bool - x *Scalar - r *Scalar - e *BitCommitment + set bool + a *Scalar + b *Scalar + com *BitCommitment } type BitCommitment struct { - Id *Point - XRV *Point - X *Point - R *Point + Gab *Point + A *Point + B *Point Proofs struct { - X *Proof - R *Proof + A *Proof + B *Proof } } type Proof struct { - PV *Point `json:"V"` - Sr *Scalar `json:"r"` + 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") +}
\ No newline at end of file |