1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-02 23:35:40 -05:00
This commit is contained in:
v2ray
2016-07-26 21:21:22 +02:00
parent 347ae8fd75
commit 0040881b84
2 changed files with 6 additions and 0 deletions

View File

@@ -6,6 +6,8 @@ import (
"github.com/v2ray/v2ray-core/common/crypto/internal"
)
// NewChaCha20Stream creates a new Chacha20 encryption/descryption stream based on give key and IV.
// Caller must ensure the length of key is 32 bytes, and length of IV is either 8 or 12 bytes.
func NewChaCha20Stream(key []byte, iv []byte) cipher.Stream {
return internal.NewChaCha20Stream(key, iv, 20)
}