crypto

package
v0.96.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 2 Imported by: 18

Documentation

Overview

Package crypto provides interface to CryptoLib native contract. It implements some cryptographic functions.

Index

Constants

View Source
const Hash = "\x1b\xf5\x75\xab\x11\x89\x68\x84\x13\x61\x0a\x35\xa1\x28\x86\xcd\xe0\xb6\x6c\x72"

Hash represents CryptoLib contract hash.

Variables

This section is empty.

Functions

func Ripemd160

func Ripemd160(b []byte) interop.Hash160

Ripemd160 calls `ripemd160` method of native CryptoLib contract and computes RIPEMD160 hash of b.

func Sha256

func Sha256(b []byte) interop.Hash256

Sha256 calls `sha256` method of native CryptoLib contract and computes SHA256 hash of b.

func VerifyWithECDsa

func VerifyWithECDsa(msg []byte, pub interop.PublicKey, sig interop.Signature, curve NamedCurve) bool

VerifyWithECDsa calls `verifyWithECDsa` method of native CryptoLib contract and checks that sig is correct msg's signature for a given pub (serialized public key on a given curve).

Types

type NamedCurve

type NamedCurve byte

NamedCurve represents named elliptic curve.

const (
	Secp256k1 NamedCurve = 22
	Secp256r1 NamedCurve = 23
)

Various named elliptic curves.

Jump to

Keyboard shortcuts

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