This repository has been archived on 2024-04-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
elektron/vendor/golang.org/x/crypto/poly1305/sum_amd64.go

23 lines
694 B
Go
Raw Normal View History

2018-09-30 18:02:42 -07:00
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build amd64,!gccgo,!appengine
package poly1305
2019-10-24 19:55:06 -04:00
// This function is implemented in sum_amd64.s
2018-09-30 18:02:42 -07:00
//go:noescape
2019-10-24 19:55:06 -04:00
func poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]byte)
2018-09-30 18:02:42 -07:00
// Sum generates an authenticator for m using a one-time key and puts the
// 16-byte result into out. Authenticating two different messages with the same
// key allows an attacker to forge messages at will.
func Sum(out *[16]byte, m []byte, key *[32]byte) {
2019-10-24 19:55:06 -04:00
var mPtr *byte
if len(m) > 0 {
mPtr = &m[0]
2018-09-30 18:02:42 -07:00
}
2019-10-24 19:55:06 -04:00
poly1305(out, mPtr, uint64(len(m)), key)
2018-09-30 18:02:42 -07:00
}