notboring.go 419 B

12345678910111213141516171819202122232425
  1. //go:build !boringcrypto
  2. package noiseutil
  3. import (
  4. "crypto/fips140"
  5. "github.com/flynn/noise"
  6. )
  7. // EncryptLockNeeded indicates if calls to Encrypt need a lock
  8. var EncryptLockNeeded = fips140.Enabled()
  9. var CipherAESGCM noise.CipherFunc = initAESGCM()
  10. func initAESGCM() noise.CipherFunc {
  11. if fips140.Enabled() {
  12. return CipherAESGCMFIPS140
  13. } else {
  14. return noise.CipherAESGCM
  15. }
  16. }
  17. var boringEnabled = false