trix

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: EUPL-1.2 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPasswordRequired = errors.New("password is required for encryption")
	ErrDecryptionFailed = errors.New("decryption failed (wrong password?)")
)

Functions

func DeriveKey added in v0.0.2

func DeriveKey(password string) []byte

DeriveKey derives a 32-byte key from a password using SHA-256. This is used for ChaCha20-Poly1305 encryption which requires a 32-byte key.

func FromTrix

func FromTrix(data []byte, password string) (*datanode.DataNode, error)

FromTrix converts a Trix byte slice back to a DataNode.

func FromTrixChaCha added in v0.0.2

func FromTrixChaCha(data []byte, password string) (*datanode.DataNode, error)

FromTrixChaCha decrypts a ChaCha-encrypted Trix byte slice back to a DataNode.

func ToTrix

func ToTrix(dn *datanode.DataNode, password string) ([]byte, error)

ToTrix converts a DataNode to the Trix format.

func ToTrixChaCha added in v0.0.2

func ToTrixChaCha(dn *datanode.DataNode, password string) ([]byte, error)

ToTrixChaCha converts a DataNode to encrypted Trix format using ChaCha20-Poly1305.

Types

This section is empty.

Jump to

Keyboard shortcuts

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