1
0

blake2s_386.go 817 B

123456789101112131415161718192021222324252627282930313233343536
  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. // +build 386,!gccgo,!appengine
  5. package blake2s
  6. var (
  7. useSSE4 = false
  8. useSSSE3 = supportSSSE3()
  9. useSSE2 = supportSSE2()
  10. useGeneric = true
  11. )
  12. //go:noescape
  13. func supportSSE2() bool
  14. //go:noescape
  15. func supportSSSE3() bool
  16. //go:noescape
  17. func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte)
  18. //go:noescape
  19. func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte)
  20. func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) {
  21. if useSSSE3 {
  22. hashBlocksSSSE3(h, c, flag, blocks)
  23. } else if useSSE2 {
  24. hashBlocksSSE2(h, c, flag, blocks)
  25. } else {
  26. hashBlocksGeneric(h, c, flag, blocks)
  27. }
  28. }