Documentation ¶
Index ¶
- Variables
- func Dec(c *Ciphertext, r2 []int32) []byte
- type Ciphertext
- func (ct *Ciphertext) Add(ct2 *Ciphertext) *Ciphertext
- func (*Ciphertext) Descriptor() ([]byte, []int)
- func (this *Ciphertext) Equal(that interface{}) bool
- func (m *Ciphertext) Marshal() (dAtA []byte, err error)
- func (m *Ciphertext) MarshalTo(dAtA []byte) (int, error)
- func (*Ciphertext) ProtoMessage()
- func (m *Ciphertext) Reset()
- func (m *Ciphertext) Size() (n int)
- func (m *Ciphertext) String() string
- func (m *Ciphertext) Unmarshal(dAtA []byte) error
- func (m *Ciphertext) XXX_DiscardUnknown()
- func (m *Ciphertext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Ciphertext) XXX_Merge(src proto.Message)
- func (m *Ciphertext) XXX_Size() int
- func (m *Ciphertext) XXX_Unmarshal(b []byte) error
- type EncKeyPair
- func (*EncKeyPair) Descriptor() ([]byte, []int)
- func (this *EncKeyPair) Equal(that interface{}) bool
- func (m *EncKeyPair) Marshal() (dAtA []byte, err error)
- func (m *EncKeyPair) MarshalTo(dAtA []byte) (int, error)
- func (*EncKeyPair) ProtoMessage()
- func (m *EncKeyPair) Reset()
- func (m *EncKeyPair) Size() (n int)
- func (m *EncKeyPair) String() string
- func (m *EncKeyPair) Unmarshal(dAtA []byte) error
- func (m *EncKeyPair) XXX_DiscardUnknown()
- func (m *EncKeyPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *EncKeyPair) XXX_Merge(src proto.Message)
- func (m *EncKeyPair) XXX_Size() int
- func (m *EncKeyPair) XXX_Unmarshal(b []byte) error
- type Kind
- type ParamT
- type PrivateKeyT
- func (*PrivateKeyT) Descriptor() ([]byte, []int)
- func (this *PrivateKeyT) Equal(that interface{}) bool
- func (m *PrivateKeyT) Marshal() (dAtA []byte, err error)
- func (m *PrivateKeyT) MarshalTo(dAtA []byte) (int, error)
- func (*PrivateKeyT) ProtoMessage()
- func (pk *PrivateKeyT) PublicKey() *PublicKeyT
- func (m *PrivateKeyT) Reset()
- func (pk *PrivateKeyT) Sign(msg []byte) *SignatureT
- func (m *PrivateKeyT) Size() (n int)
- func (m *PrivateKeyT) String() string
- func (m *PrivateKeyT) Unmarshal(dAtA []byte) error
- func (m *PrivateKeyT) XXX_DiscardUnknown()
- func (m *PrivateKeyT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PrivateKeyT) XXX_Merge(src proto.Message)
- func (m *PrivateKeyT) XXX_Size() int
- func (m *PrivateKeyT) XXX_Unmarshal(b []byte) error
- type PublicKeyT
- func (p *PublicKeyT) Bytes() []byte
- func (*PublicKeyT) Descriptor() ([]byte, []int)
- func (this *PublicKeyT) Equal(that interface{}) bool
- func (m *PublicKeyT) Marshal() (dAtA []byte, err error)
- func (m *PublicKeyT) MarshalTo(dAtA []byte) (int, error)
- func (*PublicKeyT) ProtoMessage()
- func (m *PublicKeyT) Reset()
- func (m *PublicKeyT) Size() (n int)
- func (m *PublicKeyT) String() string
- func (m *PublicKeyT) Unmarshal(dAtA []byte) error
- func (pub *PublicKeyT) Verify(signature *SignatureT, msg []byte) error
- func (m *PublicKeyT) XXX_DiscardUnknown()
- func (m *PublicKeyT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PublicKeyT) XXX_Merge(src proto.Message)
- func (m *PublicKeyT) XXX_Size() int
- func (m *PublicKeyT) XXX_Unmarshal(b []byte) error
- type SignatureT
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthBliss = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowBliss = fmt.Errorf("proto: integer overflow") )
Functions ¶
Types ¶
type Ciphertext ¶
type Ciphertext struct { C1 []int32 `protobuf:"varint,1,rep,packed,name=c1,proto3" json:"c1,omitempty"` C2 []int32 `protobuf:"varint,2,rep,packed,name=c2,proto3" json:"c2,omitempty"` Len byte `protobuf:"varint,3,opt,name=len,proto3,casttype=byte" json:"len,omitempty"` }
Ciphertext is a ciphertext after encryption.
func Enc ¶
func Enc(pub []int32, m []byte) (*Ciphertext, error)
Enc encrypt a message with public key.
func NewPopulatedCiphertext ¶
func NewPopulatedCiphertext(r randyBliss, easy bool) *Ciphertext
func (*Ciphertext) Add ¶
func (ct *Ciphertext) Add(ct2 *Ciphertext) *Ciphertext
Add calculates a ciphertext when these two plaintexts messages are xor'ed.
func (*Ciphertext) Descriptor ¶
func (*Ciphertext) Descriptor() ([]byte, []int)
func (*Ciphertext) Equal ¶
func (this *Ciphertext) Equal(that interface{}) bool
func (*Ciphertext) Marshal ¶
func (m *Ciphertext) Marshal() (dAtA []byte, err error)
func (*Ciphertext) ProtoMessage ¶
func (*Ciphertext) ProtoMessage()
func (*Ciphertext) Reset ¶
func (m *Ciphertext) Reset()
func (*Ciphertext) Size ¶
func (m *Ciphertext) Size() (n int)
func (*Ciphertext) String ¶
func (m *Ciphertext) String() string
func (*Ciphertext) Unmarshal ¶
func (m *Ciphertext) Unmarshal(dAtA []byte) error
func (*Ciphertext) XXX_DiscardUnknown ¶
func (m *Ciphertext) XXX_DiscardUnknown()
func (*Ciphertext) XXX_Marshal ¶
func (m *Ciphertext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Ciphertext) XXX_Merge ¶
func (dst *Ciphertext) XXX_Merge(src proto.Message)
func (*Ciphertext) XXX_Size ¶
func (m *Ciphertext) XXX_Size() int
func (*Ciphertext) XXX_Unmarshal ¶
func (m *Ciphertext) XXX_Unmarshal(b []byte) error
type EncKeyPair ¶
type EncKeyPair struct { PublicKey []int32 `protobuf:"varint,1,rep,packed,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` PrivateKey []int32 `protobuf:"varint,2,rep,packed,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"` }
EncKeyPair is a public and private key for encrytion.
func EncKeyGen ¶
func EncKeyGen(seed [64]byte) *EncKeyPair
EncKeyGen returns a public / private key pair for encryption.
func NewPopulatedEncKeyPair ¶
func NewPopulatedEncKeyPair(r randyBliss, easy bool) *EncKeyPair
func (*EncKeyPair) Descriptor ¶
func (*EncKeyPair) Descriptor() ([]byte, []int)
func (*EncKeyPair) Equal ¶
func (this *EncKeyPair) Equal(that interface{}) bool
func (*EncKeyPair) Marshal ¶
func (m *EncKeyPair) Marshal() (dAtA []byte, err error)
func (*EncKeyPair) ProtoMessage ¶
func (*EncKeyPair) ProtoMessage()
func (*EncKeyPair) Reset ¶
func (m *EncKeyPair) Reset()
func (*EncKeyPair) Size ¶
func (m *EncKeyPair) Size() (n int)
func (*EncKeyPair) String ¶
func (m *EncKeyPair) String() string
func (*EncKeyPair) Unmarshal ¶
func (m *EncKeyPair) Unmarshal(dAtA []byte) error
func (*EncKeyPair) XXX_DiscardUnknown ¶
func (m *EncKeyPair) XXX_DiscardUnknown()
func (*EncKeyPair) XXX_Marshal ¶
func (m *EncKeyPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EncKeyPair) XXX_Merge ¶
func (dst *EncKeyPair) XXX_Merge(src proto.Message)
func (*EncKeyPair) XXX_Size ¶
func (m *EncKeyPair) XXX_Size() int
func (*EncKeyPair) XXX_Unmarshal ¶
func (m *EncKeyPair) XXX_Unmarshal(b []byte) error
type ParamT ¶
type ParamT struct {
// contains filtered or unexported fields
}
ParamT is a param for each BlissB0~B4
type PrivateKeyT ¶
type PrivateKeyT struct { Kind Kind `protobuf:"varint,1,opt,name=kind,proto3,casttype=Kind" json:"kind,omitempty"` S1 []int32 `protobuf:"varint,2,rep,packed,name=s1,proto3" json:"s1,omitempty"` S2 []int32 `protobuf:"varint,3,rep,packed,name=s2,proto3" json:"s2,omitempty"` A []int32 `protobuf:"varint,4,rep,packed,name=a,proto3" json:"a,omitempty"` }
func NewPopulatedPrivateKeyT ¶
func NewPopulatedPrivateKeyT(r randyBliss, easy bool) *PrivateKeyT
func NewPrivateKey ¶
func NewPrivateKey(kind Kind, seed [64]byte) *PrivateKeyT
NewPrivateKey return a private key for BLISS_B.
func (*PrivateKeyT) Descriptor ¶
func (*PrivateKeyT) Descriptor() ([]byte, []int)
func (*PrivateKeyT) Equal ¶
func (this *PrivateKeyT) Equal(that interface{}) bool
func (*PrivateKeyT) Marshal ¶
func (m *PrivateKeyT) Marshal() (dAtA []byte, err error)
func (*PrivateKeyT) ProtoMessage ¶
func (*PrivateKeyT) ProtoMessage()
func (*PrivateKeyT) PublicKey ¶
func (pk *PrivateKeyT) PublicKey() *PublicKeyT
PublicKey extracs a public key from pk.
func (*PrivateKeyT) Reset ¶
func (m *PrivateKeyT) Reset()
func (*PrivateKeyT) Sign ¶
func (pk *PrivateKeyT) Sign(msg []byte) *SignatureT
Sign signs msg by pk.
func (*PrivateKeyT) Size ¶
func (m *PrivateKeyT) Size() (n int)
func (*PrivateKeyT) String ¶
func (m *PrivateKeyT) String() string
func (*PrivateKeyT) Unmarshal ¶
func (m *PrivateKeyT) Unmarshal(dAtA []byte) error
func (*PrivateKeyT) XXX_DiscardUnknown ¶
func (m *PrivateKeyT) XXX_DiscardUnknown()
func (*PrivateKeyT) XXX_Marshal ¶
func (m *PrivateKeyT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PrivateKeyT) XXX_Merge ¶
func (dst *PrivateKeyT) XXX_Merge(src proto.Message)
func (*PrivateKeyT) XXX_Size ¶
func (m *PrivateKeyT) XXX_Size() int
func (*PrivateKeyT) XXX_Unmarshal ¶
func (m *PrivateKeyT) XXX_Unmarshal(b []byte) error
type PublicKeyT ¶
type PublicKeyT struct { Kind Kind `protobuf:"varint,1,opt,name=kind,proto3,casttype=Kind" json:"kind,omitempty"` A []int32 `protobuf:"varint,2,rep,packed,name=a,proto3" json:"a,omitempty"` }
func NewPopulatedPublicKeyT ¶
func NewPopulatedPublicKeyT(r randyBliss, easy bool) *PublicKeyT
func NewPublicKey ¶
func NewPublicKey(b []byte) (*PublicKeyT, error)
NewPublicKey creates an Publickey from serialized bytes.
func (*PublicKeyT) Descriptor ¶
func (*PublicKeyT) Descriptor() ([]byte, []int)
func (*PublicKeyT) Equal ¶
func (this *PublicKeyT) Equal(that interface{}) bool
func (*PublicKeyT) Marshal ¶
func (m *PublicKeyT) Marshal() (dAtA []byte, err error)
func (*PublicKeyT) ProtoMessage ¶
func (*PublicKeyT) ProtoMessage()
func (*PublicKeyT) Reset ¶
func (m *PublicKeyT) Reset()
func (*PublicKeyT) Size ¶
func (m *PublicKeyT) Size() (n int)
func (*PublicKeyT) String ¶
func (m *PublicKeyT) String() string
func (*PublicKeyT) Unmarshal ¶
func (m *PublicKeyT) Unmarshal(dAtA []byte) error
func (*PublicKeyT) Verify ¶
func (pub *PublicKeyT) Verify(signature *SignatureT, msg []byte) error
Verify verifies signature with pub.
func (*PublicKeyT) XXX_DiscardUnknown ¶
func (m *PublicKeyT) XXX_DiscardUnknown()
func (*PublicKeyT) XXX_Marshal ¶
func (m *PublicKeyT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PublicKeyT) XXX_Merge ¶
func (dst *PublicKeyT) XXX_Merge(src proto.Message)
func (*PublicKeyT) XXX_Size ¶
func (m *PublicKeyT) XXX_Size() int
func (*PublicKeyT) XXX_Unmarshal ¶
func (m *PublicKeyT) XXX_Unmarshal(b []byte) error
type SignatureT ¶
type SignatureT struct {
// contains filtered or unexported fields
}
SignatureT is a signature of BLISS-B.
func NewSignature ¶
func NewSignature(b []byte) (*SignatureT, error)
NewSignature creates an SiningKey from serialized bytes.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.