This commit is contained in:
Darien Raymond
2019-02-23 00:01:23 +01:00
parent 7e5e080488
commit 95ed5a5ff8
3 changed files with 7 additions and 0 deletions
+2
View File
@@ -25,10 +25,12 @@ func NewAesStreamMethod(key []byte, iv []byte, f func(cipher.Block, []byte) ciph
return f(aesBlock, iv)
}
// NewAesCTRStream creates a stream cipher based on AES-CTR.
func NewAesCTRStream(key []byte, iv []byte) cipher.Stream {
return NewAesStreamMethod(key, iv, cipher.NewCTR)
}
// NewAesGcm creates a AEAD cipher based on AES-GCM.
func NewAesGcm(key []byte) cipher.AEAD {
block, err := aes.NewCipher(key)
common.Must(err)