crypto

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ed25519                    = "ed25519"
	Curve25519xSalsa20Poly1305 = "curve25519xsalsa20poly1305"
)

Available asymmetric crypto algorithms. The values must be lower case.

View Source
const (
	InvalidKeySize      = "Invalid key size"
	UnsupportedSignAlgo = "Unsupported signing algorithm"
	InvalidSignature    = "Invalid signature"
)

Variables

This section is empty.

Functions

func MathRandSeed added in v0.1.1

func MathRandSeed()

Seed math/rand's default generator with a random value, once.

func RandInt64 added in v0.1.1

func RandInt64() int64

RandInt64 returns a random int64 value. The returned value can be negative.

func RandUint64 added in v0.1.1

func RandUint64() uint64

func Sign

func Sign(sigInput, signKey common.RawBytes, signAlgo string) (common.RawBytes, error)

Sign takes a signature input and a signing key to create a signature. Currently only ed25519 is supported

func Verify

func Verify(sigInput, sig, verifyKey common.RawBytes, signAlgo string) error

Verify takes a signature input and a verifying key and returns an error, if the signature does not match. Currently only ed25519 is supported.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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