diff options
Diffstat (limited to 'libgo/go/crypto/aes/cipher.go')
-rw-r--r-- | libgo/go/crypto/aes/cipher.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libgo/go/crypto/aes/cipher.go b/libgo/go/crypto/aes/cipher.go index 2c6bb0a..04d2be1 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 } |