Documentation ¶
Index ¶
- Constants
- func DecodeSecp256k1PrivateKey(data []byte) (*ecdsa.PrivateKey, error)
- func EncodeSecp256k1PrivateKey(k *ecdsa.PrivateKey) []byte
- func GenerateSecp256k1Key() (*ecdsa.PrivateKey, error)
- func LegacyKeccak256(data []byte) ([]byte, error)
- func NewEthereumAddress(p ecdsa.PublicKey) ([]byte, error)
- func NewOverlayAddress(p ecdsa.PublicKey, networkID uint64) (swarm.Address, error)
- func Recover(signature, data []byte) (*ecdsa.PublicKey, error)
- type Signer
Constants ¶
View Source
const (
AddressSize = 20
)
Variables ¶
This section is empty.
Functions ¶
func DecodeSecp256k1PrivateKey ¶
func DecodeSecp256k1PrivateKey(data []byte) (*ecdsa.PrivateKey, error)
DecodeSecp256k1PrivateKey decodes raw ECDSA private key.
func EncodeSecp256k1PrivateKey ¶
func EncodeSecp256k1PrivateKey(k *ecdsa.PrivateKey) []byte
EncodeSecp256k1PrivateKey encodes raw ECDSA private key.
func GenerateSecp256k1Key ¶
func GenerateSecp256k1Key() (*ecdsa.PrivateKey, error)
GenerateSecp256k1Key generates an ECDSA private key using secp256k1 elliptic curve.
func LegacyKeccak256 ¶ added in v0.2.0
func NewEthereumAddress ¶
NewEthereumAddress returns a binary representation of ethereum blockchain address. This function is based on github.com/ethereum/go-ethereum/crypto.PubkeyToAddress.
func NewOverlayAddress ¶
NewOverlayAddress constructs a Swarm Address from ECDSA private key.
Types ¶
Click to show internal directories.
Click to hide internal directories.