mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-09-05 19:44:32 -04:00
24 lines
562 B
Go
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) {}
|