crypto

package module
v0.0.0-...-0354332 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0, BSD-2-Clause Imports: 6 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidKeyLength = ierrors.New("invalid key length")
)
View Source
var Randomness = rand.New(RandomnessSource{})

Randomness contains an Rand instance of the previously defined RandomnessSource.

Functions

func ParseEd25519PrivateKeyFromString

func ParseEd25519PrivateKeyFromString(key string) (ed25519.PrivateKey, error)

ParseEd25519PrivateKeyFromString parses an ed25519 private key from a string.

func ParseEd25519PublicKeyFromString

func ParseEd25519PublicKeyFromString(key string) (ed25519.PublicKey, error)

ParseEd25519PublicKeyFromString parses an ed25519 public key from a string.

Types

type RandomnessSource

type RandomnessSource struct{}

RandomnessSource implements a cryptographically secure randomness source.

func (RandomnessSource) Int63

func (s RandomnessSource) Int63() int64

Int63 returns a non-negative random 63-bit integer as an int64.

func (RandomnessSource) Seed

func (s RandomnessSource) Seed(int64)

Seed is usually used to initialize the generator to a deterministic state but we want real randomness.

func (RandomnessSource) Uint64

func (s RandomnessSource) Uint64() (v uint64)

Uint64 returns a random 64-bit value as a uint64.

Directories

Path Synopsis
Package ed25519 implements an Ed25519 Verify function for use in consensus-critical contexts.
Package ed25519 implements an Ed25519 Verify function for use in consensus-critical contexts.

Jump to

Keyboard shortcuts

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