mirror of
				https://github.com/tailscale/tailscale.git
				synced 2025-11-03 17:51:28 +01:00 
			
		
		
		
	I earlier thought this saved a second of CPU even on a fast machine, but I think when I was previously measuring, I still had a 4096 bit RSA key being generated in the code I was measuring. Measuring again for this, it's plenty fast. Prep for using this package more, for derp, etc. Updates #16315 Change-Id: I4c9008efa9aa88a3d65409d6ffd7b3807f4d75e9 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
		
			
				
	
	
		
			22 lines
		
	
	
		
			396 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			396 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright (c) Tailscale Inc & AUTHORS
 | 
						|
// SPDX-License-Identifier: BSD-3-Clause
 | 
						|
 | 
						|
package tlstest
 | 
						|
 | 
						|
import (
 | 
						|
	"testing"
 | 
						|
)
 | 
						|
 | 
						|
func TestPrivateKey(t *testing.T) {
 | 
						|
	a := privateKey("a.tstest")
 | 
						|
	a2 := privateKey("a.tstest")
 | 
						|
	b := privateKey("b.tstest")
 | 
						|
 | 
						|
	if string(a) != string(a2) {
 | 
						|
		t.Errorf("a and a2 should be equal")
 | 
						|
	}
 | 
						|
	if string(a) == string(b) {
 | 
						|
		t.Errorf("a and b should not be equal")
 | 
						|
	}
 | 
						|
}
 |