gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/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 }