Documentation ¶
Index ¶
- Constants
- func GetAEADCipherFromString(cip string, key []byte) (cipher.AEAD, error)
- func GetBlockCipherFromCipherString(cip string, key []byte) (cipher.Block, error)
- func GetStreamCipherFromCipherString(cip string, key, nonce []byte) (cipher.Stream, error)
- func PaddingPKCS5(src []byte, size int) []byte
- func PaddingPKCS7(src []byte, size int) []byte
- func RegistAEAD(cip string, getter AEADCipherGetter)
- func RegistBlock(cip string, getter BlockCipherGetter)
- func RegistStream(cip string, getter StreamCipherGetter)
- func UnPaddingPKCS5(src []byte, size int) ([]byte, error)
- func UnPaddingPKCS7(src []byte, size int) ([]byte, error)
- type AEADCipherGetter
- type BlockCipherGetter
- type ModeGetter
- type Padder
- type PadderPair
- type StreamCipherGetter
- type UnPadder
- type VAEAD
- type VBlock
- func (v *VBlock) CBC(iv []byte, pair PadderPair) *VBlockModePair
- func (v *VBlock) CFB(iv []byte) *VStream
- func (v *VBlock) CTR(iv []byte) cipher.Stream
- func (v *VBlock) DecryptData(ciphertext []byte) ([]byte, error)
- func (v *VBlock) EncryptData(plaintext []byte) ([]byte, error)
- func (v *VBlock) GCM() (cipher.AEAD, error)
- func (v *VBlock) OFB(iv []byte) cipher.Stream
- type VBlockModePair
- type VCipher
- type VStream
Constants ¶
View Source
const ( // block AES_128 = "AES-128" AES_192 = "AES-192" AES_256 = "AES-256" DES = "DES" TDES = "3DES" // stream CHACHA20 = "CHACHA20" XCHACHA20 = "XCHACHA20" // aead CHACHA20_POLY1305 = "CHACHA20-POLY1305" XCHACHA20_POLY1305 = "CHACHA20-POLY1305" // mode CTR = "CTR" )
Variables ¶
This section is empty.
Functions ¶
func GetAEADCipherFromString ¶
func PaddingPKCS5 ¶
func PaddingPKCS7 ¶
func RegistAEAD ¶
func RegistAEAD(cip string, getter AEADCipherGetter)
func RegistBlock ¶
func RegistBlock(cip string, getter BlockCipherGetter)
func RegistStream ¶
func RegistStream(cip string, getter StreamCipherGetter)
Types ¶
type PadderPair ¶
func PKCS5Padding ¶
func PKCS5Padding() PadderPair
func PKCS7Padding ¶
func PKCS7Padding() PadderPair
type StreamCipherGetter ¶
type VAEAD ¶
func (*VAEAD) DecryptData ¶
type VBlock ¶
func (*VBlock) CBC ¶
func (v *VBlock) CBC(iv []byte, pair PadderPair) *VBlockModePair
type VBlockModePair ¶
type VBlockModePair struct { E cipher.BlockMode D cipher.BlockMode // contains filtered or unexported fields }
func NewVBlockMode ¶
func NewVBlockMode(e, d cipher.BlockMode, p Padder, un UnPadder) *VBlockModePair
func (*VBlockModePair) DecryptData ¶
func (v *VBlockModePair) DecryptData(ciphertext []byte) ([]byte, error)
func (*VBlockModePair) EncryptData ¶
func (v *VBlockModePair) EncryptData(plaintext []byte) ([]byte, error)
type VStream ¶
func NewVStream ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.