sum_noasm.go 565 B

12345678910111213141516
  1. // Copyright 2018 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 s390x,!go1.11 !arm,!amd64,!s390x,!ppc64le gccgo appengine nacl
  5. package poly1305
  6. // Sum generates an authenticator for msg using a one-time key and puts the
  7. // 16-byte result into out. Authenticating two different messages with the same
  8. // key allows an attacker to forge messages at will.
  9. func Sum(out *[TagSize]byte, msg []byte, key *[32]byte) {
  10. h := newMAC(key)
  11. h.Write(msg)
  12. h.Sum(out)
  13. }