1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-29 13:35:20 -05:00
Files
v2fly/common/crypto/aes.go

18 lines
364 B
Go

package crypto
import (
"crypto/aes"
"crypto/cipher"
"io"
)
func NewAesDecryptionStream(key []byte, iv []byte) cipher.Stream {
aesBlock, _ := aes.NewCipher(key)
return cipher.NewCFBDecrypter(aesBlock, iv)
}
func NewAesEncryptionStream(key []byte, iv []byte) cipher.Stream {
aesBlock, _ := aes.NewCipher(key)
return cipher.NewCFBEncrypter(aesBlock, iv)
}