Documentation
¶
Index ¶
- Variables
- func Author() string
- func CBCDecrypt(ciphertext, key, iv []byte) ([]byte, error)
- func CBCDecryptWithHmac(ciphertext, key []byte) ([]byte, error)
- func CBCEncrypt(plaintext, key, iv []byte) ([]byte, error)
- func CBCEncryptWithHmac(plaintext, key, iv []byte) ([]byte, error)
- func License() string
- func PKCS7Padding(data []byte, blockSize int) ([]byte, error)
- func PKCS7Unpadding(data []byte) ([]byte, error)
- func Version() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMissingEncryptKey is missing encrypt key error ErrMissingEncryptKey = errors.New("xaes: key for encrypting is missing") // ErrMissingDecryptKey is missing decrypt key error ErrMissingDecryptKey = errors.New("xaes: key for decrypting is missing") // ErrInvalidIVSize is invalid IV size error ErrInvalidIVSize = fmt.Errorf("xaes: length of iv must be %d", aes.BlockSize) // ErrInvalidCiphertextSize is invalid ciphertext size error ErrInvalidCiphertextSize = fmt.Errorf("xaes: length of ciphertext must be greater than %d", aes.BlockSize+sha256.Size) // ErrInvalidHmac is invalid hmac error ErrInvalidHmac = fmt.Errorf("xaes: hmac is invalid") // ErrInvalidPKCS7Padding is invalid pkcs7 padding ErrInvalidPKCS7Padding = fmt.Errorf("xaes: invalid PKCS7 padding") )
Functions ¶
func CBCDecrypt ¶
CBCDecrypt do AES CBC decrypt
func CBCDecryptWithHmac ¶ added in v0.25.2
CBCDecryptWithHmac do AES CBC decrypt with HMAC
func CBCEncrypt ¶
CBCEncrypt do AES CBC encrypt
func CBCEncryptWithHmac ¶ added in v0.25.2
CBCEncryptWithHmac do AES CBC encrypt then HMAC
func PKCS7Padding ¶
PKCS7Padding do PKCS7 padding
func PKCS7Unpadding ¶
PKCS7Unpadding do PKCS7 unpadding
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.