cs_crypto

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2019 License: LGPL-3.0, GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAddress

func CreateAddress(b common.Address, nonce uint64) common.Address

CreateAddress creates an ethereum address given the bytes and the nonce

func CreateAddress2

func CreateAddress2(b common.Address, salt [32]byte, inithash []byte) common.Address

CreateAddress2 creates an ethereum address given the address bytes, initial contract code hash and a salt.

func GetContractAddress

func GetContractAddress(address common.Address) common.Address

func GetEvidenceAddress

func GetEvidenceAddress(target common.Address) common.Address

func GetLockAddress

func GetLockAddress(alice, bob common.Address) common.Address

func GetNormalAddress

func GetNormalAddress(p ecdsa.PublicKey) common.Address

func GetNormalAddressFromEvidence

func GetNormalAddressFromEvidence(target common.Address) common.Address

func Keccak256Hash

func Keccak256Hash(data ...[]byte) (h common.Hash)

Keccak256Hash calculates and returns the Keccak256 hash of the input data, converting it to an internal Hash data structure.

func PubkeyToAddress

func PubkeyToAddress(p ecdsa.PublicKey) common.Address

don't use this method, use GetNormalAddress

func RecoverAddressFromSig

func RecoverAddressFromSig(hash common.Hash, sig []byte) (common.Address, error)

func ToECDSAPub

func ToECDSAPub(pub []byte) *ecdsa.PublicKey

func ValidSigValue

func ValidSigValue(r, s, v *big.Int) bool

检查签名的r,s,v是否越界 todo 加测试

func ValidateSignatureValues

func ValidateSignatureValues(v byte, r, s *big.Int, homestead bool) bool

ValidateSignatureValues verifies whether the signature values are valid with the given chain rules. The v value is assumed to be either 0 or 1.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL