crypto

package
v0.75.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package crypto provides an interface to VM cryptographic instructions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash160

func Hash160(b []byte) []byte

Hash160 computes SHA256 + RIPEMD-160 of b, which is commonly used for script hashing and address generation. It uses `HASH160` VM instruction.

func Hash256

func Hash256(b []byte) []byte

Hash256 computes double SHA256 hash of b (SHA256(SHA256(b))) which is used as ID for transactions, blocks and assets. It uses `HASH256` VM instruction.

func SHA1

func SHA1(b []byte) []byte

SHA1 computes SHA1 hash of b. It uses `SHA1` VM instruction.

func SHA256

func SHA256(b []byte) []byte

SHA256 computes SHA256 hash of b. It uses `SHA256` VM instruction.

func VerifySignature

func VerifySignature(msg []byte, sig []byte, pub []byte) bool

VerifySignature checks that sig is correct msg's signature for a given pub (serialized public key). It uses `VERIFY` VM instruction.

Types

This section is empty.

Jump to

Keyboard shortcuts

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