mirror of
https://github.com/slackhq/nebula.git
synced 2026-07-01 19:10:29 +02:00
26 lines
419 B
Go
26 lines
419 B
Go
//go:build !boringcrypto
|
|
|
|
package noiseutil
|
|
|
|
import (
|
|
"crypto/fips140"
|
|
|
|
"github.com/flynn/noise"
|
|
)
|
|
|
|
// EncryptLockNeeded indicates if calls to Encrypt need a lock
|
|
var EncryptLockNeeded = fips140.Enabled()
|
|
|
|
var CipherAESGCM noise.CipherFunc = initAESGCM()
|
|
|
|
func initAESGCM() noise.CipherFunc {
|
|
if fips140.Enabled() {
|
|
return CipherAESGCMFIPS140
|
|
} else {
|
|
return noise.CipherAESGCM
|
|
}
|
|
|
|
}
|
|
|
|
var boringEnabled = false
|