Documentation
¶
Overview ¶
Package cipher defines the symmetric encryption interface used throughout the encryption library. Implementations must be safe for concurrent use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cipher ¶
type Cipher interface {
// Encrypt encrypts plaintext and returns ciphertext.
// The ciphertext format is implementation-defined (e.g., nonce + ciphertext + tag).
Encrypt(key, plaintext []byte) ([]byte, error)
// Decrypt decrypts ciphertext and returns plaintext.
Decrypt(key, ciphertext []byte) ([]byte, error)
// KeySize returns the required key size in bytes.
KeySize() int
}
Cipher performs symmetric encryption and decryption. Implementations must be safe for concurrent use.
Click to show internal directories.
Click to hide internal directories.