xor.go 617 B

123456789101112131415161718192021222324
  1. // Copyright 2015 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. //go:build (!amd64 && !386 && !ppc64le) || purego
  5. // +build !amd64,!386,!ppc64le purego
  6. package sha3
  7. // A storageBuf is an aligned array of maxRate bytes.
  8. type storageBuf [maxRate]byte
  9. func (b *storageBuf) asBytes() *[maxRate]byte {
  10. return (*[maxRate]byte)(b)
  11. }
  12. var (
  13. xorIn = xorInGeneric
  14. copyOut = copyOutGeneric
  15. xorInUnaligned = xorInGeneric
  16. copyOutUnaligned = copyOutGeneric
  17. )
  18. const xorImplementationUnaligned = "generic"