mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
562 B
24 lines
562 B
9 years ago
|
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) {}
|