Add xchacha20-ietf-poly1305 for Shadowsocks

This commit is contained in:
maskedeken authored and 世界 committed 2021-10-22 13:24:29 +08:00
1 parent 3fe61ed4a2
commit 238bd5d050
5 files changed
+52 -23

No files matched your search

+8
View File
@@ -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