libgo: update to Go 1.11
[official-gcc.git] / libgo / go / golang_org / x / crypto / poly1305 / sum_amd64.go
blob4dd72fe799b2d3524b9af7457df67fbad4444170
1 // Copyright 2012 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.
5 // +build amd64,!gccgo,!appengine
7 package poly1305
9 // This function is implemented in sum_amd64.s
10 //go:noescape
11 func poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]byte)
13 // Sum generates an authenticator for m using a one-time key and puts the
14 // 16-byte result into out. Authenticating two different messages with the same
15 // key allows an attacker to forge messages at will.
16 func Sum(out *[16]byte, m []byte, key *[32]byte) {
17 var mPtr *byte
18 if len(m) > 0 {
19 mPtr = &m[0]
21 poly1305(out, mPtr, uint64(len(m)), key)