crypto

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KindSECP256K1 string identifier for secp256k1 keys.
	KindSECP256K1 = "secp256k1"
	// KindED25519 string identifier for ed25519 keys.
	KindED25519 = "ed25519"
	// KindSR25519 string identifier for sr25519 keys.
	KindSR25519 = "sr25519"
)
View Source
const (
	// ByteSECP256K1 byte identifier for secp256k1 keys.
	ByteSECP256K1 = 0xe1
	// ByteED25519 byte identifier for ed25519 keys.
	ByteED25519 = 0xe2
	// ByteSR25519 byte identifier for sr25519 keys.
	ByteSR25519 = 0xe3
)

Variables

This section is empty.

Functions

func KeyTypes added in v0.0.38

func KeyTypes() map[string]bool

KeyTypes available key types.

Types

type PrivateKey

type PrivateKey interface {
	// Bytes returns the byte representation of the private key
	Bytes() []byte
	// PublicKey from the PrivateKey
	PublicKey() PublicKey
	// Kind returns the type of the key
	Kind() string
	// Sign signs the message with the key and returns the signature.
	Sign(message []byte) ([]byte, error)
}

PrivateKey definition usable in all mailchain crypto operations

type PublicKey

type PublicKey interface {
	// Bytes returns the raw bytes representation of the public key.
	//
	// The returned bytes are used for encrypting, verifying a signature, and locating an address.
	Bytes() []byte
	// Kind returns the type of the key.
	Kind() string
	// Verify verifies whether sig is a valid signature of message.
	Verify(message, sig []byte) bool
}

PublicKey definition usable in all mailchain crypto operations

Directories

Path Synopsis
Package cipher collects common cryptographic constants and interfaces.
Package cipher collects common cryptographic constants and interfaces.
aes256cbc
Package aes256cbc implements Advanced Encryption Standard with a 256 bit key length, using Chain Block Cipher mode (AES-256-CBC).
Package aes256cbc implements Advanced Encryption Standard with a 256 bit key length, using Chain Block Cipher mode (AES-256-CBC).
ciphertest
Package ciphertest is a generated GoMock package.
Package ciphertest is a generated GoMock package.
ecdh
Package ecdh has implementations for different asymmetric key exchange.
Package ecdh has implementations for different asymmetric key exchange.
noop
Package noop is a no operation encryption algorithm for use when the message is intended to be publically readable.
Package noop is a no operation encryption algorithm for use when the message is intended to be publically readable.
Package cryptotest is a generated GoMock package.
Package cryptotest is a generated GoMock package.
internal

Jump to

Keyboard shortcuts

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