Documentation ¶
Overview ¶
Package bls implements BLS aggregate signatures.
This package implements the scheme described in "Aggregate and Verifiably Encrypted Signatures from Bilinear Maps" by Boneh, Gentry, Lynn, and Shacham (Eurocrypt 2003): https://www.iacr.org/archive/eurocrypt2003/26560416/26560416.pdf.
Index ¶
- func ByteToPoint(b []byte) (kyber.Point, error)
- func ByteToScalar(b []byte) (kyber.Scalar, error)
- func BytesToAddress(data []byte, shard uint32) string
- func CreateSchnorrKeys() (kyber.Scalar, kyber.Point)
- func CreateSignature(Rs []kyber.Point, Ss []kyber.Scalar) ([]byte, []byte, error)
- func EncryptWallet(password []byte, wal *Wallet) ([]byte, error)
- func GenerateParameter() (kyber.Scalar, []byte, error)
- func GenerateVanityWallet(vanity string, userWallet string, shard uint8, vainityFound *bool, ...) error
- func GetShardFromAddress(w string) (uint32, error)
- func Hash(s string) kyber.Scalar
- func IsWalletValid(wallet string) bool
- func JSWallet(shard uint8) *js.Object
- func MakeSign(x kyber.Scalar, k kyber.Scalar, message string, otherR []kyber.Point, ...) []byte
- func PublicKey(m string, rSignature kyber.Point, sSignature kyber.Scalar) kyber.Point
- func Sign(m string, x kyber.Scalar, otherR []kyber.Point, otherP []kyber.Point, ...) kyber.Scalar
- func SignatureValid(x509pub, r, s, data []byte) (bool, error)
- func Verify(m string, rSignature kyber.Point, sSignature kyber.Scalar, P kyber.Point, ...) bool
- func VerifySignature(message string, rSignature kyber.Point, sSignature kyber.Scalar, ...) bool
- type Wallet
- func (w *Wallet) ExportWallet(filePath string) error
- func (w *Wallet) GetEncodedWallet() ([]byte, error)
- func (w *Wallet) GetPrivateKeySchnorr() (kyber.Scalar, error)
- func (w *Wallet) GetPubKey() ([]byte, error)
- func (w *Wallet) GetPublicKeySchnorr() (kyber.Point, error)
- func (w *Wallet) GetPublicKeySchnorrByte() []byte
- func (w *Wallet) GetShardWallet() uint8
- func (w *Wallet) GetWallet() (string, error)
- func (w *Wallet) NewTransaction(recipient string, amount uint64, gas uint32, data []byte, shard uint32) ([]byte, error)
- func (w *Wallet) RawTransaction(recipient string, amount uint64, gas uint32, data []byte, shard uint32) (*protobufs.Transaction, error)
- func (w *Wallet) Sign(data []byte) (r, s *big.Int, e error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteToPoint ¶
func ByteToScalar ¶
func BytesToAddress ¶
BytesToAddress converts the bytes of the PublicKey into a wallet address
func CreateSignature ¶
func EncryptWallet ¶
EncryptWallet returns a wallet encrypted with the key passed as argument
func GenerateParameter ¶
generate k and calculate r
func GenerateVanityWallet ¶
func GenerateVanityWallet(vanity string, userWallet string, shard uint8, vainityFound *bool, wg *sync.WaitGroup) error
GenerateVanityWallet create a wallet that start with "Dexm" + your_word
func GetShardFromAddress ¶
func IsWalletValid ¶
IsWalletValid checks if a wallet is valid by checking the checksum
func PublicKey ¶
func PublicKey(m string, rSignature kyber.Point, sSignature kyber.Scalar) kyber.Point
func Sign ¶
func Sign(m string, x kyber.Scalar, otherR []kyber.Point, otherP []kyber.Point, k kyber.Scalar) kyber.Scalar
m: Message x: Private key
func SignatureValid ¶
SignatureValid checks if a signature is valid for a x509 encoded ecdsa pubkey
func VerifySignature ¶
Types ¶
type Wallet ¶
type Wallet struct { PrivKey *ecdsa.PrivateKey Shard uint8 Balance int PrivKeySchnorr []byte PubKeySchnorr []byte }
Wallet is an internal representation of a private key
func GenerateWallet ¶
GenerateWallet generates a new random wallet with a 0 balance
func ImportWallet ¶
ImportWallet opens the file passed to it and tries to parse it as a private key and convert it into a Wallet struct
func (*Wallet) ExportWallet ¶
ExportWallet saves the internal Wallet structure to a file
func (*Wallet) GetEncodedWallet ¶
GetEncodedWallet returns a JSON encoded wallet
func (*Wallet) GetPrivateKeySchnorr ¶
GetPrivateKeySchnorr return the private schnorr key to the wallet
func (*Wallet) GetPublicKeySchnorr ¶
GetPrivateKeySchnorr return the private schnorr key to the wallet
func (*Wallet) GetPublicKeySchnorrByte ¶
GetPrivateKeySchnorr return the private schnorr key to the wallet
func (*Wallet) GetShardWallet ¶
GetShardWallet return the shard to the wallet
func (*Wallet) NewTransaction ¶
func (w *Wallet) NewTransaction(recipient string, amount uint64, gas uint32, data []byte, shard uint32) ([]byte, error)
NewTransaction generates a signed transaction for the given arguments without broadcasting it to the newtwork