This commit is contained in:
Wade Simmons
2026-06-09 10:30:51 -04:00
parent 7cd3875934
commit 06fb503fc3
8 changed files with 61 additions and 35 deletions
+12 -2
View File
@@ -4,10 +4,20 @@ package noiseutil
import (
"crypto/fips140"
"github.com/flynn/noise"
)
// EncryptLockNeeded indicates if calls to Encrypt need a lock
var EncryptLockNeeded = fips140.Enabled()
// CipherAESGCM is the standard noise.CipherAESGCM when boringcrypto is not enabled
// var CipherAESGCM noise.CipherFunc = noise.CipherAESGCM
var CipherAESGCM noise.CipherFunc = initAESGCM()
func initAESGCM() noise.CipherFunc {
if fips140.Enabled() {
return CipherAESGCMFIPS140
} else {
return noise.CipherAESGCM
}
}