1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-19 02:46:33 -05:00
v2fly/transport/internet/kcp/crypt.go
2016-06-14 23:25:06 +02:00

24 lines
562 B
Go

package kcp
type BlockCrypt interface {
// Encrypt encrypts the whole block in src into dst.
// Dst and src may point at the same memory.
Encrypt(dst, src []byte)
// Decrypt decrypts the whole block in src into dst.
// Dst and src may point at the same memory.
Decrypt(dst, src []byte)
}
// None Encryption
type NoneBlockCrypt struct {
xortbl []byte
}
func NewNoneBlockCrypt(key []byte) (BlockCrypt, error) {
return new(NoneBlockCrypt), nil
}
func (c *NoneBlockCrypt) Encrypt(dst, src []byte) {}
func (c *NoneBlockCrypt) Decrypt(dst, src []byte) {}