mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 03:19:36 +03:00
Add xchacha20-ietf-poly1305 for Shadowsocks
This commit is contained in:
@ -43,6 +43,14 @@ func GenerateInitialAEADNonce() BytesGenerator {
|
||||
return GenerateIncreasingNonce([]byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF})
|
||||
}
|
||||
|
||||
func GenerateAEADNonceWithSize(nonceSize int) BytesGenerator {
|
||||
c := make([]byte, nonceSize)
|
||||
for i := 0; i < nonceSize; i++ {
|
||||
c[i] = 0xFF
|
||||
}
|
||||
return GenerateIncreasingNonce(c)
|
||||
}
|
||||
|
||||
type Authenticator interface {
|
||||
NonceSize() int
|
||||
Overhead() int
|
||||
|
Reference in New Issue
Block a user