Documentation ¶
Index ¶
- func CheckCipherMethod(method string) error
- type DecOrEnc
- type NoneStream
- type StreamCipher
- func (c *StreamCipher) Copy() *StreamCipher
- func (c *StreamCipher) Decrypt(dst, src []byte)
- func (c *StreamCipher) DecryptInited() bool
- func (c *StreamCipher) Encrypt(dst, src []byte)
- func (c *StreamCipher) EncryptInited() bool
- func (c *StreamCipher) IV() []byte
- func (c *StreamCipher) InfoIVLen() int
- func (c *StreamCipher) InfoKeyLen() int
- func (c *StreamCipher) InitDecrypt(iv []byte) (err error)
- func (c *StreamCipher) InitEncrypt() (iv []byte, err error)
- func (c *StreamCipher) Key() []byte
- func (c *StreamCipher) SetIV(iv []byte)
- func (c *StreamCipher) SetKey(key []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCipherMethod ¶
Types ¶
type NoneStream ¶
func (*NoneStream) XORKeyStream ¶
func (*NoneStream) XORKeyStream(dst, src []byte)
type StreamCipher ¶
type StreamCipher struct {
// contains filtered or unexported fields
}
func NewStreamCipher ¶
func NewStreamCipher(method, password string) (c *StreamCipher, err error)
NewStreamCipher creates a cipher that can be used in Dial() etc. Use cipher.Copy() to create a new cipher with the same method and password to avoid the cost of repeated cipher initialization.
func (*StreamCipher) Copy ¶
func (c *StreamCipher) Copy() *StreamCipher
Copy creates a new cipher at it's initial state.
func (*StreamCipher) Decrypt ¶
func (c *StreamCipher) Decrypt(dst, src []byte)
func (*StreamCipher) DecryptInited ¶
func (c *StreamCipher) DecryptInited() bool
func (*StreamCipher) Encrypt ¶
func (c *StreamCipher) Encrypt(dst, src []byte)
func (*StreamCipher) EncryptInited ¶
func (c *StreamCipher) EncryptInited() bool
func (*StreamCipher) IV ¶
func (c *StreamCipher) IV() []byte
func (*StreamCipher) InfoIVLen ¶
func (c *StreamCipher) InfoIVLen() int
func (*StreamCipher) InfoKeyLen ¶
func (c *StreamCipher) InfoKeyLen() int
func (*StreamCipher) InitDecrypt ¶
func (c *StreamCipher) InitDecrypt(iv []byte) (err error)
func (*StreamCipher) InitEncrypt ¶
func (c *StreamCipher) InitEncrypt() (iv []byte, err error)
Initializes the block cipher with CFB mode, returns IV.
func (*StreamCipher) Key ¶
func (c *StreamCipher) Key() []byte
func (*StreamCipher) SetIV ¶
func (c *StreamCipher) SetIV(iv []byte)
func (*StreamCipher) SetKey ¶
func (c *StreamCipher) SetKey(key []byte)
Click to show internal directories.
Click to hide internal directories.