Documentation ¶
Index ¶
- Constants
- type Publickey
- func (p *Publickey) Bytes() []byte
- func (p *Publickey) DecodeMsgpack(dec *msgpack.Decoder) error
- func (p *Publickey) EncodeMsgpack(enc *msgpack.Encoder) error
- func (p *Publickey) MarshalJSON() ([]byte, error)
- func (p *Publickey) UnmarshalJSON(b []byte) error
- func (pk *Publickey) Verify(sig *Signature, message []byte) error
- type Signature
- type SigningKey
- func (s *SigningKey) Bytes() []byte
- func (s *SigningKey) DecodeMsgpack(dec *msgpack.Decoder) error
- func (s *SigningKey) EncodeMsgpack(enc *msgpack.Encoder) error
- func (s *SigningKey) MarshalJSON() ([]byte, error)
- func (sk *SigningKey) PK() *Publickey
- func (sk *SigningKey) Sign(message []byte) (*Signature, error)
- func (s *SigningKey) UnmarshalJSON(b []byte) error
Constants ¶
const ( PKSize = qBits * constN / 8 //512 bytes SKSize = 2 * 2 * constN / 8 //1792 bytes SigSize = ((bBits+1+2)*constN + 11*omega) / 8 //1942 bytes )
Global Constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Publickey ¶
type Publickey struct {
// contains filtered or unexported fields
}
Publickey of glyph signature.
func NewPublickey ¶
NewPublickey creates an Publickey from serialized bytes.
func (*Publickey) DecodeMsgpack ¶
DecodeMsgpack unmarshals JSON to Publickey.
func (*Publickey) EncodeMsgpack ¶
EncodeMsgpack marshals Publickey into valid JSON.
func (*Publickey) MarshalJSON ¶
MarshalJSON marshals Publickey into valid JSON.
func (*Publickey) UnmarshalJSON ¶
UnmarshalJSON unmarshals JSON to Publickey.
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
Signature of glyph signature.
func NewSignature ¶
NewSignature creates an sparsePolyST from serialized bytes.
type SigningKey ¶
type SigningKey struct {
// contains filtered or unexported fields
}
SigningKey of glyph signature.
func NewSK ¶
func NewSK(key []byte) *SigningKey
NewSK generates signing key (s1,s2) from the key, stored in physical form. The key must be 32 bytes.
func NewSigningKey ¶
func NewSigningKey(b []byte) (*SigningKey, error)
NewSigningKey creates an SiningKey from serialized bytes.
func (*SigningKey) DecodeMsgpack ¶
func (s *SigningKey) DecodeMsgpack(dec *msgpack.Decoder) error
DecodeMsgpack unmarshals JSON to SigningKey.
func (*SigningKey) EncodeMsgpack ¶
func (s *SigningKey) EncodeMsgpack(enc *msgpack.Encoder) error
EncodeMsgpack marshals SigningKey into valid JSON.
func (*SigningKey) MarshalJSON ¶
func (s *SigningKey) MarshalJSON() ([]byte, error)
MarshalJSON marshals SiningKey into valid JSON.
func (*SigningKey) PK ¶
func (sk *SigningKey) PK() *Publickey
PK takes a signing key stored in physical space and computes the public key in physical space points a1, a2 are stored in FFT space
func (*SigningKey) Sign ¶
func (sk *SigningKey) Sign(message []byte) (*Signature, error)
Sign signs a message as (z,c) where z is a ring elt in physical form, and c is a hash output encoded as a sparse poly
func (*SigningKey) UnmarshalJSON ¶
func (s *SigningKey) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals JSON to SiningKey.