Documentation ¶
Index ¶
- type Schnorr
- func (proof *Schnorr) BytesAppend(existing []byte) (data []byte, err error)
- func (proof *Schnorr) Equal(other interface{}) bool
- func (proof *Schnorr) MarshalBinary() (data []byte, err error)
- func (proof *Schnorr) Size() int
- func (proof *Schnorr) UnmarshalBinary(data []byte) error
- func (proof *Schnorr) Verify(partyID party.ID, public *ristretto.Element, context []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Schnorr ¶
type Schnorr struct {
// S = H( ID || CTX || public || M )
// R = k + secret • s
S, R ristretto.Scalar
}
Schnorr is a Non-Interactive Zero-Knowledge proof of knowledge of the discrete logarithm of public = [secret] B
The public parameters are:
partyID: prover's uint32 ID context: 32 byte context string, public: [secret] B
func NewSchnorrProof ¶
func NewSchnorrProof(partyID party.ID, public *ristretto.Element, context []byte, private *ristretto.Scalar) *Schnorr
NewSchnorrProof computes a NIZK proof of knowledge of discrete.
partyID is the uint32 ID of the prover public is the point [private]•B context is a 32 byte context (if it is set to [0 ... 0] then we may be susceptible to replay attacks) private is the discrete log of public
We sample a random Scalar k, and obtain M = [k]•B S := H(ID,CTX,Public,M) R := k + private•S
The proof returned is the tuple (S,R)
func (*Schnorr) BytesAppend ¶
func (*Schnorr) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*Schnorr) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
Click to show internal directories.
Click to hide internal directories.