Documentation
¶
Index ¶
- func CheckSignature(hash, signature []byte, voters []common.Address) (common.Address, error)
- func ConstantSlice[T any](val T, n int) []T
- func ECDSAPrivKeyToECIES(privKey *ecdsa.PrivateKey) (*ecies.PrivateKey, error)
- func ECDSAPubKeyToECIES(pubKey *ecdsa.PublicKey) (*ecies.PublicKey, error)
- func ParsePubKeys(pubKeys []wallet.PublicKey) ([]*ecdsa.PublicKey, error)
- func PubKeysToAddresses(pubKeys []types.PublicKey) ([]common.Address, error)
- func Sign(msgHash []byte, privKey *ecdsa.PrivateKey) ([]byte, error)
- func SignatureToSignersAddress(hash, signature []byte) (common.Address, error)
- func Sum[T Number](numbers []T) T
- func ToHash(s string) common.Hash
- func VerifySignature(hash, signature []byte, signerAddress common.Address) error
- type Number
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSignature ¶
CheckSignature recovers the signer address and optionally verifies it is in the allowed voter list.
func ConstantSlice ¶
ConstantSlice crates a slice of length n with all the entries equal to val.
func ECDSAPrivKeyToECIES ¶
func ECDSAPrivKeyToECIES(privKey *ecdsa.PrivateKey) (*ecies.PrivateKey, error)
func ECDSAPubKeyToECIES ¶
func ParsePubKeys ¶
ParsePubKeys converts the wallet public key structures to ECDSA keys.
func PubKeysToAddresses ¶
PubKeysToAddresses returns the Ethereum addresses derived from the keys.
func Sign ¶
func Sign(msgHash []byte, privKey *ecdsa.PrivateKey) ([]byte, error)
Sign signs the provided hash with the given private key.
func SignatureToSignersAddress ¶
SignatureToSignersAddress recovers the Ethereum address associated with the signature of the given hash.
Types ¶
type Number ¶
type Number interface {
constraints.Integer | constraints.Float
}
Click to show internal directories.
Click to hide internal directories.