Kaynağa Gözat

go.crypto/{curve25519,poly1305,salsa20/salsa}: add //go:noescape annotation

R=golang-dev, rsc, agl
CC=golang-dev
https://golang.org/cl/7319045
Shenghou Ma 12 yıl önce
ebeveyn
işleme
bf5456312c

+ 15 - 0
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.

+ 3 - 0
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

+ 3 - 0
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.