package sm3

import (
	"golang.org/x/sys/cpu"
)

var useAVX2 = cpu.X86.HasAVX2 && cpu.X86.HasBMI2

//go:noescape
func blockAsmAVX2(dig *digest, p []byte)

var block func(dig *digest, p []byte)

func init() {
	if useAVX2 {
		block = blockAsmAVX2
	} else {
		block = blockGeneric
	}
}

// BlockAsmAVX2 export blockAsmAVX2 for test
var BlockAsmAVX2 = blockAsmAVX2

// BlockGeneric export blockGeneric for test
var BlockGeneric = blockGeneric
