Documentation ¶
Index ¶
- Constants
- func IsMnemonicValid(mnemonic string) bool
- func Sha3Sum256(data string) string
- type BLS0ChainScheme
- func (b0 *BLS0ChainScheme) Add(signature, msg string) (string, error)
- func (b0 *BLS0ChainScheme) GenerateKeys() (*Wallet, error)
- func (b0 *BLS0ChainScheme) GetPrivateKey() string
- func (b0 *BLS0ChainScheme) GetPrivateKeyAsByteArray() ([]byte, error)
- func (b0 *BLS0ChainScheme) GetPublicKey() string
- func (b0 *BLS0ChainScheme) RecoverKeys(mnemonic string) (*Wallet, error)
- func (b0 *BLS0ChainScheme) SetPrivateKey(privateKey string) error
- func (b0 *BLS0ChainScheme) SetPublicKey(publicKey string) error
- func (b0 *BLS0ChainScheme) Sign(hash string) (string, error)
- func (b0 *BLS0ChainScheme) SplitKeys(numSplits int) (*Wallet, error)
- func (b0 *BLS0ChainScheme) Verify(signature, msg string) (bool, error)
- type BLS0ChainThresholdScheme
- type ED255190chainScheme
- func (ed *ED255190chainScheme) Add(signature, msg string) (string, error)
- func (ed *ED255190chainScheme) GenerateKeys() (*Wallet, error)
- func (ed *ED255190chainScheme) GetPrivateKey() string
- func (ed *ED255190chainScheme) GetPublicKey() string
- func (ed *ED255190chainScheme) RecoverKeys(mnemonic string) (*Wallet, error)
- func (ed *ED255190chainScheme) SetPrivateKey(privateKey string) error
- func (ed *ED255190chainScheme) SetPublicKey(publicKey string) error
- func (ed *ED255190chainScheme) Sign(hash string) (string, error)
- func (ed *ED255190chainScheme) Verify(signature, msg string) (bool, error)
- type KeyPair
- type SignatureScheme
- type SplitSignatureScheme
- type ThresholdSignatureScheme
- type Wallet
Constants ¶
const CryptoVersion = "1.0"
Variables ¶
This section is empty.
Functions ¶
func IsMnemonicValid ¶
func Sha3Sum256 ¶
Types ¶
type BLS0ChainScheme ¶
type BLS0ChainScheme struct { PublicKey string `json:"public_key"` PrivateKey string `json:"private_key"` Mnemonic string `json:"mnemonic"` }
BLS0ChainScheme - a signature scheme for BLS0Chain Signature
func NewBLS0ChainScheme ¶
func NewBLS0ChainScheme() *BLS0ChainScheme
NewBLS0ChainScheme - create a BLS0ChainScheme object
func (*BLS0ChainScheme) GenerateKeys ¶
func (b0 *BLS0ChainScheme) GenerateKeys() (*Wallet, error)
GenerateKeys - implement interface
func (*BLS0ChainScheme) GetPrivateKey ¶
func (b0 *BLS0ChainScheme) GetPrivateKey() string
func (*BLS0ChainScheme) GetPrivateKeyAsByteArray ¶
func (b0 *BLS0ChainScheme) GetPrivateKeyAsByteArray() ([]byte, error)
GetPrivateKeyAsByteArray - converts private key into byte array
func (*BLS0ChainScheme) GetPublicKey ¶
func (b0 *BLS0ChainScheme) GetPublicKey() string
GetPublicKey - implement interface
func (*BLS0ChainScheme) RecoverKeys ¶
func (b0 *BLS0ChainScheme) RecoverKeys(mnemonic string) (*Wallet, error)
func (*BLS0ChainScheme) SetPrivateKey ¶
func (b0 *BLS0ChainScheme) SetPrivateKey(privateKey string) error
SetPrivateKey - implement interface
func (*BLS0ChainScheme) SetPublicKey ¶
func (b0 *BLS0ChainScheme) SetPublicKey(publicKey string) error
SetPublicKey - implement interface
func (*BLS0ChainScheme) Sign ¶
func (b0 *BLS0ChainScheme) Sign(hash string) (string, error)
Sign - implement interface
type BLS0ChainThresholdScheme ¶
type BLS0ChainThresholdScheme struct { BLS0ChainScheme Ids string `json:"threshold_scheme_id"` // contains filtered or unexported fields }
BLS0ChainThresholdScheme - a scheme that can create threshold signature shares for BLS0Chain signature scheme
func BLS0GenerateThresholdKeyShares ¶
func BLS0GenerateThresholdKeyShares(t, n int, originalKey SignatureScheme) ([]BLS0ChainThresholdScheme, error)
BLS0GenerateThresholdKeyShares given a signature scheme will generate threshold sig keys
func NewBLS0ChainThresholdScheme ¶
func NewBLS0ChainThresholdScheme() *BLS0ChainThresholdScheme
NewBLS0ChainThresholdScheme - create a new instance
func (*BLS0ChainThresholdScheme) GetID ¶
func (tss *BLS0ChainThresholdScheme) GetID() string
GetID gets ID in hex string format
func (*BLS0ChainThresholdScheme) SetID ¶
func (tss *BLS0ChainThresholdScheme) SetID(id string) error
SetID sets ID in HexString format
type ED255190chainScheme ¶
type ED255190chainScheme struct {
// contains filtered or unexported fields
}
ED255190chainScheme - a signature scheme based on ED25519
func NewED255190chainScheme ¶
func NewED255190chainScheme() *ED255190chainScheme
NewED25519Scheme - create a ED255219Scheme object
func (*ED255190chainScheme) Add ¶
func (ed *ED255190chainScheme) Add(signature, msg string) (string, error)
func (*ED255190chainScheme) GenerateKeys ¶
func (ed *ED255190chainScheme) GenerateKeys() (*Wallet, error)
GenerateKeys - implement interface
func (*ED255190chainScheme) GetPrivateKey ¶
func (ed *ED255190chainScheme) GetPrivateKey() string
GetPrivateKey - implement interface
func (*ED255190chainScheme) GetPublicKey ¶
func (ed *ED255190chainScheme) GetPublicKey() string
GetPublicKey - implement interface
func (*ED255190chainScheme) RecoverKeys ¶
func (ed *ED255190chainScheme) RecoverKeys(mnemonic string) (*Wallet, error)
func (*ED255190chainScheme) SetPrivateKey ¶
func (ed *ED255190chainScheme) SetPrivateKey(privateKey string) error
func (*ED255190chainScheme) SetPublicKey ¶
func (ed *ED255190chainScheme) SetPublicKey(publicKey string) error
type SignatureScheme ¶
type SignatureScheme interface { // Generate fresh keys GenerateKeys() (*Wallet, error) // Generate keys from mnemonic for recovery RecoverKeys(mnemonic string) (*Wallet, error) // Signing - Set private key to sign SetPrivateKey(privateKey string) error Sign(hash string) (string, error) // Signature verification - Set public key to verify SetPublicKey(publicKey string) error GetPublicKey() string GetPrivateKey() string Verify(signature string, msg string) (bool, error) // Combine signature for schemes BLS Add(signature, msg string) (string, error) }
SignatureScheme - an encryption scheme for signing and verifying messages
func NewSignatureScheme ¶
func NewSignatureScheme(sigScheme string) SignatureScheme
NewSignatureScheme creates an instance for using signature functions
type SplitSignatureScheme ¶
type SplitSignatureScheme interface { SignatureScheme SplitKeys(numSplits int) (*Wallet, error) }
SplitSignatureScheme splits the primary key into number of parts.
type ThresholdSignatureScheme ¶
type ThresholdSignatureScheme interface { SignatureScheme SetID(id string) error GetID() string }