Versions in this module Expand all Collapse all v0 v0.1.2 Nov 4, 2026 v0.1.0 Nov 3, 2026 Changes in this version + const MaxRandomSize + const MaxTokenLen + var ErrDecrypt = errors.New("cryptox: decryption failed") + var ErrInvalidPurpose = errors.New("cryptox: purpose must contain 1 to 256 bytes") + var ErrInvalidSize = errors.New("cryptox: invalid random size") + var ErrTooLarge = errors.New("cryptox: input too large") + var ErrUninitialized = errors.New("cryptox: uninitialized instance") + func RandomBytes(size int) ([]byte, error) + func RandomToken(size int) (string, error) + type AESGCM struct + func NewAESGCM(key []byte) (*AESGCM, error) + func (c *AESGCM) Decrypt(ciphertext, aad []byte) ([]byte, error) + func (c *AESGCM) DecryptToken(token, purpose string) ([]byte, error) + func (c *AESGCM) Encrypt(plaintext, aad []byte) ([]byte, error) + func (c *AESGCM) EncryptToken(plaintext []byte, purpose string) (string, error) + type HMACSHA256 struct + func NewHMACSHA256(key []byte) (*HMACSHA256, error) + func (s *HMACSHA256) Sign(message []byte) ([]byte, error) + func (s *HMACSHA256) Verify(message, signature []byte) bool