aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/crypto/aes/cipher.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/crypto/aes/cipher.go')
-rw-r--r--libgo/go/crypto/aes/cipher.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/libgo/go/crypto/aes/cipher.go b/libgo/go/crypto/aes/cipher.go
index 2c6bb0a89c7..04d2be1283f 100644
--- a/libgo/go/crypto/aes/cipher.go
+++ b/libgo/go/crypto/aes/cipher.go
@@ -38,9 +38,14 @@ func NewCipher(key []byte) (cipher.Block, error) {
}
n := k + 28
- c := &aesCipher{make([]uint32, n), make([]uint32, n)}
+ c := aesCipher{make([]uint32, n), make([]uint32, n)}
expandKey(key, c.enc, c.dec)
- return c, nil
+
+ if hasGCMAsm() {
+ return &aesCipherGCM{c}, nil
+ }
+
+ return &c, nil
}
func (c *aesCipher) BlockSize() int { return BlockSize }