From bf5456312c3c6f6243ec820103e0d4976f1c4c89 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Tue, 19 Feb 2013 19:15:01 +0800 Subject: [PATCH] go.crypto/{curve25519,poly1305,salsa20/salsa}: add //go:noescape annotation R=golang-dev, rsc, agl CC=golang-dev https://golang.org/cl/7319045 --- curve25519/mont25519_amd64.go | 15 +++++++++++++++ poly1305/sum_amd64.go | 3 +++ salsa20/salsa/salsa20_amd64.go | 3 +++ 3 files changed, 21 insertions(+) diff --git a/curve25519/mont25519_amd64.go b/curve25519/mont25519_amd64.go index 18a651a..3275877 100644 --- a/curve25519/mont25519_amd64.go +++ b/curve25519/mont25519_amd64.go @@ -9,10 +9,25 @@ package curve25519 // These functions are implemented in the .s files. The names of the functions // in the rest of the file are also taken from the SUPERCOP sources to help // people following along. + +//go:noescape + func cswap(inout *[5]uint64, v uint64) + +//go:noescape + func ladderstep(inout *[5][5]uint64) + +//go:noescape + func freeze(inout *[5]uint64) + +//go:noescape + func mul(dest, a, b *[5]uint64) + +//go:noescape + func square(out, in *[5]uint64) // mladder uses a Montgomery ladder to calculate (xr/zr) *= s. diff --git a/poly1305/sum_amd64.go b/poly1305/sum_amd64.go index fba23b8..eb22ca1 100644 --- a/poly1305/sum_amd64.go +++ b/poly1305/sum_amd64.go @@ -7,6 +7,9 @@ package poly1305 // This function is implemented in poly1305_amd64.s + +//go:noescape + func poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]byte) // Sum generates an authenticator for m using a one-time key and puts the diff --git a/salsa20/salsa/salsa20_amd64.go b/salsa20/salsa/salsa20_amd64.go index 8a316ed..903c785 100644 --- a/salsa20/salsa/salsa20_amd64.go +++ b/salsa20/salsa/salsa20_amd64.go @@ -7,6 +7,9 @@ package salsa // This function is implemented in salsa2020_amd64.s. + +//go:noescape + func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte) // XORKeyStream crypts bytes from in to out using the given key and counters.