Versions in this module Expand all Collapse all v0 v0.8.2 Jun 11, 2019 Changes in this version + var ErrBlindSignParams = errors.New("too many attributes to sign") + var ErrBlindSignProof = errors.New("failed to verify the proof") + var ErrConstructSignerAttrs = errors.New("more than specified number of attributes provided") + var ErrConstructSignerCiphertexts = errors.New("invalid ciphertexts provided") + var ErrKeygenParams = errors.New("can't generate keys for less than 1 attribute") + var ErrPrepareBlindSignParams = errors.New("too many attributes to sign") + var ErrPrepareBlindSignPrivate = errors.New("no private attributes to sign") + var ErrSetupParams = errors.New("can't generate params for less than 1 attribute") + var ErrShowBlindAttr = errors.New("invalid attributes provided") + var ErrSignParams = errors.New("invalid attributes/secret key provided") + var ErrTTPKeygenParams = errors.New("invalid set of parameters provided to keygen") + func BigSliceFromByteSlices(b [][]byte) ([]*Curve.BIG, error) + func BigSliceToByteSlices(s []*Curve.BIG) ([][]byte, error) + func BlindVerify(params *Params, vk *VerificationKey, sig *Signature, theta *Theta, ...) bool + func BlindVerifyTumbler(params *Params, vk *VerificationKey, sig *Signature, theta *ThetaTumbler, ...) bool + func CompressedBytesToECPSlice(b []byte) []*Curve.ECP + func ConstructChallenge(elems []utils.Printable) (*Curve.BIG, error) + func ConstructKappaNu(vk *VerificationKey, sig *Signature, privM []*Curve.BIG, t *Curve.BIG) (*Curve.ECP2, *Curve.ECP, error) + func CreateBinding(seq []byte) (*Curve.ECP, error) + func CreateWitnessResponses(p *Curve.BIG, ws []*Curve.BIG, c *Curve.BIG, xs []*Curve.BIG) []*Curve.BIG + func ECPSliceToCompressedBytes(s []*Curve.ECP) []byte + func GetRandomNums(params *Params, n int) []*Curve.BIG + func Keygen(params *Params) (*SecretKey, *VerificationKey, error) + func PairingWrapper(g1 *Curve.ECP, g2 *Curve.ECP2) *Curve.FP12 + func TTPKeygen(params *Params, t int, n int) ([]*ThresholdSecretKey, []*ThresholdVerificationKey, error) + func ValidateBigSlice(s []*Curve.BIG) bool + func ValidateKeyPair(sk *SecretKey, vk *VerificationKey) bool + func Verify(params *Params, vk *VerificationKey, pubM []*Curve.BIG, sig *Signature) bool + func VerifySignerProof(params *Params, gamma *Curve.ECP, signMats *Lambda) bool + func VerifyTumblerProof(params *Params, vk *VerificationKey, sig *Signature, theta *ThetaTumbler, ...) bool + func VerifyVerifierProof(params *Params, vk *VerificationKey, sig *Signature, theta *Theta) bool + type BlindSignMaterials struct + func NewBlindSignMaterials(lambda *Lambda, egPub *elgamal.PublicKey, pubM []*Curve.BIG) *BlindSignMaterials + func (bsm *BlindSignMaterials) EgPub() *elgamal.PublicKey + func (bsm *BlindSignMaterials) FromProto(pbsm *ProtoBlindSignMaterials) error + func (bsm *BlindSignMaterials) Lambda() *Lambda + func (bsm *BlindSignMaterials) MarshalBinary() ([]byte, error) + func (bsm *BlindSignMaterials) PubM() []*Curve.BIG + func (bsm *BlindSignMaterials) ToProto() (*ProtoBlindSignMaterials, error) + func (bsm *BlindSignMaterials) UnmarshalBinary(data []byte) error + type BlindedSignature struct + func BlindSign(params *Params, sk *SecretKey, lambda *Lambda, egPub *elgamal.PublicKey, ...) (*BlindedSignature, error) + func NewBlindedSignature(sig1 *Curve.ECP, sig2Tilda *elgamal.Encryption) *BlindedSignature + func (bs *BlindedSignature) FromProto(pbs *ProtoBlindedSignature) error + func (bs *BlindedSignature) MarshalBinary() ([]byte, error) + func (bs *BlindedSignature) Sig1() *Curve.ECP + func (bs *BlindedSignature) Sig2Tilda() *elgamal.Encryption + func (bs *BlindedSignature) ToProto() (*ProtoBlindedSignature, error) + func (bs *BlindedSignature) UnmarshalBinary(data []byte) error + func (bs *BlindedSignature) Validate() bool + type Lambda struct + func NewLambda(cm *Curve.ECP, enc []*elgamal.Encryption, proof *SignerProof) *Lambda + func PrepareBlindSign(params *Params, egPub *elgamal.PublicKey, pubM []*Curve.BIG, ...) (*Lambda, error) + func (l *Lambda) Cm() *Curve.ECP + func (l *Lambda) Enc() []*elgamal.Encryption + func (l *Lambda) Proof() *SignerProof + func (l *Lambda) Validate() bool + func (lambda *Lambda) FromProto(protoLambda *ProtoLambda) error + func (lambda *Lambda) MarshalBinary() ([]byte, error) + func (lambda *Lambda) ToProto() (*ProtoLambda, error) + func (lambda *Lambda) UnmarshalBinary(data []byte) error + type Params struct + G *bpgroup.BpGroup + func NewParams(G *bpgroup.BpGroup, p *Curve.BIG, g1 *Curve.ECP, g2 *Curve.ECP2, ...) *Params + func Setup(q int) (*Params, error) + func (p *Params) G1() *Curve.ECP + func (p *Params) G2() *Curve.ECP2 + func (p *Params) Hs() []*Curve.ECP + func (p *Params) P() *Curve.BIG + func (p *Params) Validate() bool + func (params *Params) FromProto(pp *ProtoParams) error + func (params *Params) MarshalBinary() ([]byte, error) + func (params *Params) ToProto() (*ProtoParams, error) + func (params *Params) UnmarshalBinary(data []byte) error + type PolynomialPoints struct + func NewPP(xs []*Curve.BIG) *PolynomialPoints + func (pp *PolynomialPoints) Validate() bool + func (pp *PolynomialPoints) Xs() []*Curve.BIG + type ProtoBlindSignMaterials struct + EgPub *elgamal.ProtoPublicKey + Lambda *ProtoLambda + PubM [][]byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ProtoBlindSignMaterials) Descriptor() ([]byte, []int) + func (*ProtoBlindSignMaterials) ProtoMessage() + func (m *ProtoBlindSignMaterials) GetEgPub() *elgamal.ProtoPublicKey + func (m *ProtoBlindSignMaterials) GetLambda() *ProtoLambda + func (m *ProtoBlindSignMaterials) GetPubM() [][]byte + func (m *ProtoBlindSignMaterials) Reset() + func (m *ProtoBlindSignMaterials) String() string + func (m *ProtoBlindSignMaterials) XXX_DiscardUnknown() + func (m *ProtoBlindSignMaterials) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtoBlindSignMaterials) XXX_Merge(src proto.Message) + func (m *ProtoBlindSignMaterials) XXX_Size() int + func (m *ProtoBlindSignMaterials) XXX_Unmarshal(b []byte) error + func (pbsm *ProtoBlindSignMaterials) OneWayToBytes() ([]byte, error) + type ProtoBlindedSignature struct + Sig1 []byte + Sig2Tilda *elgamal.ProtoEncryption + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ProtoBlindedSignature) Descriptor() ([]byte, []int) + func (*ProtoBlindedSignature) ProtoMessage() + func (m *ProtoBlindedSignature) GetSig1() []byte + func (m *ProtoBlindedSignature) GetSig2Tilda() *elgamal.ProtoEncryption + func (m *ProtoBlindedSignature) Reset() + func (m *ProtoBlindedSignature) String() string + func (m *ProtoBlindedSignature) XXX_DiscardUnknown() + func (m *ProtoBlindedSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtoBlindedSignature) XXX_Merge(src proto.Message) + func (m *ProtoBlindedSignature) XXX_Size() int + func (m *ProtoBlindedSignature) XXX_Unmarshal(b []byte) error + type ProtoLambda struct + Cm []byte + Enc []*elgamal.ProtoEncryption + Proof *ProtoSignerProof + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ProtoLambda) Descriptor() ([]byte, []int) + func (*ProtoLambda) ProtoMessage() + func (m *ProtoLambda) GetCm() []byte + func (m *ProtoLambda) GetEnc() []*elgamal.ProtoEncryption + func (m *ProtoLambda) GetProof() *ProtoSignerProof + func (m *ProtoLambda) Reset() + func (m *ProtoLambda) String() string + func (m *ProtoLambda) XXX_DiscardUnknown() + func (m *ProtoLambda) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtoLambda) XXX_Merge(src proto.Message) + func (m *ProtoLambda) XXX_Size() int + func (m *ProtoLambda) XXX_Unmarshal(b []byte) error + type ProtoParams struct + G1 []byte + G2 []byte + Hs [][]byte + P []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ProtoParams) Descriptor() ([]byte, []int) + func (*ProtoParams) ProtoMessage() + func (m *ProtoParams) GetG1() []byte + func (m *ProtoParams) GetG2() []byte + func (m *ProtoParams) GetHs() [][]byte + func (m *ProtoParams) GetP() []byte + func (m *ProtoParams) Reset() + func (m *ProtoParams) String() string + func (m *ProtoParams) XXX_DiscardUnknown() + func (m *ProtoParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtoParams) XXX_Merge(src proto.Message) + func (m *ProtoParams) XXX_Size() int + func (m *ProtoParams) XXX_Unmarshal(b []byte) error + type ProtoSecretKey struct + X []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + Y [][]byte + func (*ProtoSecretKey) Descriptor() ([]byte, []int) + func (*ProtoSecretKey) ProtoMessage() + func (m *ProtoSecretKey) GetX() []byte + func (m *ProtoSecretKey) GetY() [][]byte + func (m *ProtoSecretKey) Reset() + func (m *ProtoSecretKey) String() string + func (m *ProtoSecretKey) XXX_DiscardUnknown() + func (m *ProtoSecretKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtoSecretKey) XXX_Merge(src proto.Message) + func (m *ProtoSecretKey) XXX_Size() int + func (m *ProtoSecretKey) XXX_Unmarshal(b []byte) error + type ProtoSignature struct + Sig1 []byte + Sig2 []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ProtoSignature) Descriptor() ([]byte, []int) + func (*ProtoSignature) ProtoMessage() + func (m *ProtoSignature) GetSig1() []byte + func (m *ProtoSignature) GetSig2() []byte + func (m *ProtoSignature) Reset() + func (m *ProtoSignature) String() string + func (m *ProtoSignature) XXX_DiscardUnknown() + func (m *ProtoSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtoSignature) XXX_Merge(src proto.Message) + func (m *ProtoSignature) XXX_Size() int + func (m *ProtoSignature) XXX_Unmarshal(b []byte) error + type ProtoSignerProof struct + C []byte + Rk [][]byte + Rm [][]byte + Rr []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ProtoSignerProof) Descriptor() ([]byte, []int) + func (*ProtoSignerProof) ProtoMessage() + func (m *ProtoSignerProof) GetC() []byte + func (m *ProtoSignerProof) GetRk() [][]byte + func (m *ProtoSignerProof) GetRm() [][]byte + func (m *ProtoSignerProof) GetRr() []byte + func (m *ProtoSignerProof) Reset() + func (m *ProtoSignerProof) String() string + func (m *ProtoSignerProof) XXX_DiscardUnknown() + func (m *ProtoSignerProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtoSignerProof) XXX_Merge(src proto.Message) + func (m *ProtoSignerProof) XXX_Size() int + func (m *ProtoSignerProof) XXX_Unmarshal(b []byte) error + type ProtoTheta struct + Kappa []byte + Nu []byte + Proof *ProtoVerifierProof + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ProtoTheta) Descriptor() ([]byte, []int) + func (*ProtoTheta) ProtoMessage() + func (m *ProtoTheta) GetKappa() []byte + func (m *ProtoTheta) GetNu() []byte + func (m *ProtoTheta) GetProof() *ProtoVerifierProof + func (m *ProtoTheta) Reset() + func (m *ProtoTheta) String() string + func (m *ProtoTheta) XXX_DiscardUnknown() + func (m *ProtoTheta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtoTheta) XXX_Merge(src proto.Message) + func (m *ProtoTheta) XXX_Size() int + func (m *ProtoTheta) XXX_Unmarshal(b []byte) error + type ProtoThetaTumbler struct + Theta *ProtoTheta + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + Zeta []byte + func (*ProtoThetaTumbler) Descriptor() ([]byte, []int) + func (*ProtoThetaTumbler) ProtoMessage() + func (m *ProtoThetaTumbler) GetTheta() *ProtoTheta + func (m *ProtoThetaTumbler) GetZeta() []byte + func (m *ProtoThetaTumbler) Reset() + func (m *ProtoThetaTumbler) String() string + func (m *ProtoThetaTumbler) XXX_DiscardUnknown() + func (m *ProtoThetaTumbler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtoThetaTumbler) XXX_Merge(src proto.Message) + func (m *ProtoThetaTumbler) XXX_Size() int + func (m *ProtoThetaTumbler) XXX_Unmarshal(b []byte) error + type ProtoVerificationKey struct + Alpha []byte + Beta [][]byte + G2 []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ProtoVerificationKey) Descriptor() ([]byte, []int) + func (*ProtoVerificationKey) ProtoMessage() + func (m *ProtoVerificationKey) GetAlpha() []byte + func (m *ProtoVerificationKey) GetBeta() [][]byte + func (m *ProtoVerificationKey) GetG2() []byte + func (m *ProtoVerificationKey) Reset() + func (m *ProtoVerificationKey) String() string + func (m *ProtoVerificationKey) XXX_DiscardUnknown() + func (m *ProtoVerificationKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtoVerificationKey) XXX_Merge(src proto.Message) + func (m *ProtoVerificationKey) XXX_Size() int + func (m *ProtoVerificationKey) XXX_Unmarshal(b []byte) error + type ProtoVerifierProof struct + C []byte + Rm [][]byte + Rt []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*ProtoVerifierProof) Descriptor() ([]byte, []int) + func (*ProtoVerifierProof) ProtoMessage() + func (m *ProtoVerifierProof) GetC() []byte + func (m *ProtoVerifierProof) GetRm() [][]byte + func (m *ProtoVerifierProof) GetRt() []byte + func (m *ProtoVerifierProof) Reset() + func (m *ProtoVerifierProof) String() string + func (m *ProtoVerifierProof) XXX_DiscardUnknown() + func (m *ProtoVerifierProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *ProtoVerifierProof) XXX_Merge(src proto.Message) + func (m *ProtoVerifierProof) XXX_Size() int + func (m *ProtoVerifierProof) XXX_Unmarshal(b []byte) error + type SchemeParams interface + G1 func() *Curve.ECP + G2 func() *Curve.ECP2 + Hs func() []*Curve.ECP + P func() *Curve.BIG + type SecretKey struct + func NewSk(x *Curve.BIG, y []*Curve.BIG) *SecretKey + func (sk *SecretKey) FromPEMFile(f string) error + func (sk *SecretKey) FromProto(psk *ProtoSecretKey) error + func (sk *SecretKey) MarshalBinary() ([]byte, error) + func (sk *SecretKey) ToPEMFile(f string) error + func (sk *SecretKey) ToProto() (*ProtoSecretKey, error) + func (sk *SecretKey) UnmarshalBinary(data []byte) error + func (sk *SecretKey) Validate() bool + func (sk *SecretKey) X() *Curve.BIG + func (sk *SecretKey) Y() []*Curve.BIG + type Signature struct + func AggregateSignatures(params *Params, sigs []*Signature, pp *PolynomialPoints) *Signature + func NewSignature(sig1 *Curve.ECP, sig2 *Curve.ECP) *Signature + func Randomize(params *Params, sig *Signature) *Signature + func Sign(params *Params, sk *SecretKey, pubM []*Curve.BIG) (*Signature, error) + func Unblind(params *Params, blindedSignature *BlindedSignature, egPub *elgamal.PrivateKey) *Signature + func (s *Signature) Sig1() *Curve.ECP + func (s *Signature) Sig2() *Curve.ECP + func (s *Signature) Validate() bool + func (sig *Signature) FromProto(psig *ProtoSignature) error + func (sig *Signature) MarshalBinary() ([]byte, error) + func (sig *Signature) ToProto() (*ProtoSignature, error) + func (sig *Signature) UnmarshalBinary(data []byte) error + type SignerProof struct + func ConstructSignerProof(params *Params, gamma *Curve.ECP, encs []*elgamal.Encryption, cm *Curve.ECP, ...) (*SignerProof, error) + func NewSignerProof(c *Curve.BIG, rr *Curve.BIG, rk []*Curve.BIG, rm []*Curve.BIG) *SignerProof + func (sp *SignerProof) C() *Curve.BIG + func (sp *SignerProof) FromProto(psp *ProtoSignerProof) error + func (sp *SignerProof) MarshalBinary() ([]byte, error) + func (sp *SignerProof) Rk() []*Curve.BIG + func (sp *SignerProof) Rm() []*Curve.BIG + func (sp *SignerProof) Rr() *Curve.BIG + func (sp *SignerProof) ToProto() (*ProtoSignerProof, error) + func (sp *SignerProof) UnmarshalBinary(data []byte) error + func (sp *SignerProof) Validate() bool + type Theta struct + func NewTheta(kappa *Curve.ECP2, nu *Curve.ECP, proof *VerifierProof) *Theta + func ShowBlindSignature(params *Params, vk *VerificationKey, sig *Signature, privM []*Curve.BIG) (*Theta, error) + func (t *Theta) Kappa() *Curve.ECP2 + func (t *Theta) Nu() *Curve.ECP + func (t *Theta) Proof() *VerifierProof + func (t *Theta) Validate() bool + func (theta *Theta) FromProto(protoTheta *ProtoTheta) error + func (theta *Theta) MarshalBinary() ([]byte, error) + func (theta *Theta) ToProto() (*ProtoTheta, error) + func (theta *Theta) UnmarshalBinary(data []byte) error + type ThetaTumbler struct + func NewThetaTumbler(theta *Theta, zeta *Curve.ECP) *ThetaTumbler + func ShowBlindSignatureTumbler(params *Params, vk *VerificationKey, sig *Signature, privM []*Curve.BIG, ...) (*ThetaTumbler, error) + func (t *ThetaTumbler) FromProto(protoThetaTumbler *ProtoThetaTumbler) error + func (t *ThetaTumbler) MarshalBinary() ([]byte, error) + func (t *ThetaTumbler) ToProto() (*ProtoThetaTumbler, error) + func (t *ThetaTumbler) UnmarshalBinary(data []byte) error + func (t *ThetaTumbler) Validate() bool + func (t *ThetaTumbler) Zeta() *Curve.ECP + type ThresholdSecretKey struct + func NewThresholdSk(x *Curve.BIG, y []*Curve.BIG, id int64) *ThresholdSecretKey + func (tsk *ThresholdSecretKey) FromPEMFile(f string) error + func (tsk *ThresholdSecretKey) ID() int64 + func (tsk *ThresholdSecretKey) MarshalBinary() ([]byte, error) + func (tsk *ThresholdSecretKey) ToPEMFile(f string) error + func (tsk *ThresholdSecretKey) UnmarshalBinary(data []byte) error + type ThresholdVerificationKey struct + func NewThresholdVk(g2 *Curve.ECP2, alpha *Curve.ECP2, beta []*Curve.ECP2, id int64) *ThresholdVerificationKey + func (tvk *ThresholdVerificationKey) FromPEMFile(f string) error + func (tvk *ThresholdVerificationKey) ID() int64 + func (tvk *ThresholdVerificationKey) MarshalBinary() ([]byte, error) + func (tvk *ThresholdVerificationKey) ToPEMFile(f string) error + func (tvk *ThresholdVerificationKey) UnmarshalBinary(data []byte) error + type TumblerProof struct + func ConstructTumblerProof(params *Params, vk *VerificationKey, sig *Signature, privM []*Curve.BIG, ...) (*TumblerProof, error) + func NewTumblerProof(baseProof *VerifierProof, zeta *Curve.ECP) *TumblerProof + func (tp *TumblerProof) BaseProof() *VerifierProof + func (tp *TumblerProof) Validate() bool + func (tp *TumblerProof) Zeta() *Curve.ECP + type VerificationKey struct + func AggregateVerificationKeys(params *Params, vks []*VerificationKey, pp *PolynomialPoints) *VerificationKey + func NewVk(g2 *Curve.ECP2, alpha *Curve.ECP2, beta []*Curve.ECP2) *VerificationKey + func (vk *VerificationKey) Alpha() *Curve.ECP2 + func (vk *VerificationKey) Beta() []*Curve.ECP2 + func (vk *VerificationKey) FromPEMFile(f string) error + func (vk *VerificationKey) FromProto(pvk *ProtoVerificationKey) error + func (vk *VerificationKey) G2() *Curve.ECP2 + func (vk *VerificationKey) MarshalBinary() ([]byte, error) + func (vk *VerificationKey) ToPEMFile(f string) error + func (vk *VerificationKey) ToProto() (*ProtoVerificationKey, error) + func (vk *VerificationKey) UnmarshalBinary(data []byte) error + func (vk *VerificationKey) Validate() bool + type VerifierProof struct + func ConstructVerifierProof(params *Params, vk *VerificationKey, sig *Signature, privM []*Curve.BIG, ...) (*VerifierProof, error) + func NewVerifierProof(c *Curve.BIG, rm []*Curve.BIG, rt *Curve.BIG) *VerifierProof + func (vp *VerifierProof) C() *Curve.BIG + func (vp *VerifierProof) FromProto(pvp *ProtoVerifierProof) error + func (vp *VerifierProof) MarshalBinary() ([]byte, error) + func (vp *VerifierProof) Rm() []*Curve.BIG + func (vp *VerifierProof) Rt() *Curve.BIG + func (vp *VerifierProof) ToProto() (*ProtoVerifierProof, error) + func (vp *VerifierProof) UnmarshalBinary(data []byte) error + func (vp *VerifierProof) Validate() bool