aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/internal/cipherhw/cipherhw_amd64.go
blob: a1267b17a291f6cff1d23dbd4593ab1010c47b3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build amd64,!gccgo,!appengine

package cipherhw

import "crypto/internal/boring"

// defined in asm_amd64.s
func hasAESNI() bool

// AESGCMSupport returns true if the Go standard library supports AES-GCM in
// hardware.
func AESGCMSupport() bool {
	// If BoringCrypto is enabled, we report having
	// AES-GCM support, so that crypto/tls will
	// prioritize AES-GCM usage.
	if boring.Enabled {
		return true
	}
	return hasAESNI()
}