gcrypto

package
v0.0.0-...-bad6181 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBtcCrypt

func NewBtcCrypt() *btcCrypt

func NewEthCrypt

func NewEthCrypt() *ethCrypt

Types

type Cipher

type Cipher string

Cipher is an algorithm for performing encryption or decryption in cryptography.

var (
	CipherMono256              Cipher = "mono256"
	CipherChaCha20IETFPoly1305 Cipher = "chacha20-ietf-poly1305"
	CipherXChaCha20Poly1305    Cipher = "xchacha20-poly1305"
)

type CipherRWC

type CipherRWC interface {
	io.ReadWriteCloser
}

CipherRWC defines the interface for encryption algorithms where plaintext and ciphertext have different length.

type CipherRWCMaker

type CipherRWCMaker interface {
	NonceSize() int
	Make(rwc io.ReadWriteCloser, genNonce bool, timeout *time.Duration, nonceCodec EqLenCipher) (CipherRWC, error)
}

type EqLenCipher

type EqLenCipher interface {
	Encrypt(b []byte) error
	Decrypt(b []byte) error
}

EqLenCipher defines the interface for encryption algorithms where plaintext and ciphertext have the same length.

type EqLenCipherRwc

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

EqLenCipherRwc wraps io.ReadWriteCloser and EqLenCipher and it implements io.ReadWriteCloser

func NewEqLenCipherRWC

func NewEqLenCipherRWC(elc EqLenCipher, rwc io.ReadWriteCloser) *EqLenCipherRwc

NewEqLenCipherRWC create new plaintext ciphertext equal length cipher codec wrapping a `io.ReadWriteCloser`.

func (*EqLenCipherRwc) Close

func (cipher *EqLenCipherRwc) Close() error

Close implements io.ReadWriteCloser.

func (*EqLenCipherRwc) Read

func (cipher *EqLenCipherRwc) Read(p []byte) (n int, err error)

Read implements io.ReadWriteCloser

func (*EqLenCipherRwc) Write

func (cipher *EqLenCipherRwc) Write(p []byte) (n int, err error)

Write implements io.ReadWriteCloser

type VarLenCipher

type VarLenCipher interface {
	Encrypt(b []byte) ([]byte, error)
	Decrypt(b []byte) ([]byte, error)
}

VarLenCipher defines the interface for encryption algorithms where plaintext and ciphertext have different length.

Jump to

Keyboard shortcuts

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