mirror of
https://github.com/MetaCubeX/Clash.Meta.git
synced 2025-04-18 08:20:53 +00:00
fix
This commit is contained in:
parent
5209985a19
commit
89c2205d40
2 changed files with 8 additions and 0 deletions
|
@ -61,6 +61,7 @@ var streamList = map[string]struct {
|
|||
"AES-192-CFB": {24, shadowstream.AESCFB},
|
||||
"AES-256-CFB": {32, shadowstream.AESCFB},
|
||||
"CHACHA20": {32, shadowstream.ChaCha20},
|
||||
"CHACHA8-IETF": {32, shadowstream.Chacha8IETF},
|
||||
"CHACHA20-IETF": {32, shadowstream.Chacha20IETF},
|
||||
"XCHACHA20": {32, shadowstream.Xchacha20},
|
||||
}
|
||||
|
|
|
@ -86,6 +86,13 @@ func (k chacha8ietfkey) Encrypter(iv []byte) cipher.Stream {
|
|||
return ciph
|
||||
}
|
||||
|
||||
func Chacha8IETF(key []byte) (Cipher, error) {
|
||||
if len(key) != chacha8.KeySize {
|
||||
return nil, KeySizeError(chacha8.KeySize)
|
||||
}
|
||||
return chacha8ietfkey(key), nil
|
||||
}
|
||||
|
||||
type xchacha20key []byte
|
||||
|
||||
func (k xchacha20key) IVSize() int { return chacha20.NonceSizeX }
|
||||
|
|
Loading…
Add table
Reference in a new issue