crypto

package
v0.0.0-...-9308201 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ecrecover

func Ecrecover(hash, sig []byte) ([]byte, error)

Ecrecover 根据压缩消息和签名,返回未压缩的公钥信息

func Keccak256

func Keccak256(data ...[]byte) []byte

Keccak256 计算并返回 Keccak256 哈希

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 RandomContractAddress

func RandomContractAddress() *common.Address

RandomContractAddress 随机生成一个新的地址,给新创建的合约地址使用

func SigToPub

func SigToPub(hash, sig []byte) (*ecdsa.PublicKey, error)

SigToPub 根据签名返回公钥信息

func ValidateSignatureValues

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

ValidateSignatureValues 校验签名信息是否正确

Types

This section is empty.

Directories

Path Synopsis
Package bn256 implements a particular bilinear group at the 128-bit security level.
Package bn256 implements a particular bilinear group at the 128-bit security level.

Jump to

Keyboard shortcuts

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