OSDN Git Service

new repo
[bytom/vapor.git] / vendor / golang.org / x / crypto / blake2s / blake2s_386.go
1 // Copyright 2016 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // +build 386,!gccgo,!appengine
6
7 package blake2s
8
9 var (
10         useSSE4  = false
11         useSSSE3 = supportSSSE3()
12         useSSE2  = supportSSE2()
13 )
14
15 //go:noescape
16 func supportSSE2() bool
17
18 //go:noescape
19 func supportSSSE3() bool
20
21 //go:noescape
22 func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte)
23
24 //go:noescape
25 func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte)
26
27 func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) {
28         if useSSSE3 {
29                 hashBlocksSSSE3(h, c, flag, blocks)
30         } else if useSSE2 {
31                 hashBlocksSSE2(h, c, flag, blocks)
32         } else {
33                 hashBlocksGeneric(h, c, flag, blocks)
34         }
35 }