...
1
2
3
4
5
6
7 package blake2s
8
9 import "golang.org/x/sys/cpu"
10
11 var (
12 useSSE4 = false
13 useSSSE3 = cpu.X86.HasSSSE3
14 useSSE2 = cpu.X86.HasSSE2
15 )
16
17
18 func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte)
19
20
21 func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte)
22
23 func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) {
24 switch {
25 case useSSSE3:
26 hashBlocksSSSE3(h, c, flag, blocks)
27 case useSSE2:
28 hashBlocksSSE2(h, c, flag, blocks)
29 default:
30 hashBlocksGeneric(h, c, flag, blocks)
31 }
32 }
33
View as plain text