github.com/emmansun/gmsm@v0.29.1/cipher/xts_generic.go (about)

     1  //go:build purego || !(amd64 || arm64 || s390x || ppc64 || ppc64le)
     2  
     3  package cipher
     4  
     5  func mul2(tweak *[blockSize]byte, isGB bool) {
     6  	mul2Generic(tweak, isGB)
     7  }
     8  
     9  func doubleTweaks(tweak *[blockSize]byte, tweaks []byte, isGB bool) {
    10  	count := len(tweaks) >> 4
    11  	for i := 0; i < count; i++ {
    12  		copy(tweaks[blockSize*i:], tweak[:])
    13  		mul2(tweak, isGB)
    14  	}
    15  }