mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-06 18:28:00 -05:00
17 lines
358 B
Go
17 lines
358 B
Go
package crypto
|
|
|
|
import (
|
|
"crypto/aes"
|
|
"crypto/cipher"
|
|
)
|
|
|
|
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)
|
|
}
|