crypto

package
v0.0.0-...-00a43c6 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SALSA20_NONCE []byte = []byte{0xE8, 0x30, 0x09, 0x4B, 0x97, 0x20, 0x5D, 0x2A}

Functions

func AESRounds

func AESRounds(in, seed []byte, rounds uint64) ([]byte, error)

func DecryptAES

func DecryptAES(ciphertext, key, iv []byte) ([]byte, error)

func EncryptAES

func EncryptAES(plaintext, key, iv []byte) ([]byte, error)

func GenerateMasterKey

func GenerateMasterKey(password string, masterSeed, transformSeed []byte, transformRounds uint64) ([]byte, error)

Types

type DecryptError

type DecryptError error

type Salsa20Stream

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

func NewSalsa20Stream

func NewSalsa20Stream(key [32]byte) *Salsa20Stream

func (*Salsa20Stream) Decrypt

func (s *Salsa20Stream) Decrypt(ciphertext []byte) ([]byte, error)

func (*Salsa20Stream) Encrypt

func (s *Salsa20Stream) Encrypt(plaintext []byte) ([]byte, error)

Encrypt encrypts a given bytearray. The operation is the same as decrypting

type Stream

type Stream interface {
	Decrypt(in []byte) (out []byte, err error)
	Encrypt(in []byte) (out []byte, err error)
}

Jump to

Keyboard shortcuts

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