mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 18:13:42 +08:00 
			
		
		
		
	go.mod: golang.org/x/crypto v0.1.0
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
		
							
								
								
									
										6
									
								
								vendor/golang.org/x/crypto/nacl/sign/sign.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								vendor/golang.org/x/crypto/nacl/sign/sign.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -24,7 +24,7 @@ import (
 | 
			
		||||
	"io"
 | 
			
		||||
 | 
			
		||||
	"golang.org/x/crypto/ed25519"
 | 
			
		||||
	"golang.org/x/crypto/internal/subtle"
 | 
			
		||||
	"golang.org/x/crypto/internal/alias"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Overhead is the number of bytes of overhead when signing a message.
 | 
			
		||||
@@ -48,7 +48,7 @@ func GenerateKey(rand io.Reader) (publicKey *[32]byte, privateKey *[64]byte, err
 | 
			
		||||
func Sign(out, message []byte, privateKey *[64]byte) []byte {
 | 
			
		||||
	sig := ed25519.Sign(ed25519.PrivateKey((*privateKey)[:]), message)
 | 
			
		||||
	ret, out := sliceForAppend(out, Overhead+len(message))
 | 
			
		||||
	if subtle.AnyOverlap(out, message) {
 | 
			
		||||
	if alias.AnyOverlap(out, message) {
 | 
			
		||||
		panic("nacl: invalid buffer overlap")
 | 
			
		||||
	}
 | 
			
		||||
	copy(out, sig)
 | 
			
		||||
@@ -67,7 +67,7 @@ func Open(out, signedMessage []byte, publicKey *[32]byte) ([]byte, bool) {
 | 
			
		||||
		return nil, false
 | 
			
		||||
	}
 | 
			
		||||
	ret, out := sliceForAppend(out, len(signedMessage)-Overhead)
 | 
			
		||||
	if subtle.AnyOverlap(out, signedMessage) {
 | 
			
		||||
	if alias.AnyOverlap(out, signedMessage) {
 | 
			
		||||
		panic("nacl: invalid buffer overlap")
 | 
			
		||||
	}
 | 
			
		||||
	copy(out, signedMessage[Overhead:])
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user