1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-07-07 13:54:27 -04:00
v2fly/common/crypto/aes.go

17 lines
358 B
Go
Raw Normal View History

2015-11-03 15:26:16 -05:00
package crypto
import (
"crypto/aes"
"crypto/cipher"
)
2016-02-25 15:50:10 -05:00
func NewAesDecryptionStream(key []byte, iv []byte) cipher.Stream {
aesBlock, _ := aes.NewCipher(key)
return cipher.NewCFBDecrypter(aesBlock, iv)
2015-11-03 15:26:16 -05:00
}
2016-02-25 15:50:10 -05:00
func NewAesEncryptionStream(key []byte, iv []byte) cipher.Stream {
aesBlock, _ := aes.NewCipher(key)
return cipher.NewCFBEncrypter(aesBlock, iv)
2015-11-03 15:26:16 -05:00
}