github.com/zebozhuang/go@v0.0.0-20200207033046-f8a98f6f5c5d/src/crypto/aes/cipher_generic.go (about)

     1  // Copyright 2012 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // +build !amd64,!s390x,!ppc64le
     6  
     7  package aes
     8  
     9  import (
    10  	"crypto/cipher"
    11  )
    12  
    13  // newCipher calls the newCipherGeneric function
    14  // directly. Platforms with hardware accelerated
    15  // implementations of AES should implement their
    16  // own version of newCipher (which may then call
    17  // newCipherGeneric if needed).
    18  func newCipher(key []byte) (cipher.Block, error) {
    19  	return newCipherGeneric(key)
    20  }
    21  
    22  // expandKey is used by BenchmarkExpand and should
    23  // call an assembly implementation if one is available.
    24  func expandKey(key []byte, enc, dec []uint32) {
    25  	expandKeyGo(key, enc, dec)
    26  }