Versions in this module Expand all Collapse all v1 v1.999.0 Nov 17, 2022 Changes in this version + type KeyGenStub struct + CheckPublicKeyValidStub func(b []byte) error + GeneratePairStub func() (crypto.PrivateKey, crypto.PublicKey) + PrivateKeyFromByteArrayStub func(b []byte) (crypto.PrivateKey, error) + PublicKeyFromByteArrayStub func(b []byte) (crypto.PublicKey, error) + SuiteStub func() crypto.Suite + func (keyGen *KeyGenStub) CheckPublicKeyValid(b []byte) error + func (keyGen *KeyGenStub) GeneratePair() (crypto.PrivateKey, crypto.PublicKey) + func (keyGen *KeyGenStub) IsInterfaceNil() bool + func (keyGen *KeyGenStub) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error) + func (keyGen *KeyGenStub) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error) + func (keyGen *KeyGenStub) Suite() crypto.Suite + type MultisignerMock struct + AggregateSigsCalled func(bitmap []byte) ([]byte, error) + CommitmentHashCalled func(index uint16) ([]byte, error) + CreateAndAddSignatureShareForKeyCalled func(message []byte, privateKey crypto.PrivateKey, pubKeyBytes []byte) ([]byte, error) + CreateCalled func(pubKeys []string, index uint16) (crypto.MultiSigner, error) + CreateSignatureShareCalled func(msg []byte, bitmap []byte) ([]byte, error) + ResetCalled func(pubKeys []string, index uint16) error + SignatureShareCalled func(index uint16) ([]byte, error) + StoreSignatureShareCalled func(index uint16, sig []byte) error + VerifyCalled func(msg []byte, bitmap []byte) error + VerifySignatureShareCalled func(index uint16, sig []byte, msg []byte, bitmap []byte) error + func NewMultiSigner(consensusSize uint32) *MultisignerMock + func (mm *MultisignerMock) AggregateSigs(bitmap []byte) ([]byte, error) + func (mm *MultisignerMock) Create(pubKeys []string, index uint16) (crypto.MultiSigner, error) + func (mm *MultisignerMock) CreateAndAddSignatureShareForKey(message []byte, privateKey crypto.PrivateKey, pubKeyBytes []byte) ([]byte, error) + func (mm *MultisignerMock) CreateSignatureShare(msg []byte, bitmap []byte) ([]byte, error) + func (mm *MultisignerMock) IsInterfaceNil() bool + func (mm *MultisignerMock) Reset(pubKeys []string, index uint16) error + func (mm *MultisignerMock) SetAggregatedSig(aggSig []byte) error + func (mm *MultisignerMock) SignatureShare(index uint16) ([]byte, error) + func (mm *MultisignerMock) StoreSignatureShare(index uint16, sig []byte) error + func (mm *MultisignerMock) Verify(msg []byte, bitmap []byte) error + func (mm *MultisignerMock) VerifySignatureShare(index uint16, sig []byte, msg []byte, bitmap []byte) error + type MultisignerStub struct + AggregateSigsCalled func(bitmap []byte) ([]byte, error) + CreateAndAddSignatureShareForKeyCalled func(message []byte, privateKey crypto.PrivateKey, pubKeyBytes []byte) ([]byte, error) + CreateCalled func(pubKeys []string, index uint16) (crypto.MultiSigner, error) + CreateSignatureShareCalled func(msg []byte, bitmap []byte) ([]byte, error) + ResetCalled func(pubKeys []string, index uint16) error + SetAggregatedSigCalled func(bytes []byte) error + SignatureShareCalled func(index uint16) ([]byte, error) + StoreSignatureShareCalled func(index uint16, sig []byte) error + VerifyCalled func(msg []byte, bitmap []byte) error + VerifySignatureShareCalled func(index uint16, sig []byte, msg []byte, bitmap []byte) error + func (mss *MultisignerStub) AggregateSigs(bitmap []byte) ([]byte, error) + func (mss *MultisignerStub) Create(pubKeys []string, index uint16) (crypto.MultiSigner, error) + func (mss *MultisignerStub) CreateAndAddSignatureShareForKey(message []byte, privateKey crypto.PrivateKey, pubKeyBytes []byte) ([]byte, error) + func (mss *MultisignerStub) CreateSignatureShare(msg []byte, bitmap []byte) ([]byte, error) + func (mss *MultisignerStub) IsInterfaceNil() bool + func (mss *MultisignerStub) Reset(pubKeys []string, index uint16) error + func (mss *MultisignerStub) SetAggregatedSig(bytes []byte) error + func (mss *MultisignerStub) SignatureShare(index uint16) ([]byte, error) + func (mss *MultisignerStub) StoreSignatureShare(index uint16, sig []byte) error + func (mss *MultisignerStub) Verify(msg []byte, bitmap []byte) error + func (mss *MultisignerStub) VerifySignatureShare(index uint16, sig []byte, msg []byte, bitmap []byte) error + type PeerSignatureHandlerStub struct + GetPeerSignatureCalled func(key crypto.PrivateKey, pid []byte) ([]byte, error) + VerifyPeerSignatureCalled func(pk []byte, pid core.PeerID, signature []byte) error + func (pshs *PeerSignatureHandlerStub) GetPeerSignature(key crypto.PrivateKey, pid []byte) ([]byte, error) + func (pshs *PeerSignatureHandlerStub) IsInterfaceNil() bool + func (pshs *PeerSignatureHandlerStub) VerifyPeerSignature(pk []byte, pid core.PeerID, signature []byte) error + type PointMock struct + GetUnderlyingObjStub func() interface{} + MarshalBinaryStub func(x, y int) ([]byte, error) + UnmarshalBinaryStub func([]byte) (x, y int, err error) + X int + Y int + func (po *PointMock) Add(_ crypto.Point) (crypto.Point, error) + func (po *PointMock) Base() crypto.Point + func (po *PointMock) Clone() crypto.Point + func (po *PointMock) Equal(p crypto.Point) (bool, error) + func (po *PointMock) GetUnderlyingObj() interface{} + func (po *PointMock) IsInterfaceNil() bool + func (po *PointMock) MarshalBinary() ([]byte, error) + func (po *PointMock) Mul(s crypto.Scalar) (crypto.Point, error) + func (po *PointMock) Neg() crypto.Point + func (po *PointMock) Null() crypto.Point + func (po *PointMock) Pick() (crypto.Point, error) + func (po *PointMock) Set(_ crypto.Point) error + func (po *PointMock) Sub(_ crypto.Point) (crypto.Point, error) + func (po *PointMock) UnmarshalBinary(point []byte) error + type PrivateKeyStub struct + GeneratePublicStub func() crypto.PublicKey + ScalarStub func() crypto.Scalar + SuiteStub func() crypto.Suite + ToByteArrayStub func() ([]byte, error) + func (privKey *PrivateKeyStub) GeneratePublic() crypto.PublicKey + func (privKey *PrivateKeyStub) IsInterfaceNil() bool + func (privKey *PrivateKeyStub) Scalar() crypto.Scalar + func (privKey *PrivateKeyStub) Suite() crypto.Suite + func (privKey *PrivateKeyStub) ToByteArray() ([]byte, error) + type PublicKeyStub struct + PointStub func() crypto.Point + SuiteStub func() crypto.Suite + ToByteArrayStub func() ([]byte, error) + func (pubKey *PublicKeyStub) IsInterfaceNil() bool + func (pubKey *PublicKeyStub) Point() crypto.Point + func (pubKey *PublicKeyStub) Suite() crypto.Suite + func (pubKey *PublicKeyStub) ToByteArray() ([]byte, error) + type ScalarMock struct + GetUnderlyingObjStub func() interface{} + MarshalBinaryStub func(x int) ([]byte, error) + UnmarshalBinaryStub func([]byte) (int, error) + X int + func (sm *ScalarMock) Add(_ crypto.Scalar) (crypto.Scalar, error) + func (sm *ScalarMock) Clone() crypto.Scalar + func (sm *ScalarMock) Div(_ crypto.Scalar) (crypto.Scalar, error) + func (sm *ScalarMock) Equal(_ crypto.Scalar) (bool, error) + func (sm *ScalarMock) GetUnderlyingObj() interface{} + func (sm *ScalarMock) Inv(_ crypto.Scalar) (crypto.Scalar, error) + func (sm *ScalarMock) IsInterfaceNil() bool + func (sm *ScalarMock) MarshalBinary() ([]byte, error) + func (sm *ScalarMock) Mul(_ crypto.Scalar) (crypto.Scalar, error) + func (sm *ScalarMock) Neg() crypto.Scalar + func (sm *ScalarMock) One() crypto.Scalar + func (sm *ScalarMock) Pick() (crypto.Scalar, error) + func (sm *ScalarMock) Set(_ crypto.Scalar) error + func (sm *ScalarMock) SetBytes([]byte) (crypto.Scalar, error) + func (sm *ScalarMock) SetInt64(_ int64) + func (sm *ScalarMock) Sub(_ crypto.Scalar) (crypto.Scalar, error) + func (sm *ScalarMock) UnmarshalBinary(val []byte) error + func (sm *ScalarMock) Zero() crypto.Scalar + type SignerStub struct + SignCalled func(private crypto.PrivateKey, msg []byte) ([]byte, error) + VerifyCalled func(public crypto.PublicKey, msg []byte, sig []byte) error + func (s *SignerStub) IsInterfaceNil() bool + func (s *SignerStub) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error) + func (s *SignerStub) Verify(public crypto.PublicKey, msg []byte, sig []byte) error + type SingleSignerStub struct + SignCalled func(private crypto.PrivateKey, msg []byte) ([]byte, error) + VerifyCalled func(public crypto.PublicKey, msg []byte, sig []byte) error + func (s *SingleSignerStub) IsInterfaceNil() bool + func (s *SingleSignerStub) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error) + func (s *SingleSignerStub) Verify(public crypto.PublicKey, msg []byte, sig []byte) error + type Streamer struct + func NewStreamer() *Streamer + func (stream *Streamer) XORKeyStream(dst, src []byte) + type SuiteMock struct + CreateKeyPairStub func() (crypto.Scalar, crypto.Point) + CreatePointForScalarStub func(scalar crypto.Scalar) (crypto.Point, error) + CreatePointStub func() crypto.Point + CreateScalarStub func() crypto.Scalar + GetUnderlyingSuiteStub func() interface{} + IsPointValidStub func([]byte) error + PointLenStub func() int + RandomStreamStub func() cipher.Stream + ScalarLenStub func() int + StringStub func() string + func (s *SuiteMock) CheckPointValid(pointBytes []byte) error + func (s *SuiteMock) CreateKeyPair() (crypto.Scalar, crypto.Point) + func (s *SuiteMock) CreatePoint() crypto.Point + func (s *SuiteMock) CreatePointForScalar(scalar crypto.Scalar) (crypto.Point, error) + func (s *SuiteMock) CreateScalar() crypto.Scalar + func (s *SuiteMock) GetUnderlyingSuite() interface{} + func (s *SuiteMock) IsInterfaceNil() bool + func (s *SuiteMock) PointLen() int + func (s *SuiteMock) RandomStream() cipher.Stream + func (s *SuiteMock) ScalarLen() int + func (s *SuiteMock) String() string