Documentation ¶
Index ¶
- func AddressOf(pk common.PublicKey) common.Address
- func DecodeSignature(sig string) (r, s *big.Int, err error)
- func EncodeSignature(r, s *big.Int) string
- func GenerateECDSAKey() (*ecdsa.PrivateKey, error)
- func GenerateFakeKey(n int) *common.PrivateKey
- func GenerateKey() *common.PrivateKey
- func Keccak256(data ...[]byte) []byte
- func Keccak256Hash(data ...[]byte) (h common.Hash)
- func Keccak512(data ...[]byte) []byte
- func KeyToPem(key *common.PrivateKey) ([]byte, error)
- func PemToKey(b []byte) (*common.PrivateKey, error)
- func Sign(priv *ecdsa.PrivateKey, hash []byte) (r, s *big.Int, err error)
- func Verify(pub *ecdsa.PublicKey, hash []byte, r, s *big.Int) bool
- type PemDump
- type PemKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeSignature ¶
DecodeSignature decode signature from string
func GenerateECDSAKey ¶
func GenerateECDSAKey() (*ecdsa.PrivateKey, error)
GenerateECDSAKey generate ECDSA Key
func GenerateFakeKey ¶
func GenerateFakeKey(n int) *common.PrivateKey
GenerateFakeKey creates fake private key.
func Keccak256Hash ¶
Keccak256Hash calculates and returns the Keccak256 hash of the input data, converting it to an internal Hash data structure.
Types ¶
type PemKey ¶
type PemKey struct {
// contains filtered or unexported fields
}
PemKey struct
func (*PemKey) ReadKeyFromBuf ¶
func (k *PemKey) ReadKeyFromBuf(buf []byte) (*ecdsa.PrivateKey, error)
ReadKeyFromBuf from buffer
Directories ¶
Path | Synopsis |
---|---|
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
|
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202. |
Click to show internal directories.
Click to hide internal directories.