Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSigToPubTypeNotFound is reported if the type is already used. ErrSigToPubTypeNotFound = fmt.Errorf("type of sigToPub is not found") // ErrSigToPubTypeAlreadyExist is reported if the type is already used. ErrSigToPubTypeAlreadyExist = fmt.Errorf("type of sigToPub is already exist") )
Functions ¶
func Keccak256Hash ¶
Keccak256Hash calculates and returns the Keccak256 hash of the input data, converting it to an internal Hash data structure.
func RegisterSigToPub ¶
func RegisterSigToPub(sigType string, sigToPub SigToPubFn) error
RegisterSigToPub registers a sigToPub function of type.
Types ¶
type PrivateKey ¶
type PrivateKey interface { // PublicKey returns the public key associate this private key. PublicKey() PublicKey // Sign calculates a signature. Sign(hash common.Hash) (Signature, error) }
PrivateKey describes the asymmetric cryptography interface that interacts with the private key.
type PublicKey ¶
type PublicKey interface { // VerifySignature checks that the given public key created signature over hash. VerifySignature(hash common.Hash, signature Signature) bool // Bytes returns the []byte representation of public key. Bytes() []byte }
PublicKey describes the asymmetric cryptography interface that interacts with the public key.
type SigToPubFn ¶
SigToPubFn is a function to recover public key from signature.
Click to show internal directories.
Click to hide internal directories.