github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/sm4/cipher_generic.go (about)

     1  //go:build !amd64 && !arm64
     2  // +build !amd64,!arm64
     3  
     4  package sm4
     5  
     6  import "crypto/cipher"
     7  
     8  // newCipher calls the newCipherGeneric function
     9  // directly. Platforms with hardware accelerated
    10  // implementations of SM4 should implement their
    11  // own version of newCipher (which may then call
    12  // newCipherGeneric if needed).
    13  func newCipher(key []byte) (cipher.Block, error) {
    14  	return newCipherGeneric(key)
    15  }
    16  
    17  // expandKey is used by BenchmarkExpand and should
    18  // call an assembly implementation if one is available.
    19  func expandKey(key []byte, enc, dec []uint32) {
    20  	expandKeyGo(key, enc, dec)
    21  }