1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-30 05:55:20 -05:00

Add ChaCha20 in Shadowsocks

This commit is contained in:
v2ray
2016-02-23 18:16:13 +01:00
parent 65819228c1
commit 87b15b2b20
5 changed files with 88 additions and 22 deletions

View File

@@ -35,6 +35,14 @@ func (this *Config) UnmarshalJSON(data []byte) error {
this.Cipher = &AesCfb{
KeyBytes: 16,
}
case "chacha20":
this.Cipher = &ChaCha20{
IVBytes: 8,
}
case "chacha20-ietf":
this.Cipher = &ChaCha20{
IVBytes: 12,
}
default:
log.Error("Shadowsocks: Unknown cipher method: ", jsonConfig.Cipher)
return internal.ErrorBadConfiguration