cryptography

package
v0.0.0-...-dca6ad6 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test()

Test -- Placeholder for package reference

Types

type CryptoImplementation

type CryptoImplementation interface {
	DeriveKeypair() error
	Sign(Message []byte) []byte
	IsValidMessage(Message, Signature []byte) bool
}

func NewKeyPair

func NewKeyPair(cit CryptoImplementationType, seed []byte, isValidator bool) (CryptoImplementation, error)

NewKeyPair -- Generates a new key pair of specified type.

type CryptoImplementationType

type CryptoImplementationType string
const (
	ED25519   CryptoImplementationType = "ED25519"
	SECP256K1 CryptoImplementationType = "SECP256K1"
)

type Ed25519

type Ed25519 struct {
	// contains filtered or unexported fields
}

func (*Ed25519) DeriveKeypair

func (e *Ed25519) DeriveKeypair() error

DeriveKeypair -- Derrive a new keypair from seed

func (*Ed25519) IsValidMessage

func (e *Ed25519) IsValidMessage(Message, Signature []byte) bool

IsValidMessage -- Validate message with public key and signature.

func (*Ed25519) Sign

func (e *Ed25519) Sign(Message []byte) []byte

Sign -- Sign message with private key.

type Secp256k1

type Secp256k1 struct {
	// contains filtered or unexported fields
}

func (*Secp256k1) DeriveKeypair

func (s *Secp256k1) DeriveKeypair() error

DeriveKeypair -- Derrive a new keypair from seed

func (*Secp256k1) IsValidMessage

func (s *Secp256k1) IsValidMessage(Message, Signature []byte) bool

IsValidMessage -- Validate message with public key and signature.

func (*Secp256k1) Sign

func (s *Secp256k1) Sign(Message []byte) []byte

Sign -- Sign message with private key.

Jump to

Keyboard shortcuts

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