"crypto/cipher"
"crypto/ecdh"
"crypto/elliptic"
- "crypto/internal/bigmod"
"crypto/internal/boring"
"crypto/internal/boring/bbig"
+ "crypto/internal/fips/bigmod"
"crypto/internal/fips/nistec"
"crypto/internal/randutil"
"crypto/sha512"
"bytes"
"compress/bzip2"
"crypto/elliptic"
- "crypto/internal/bigmod"
+ "crypto/internal/fips/bigmod"
"crypto/rand"
"crypto/sha1"
"crypto/sha256"
-module std/crypto/internal/bigmod/_asm
+module std/crypto/internal/fips/bigmod/_asm
go 1.19
//go:generate go run . -out ../nat_amd64.s -pkg bigmod
func main() {
- Package("crypto/internal/bigmod")
+ Package("crypto/internal/fips/bigmod")
ConstraintExpr("!purego")
addMulVVW(1024)
package bigmod
import (
+ "crypto/internal/fipsdeps/byteorder"
"errors"
- "internal/byteorder"
"math/bits"
)
// big-endian encoded uint value.
func bigEndianUint(buf []byte) uint {
if _W == 64 {
- return uint(byteorder.BeUint64(buf))
+ return uint(byteorder.BEUint64(buf))
}
- return uint(byteorder.BeUint32(buf))
+ return uint(byteorder.BEUint32(buf))
}
func (x *Nat) setBytes(b []byte) error {
package bigmod
-import "internal/cpu"
+import (
+ "crypto/internal/fipsdeps/cpu"
+ "crypto/internal/impl"
+)
// amd64 assembly uses ADCX/ADOX/MULX if ADX is available to run two carry
// chains in the flags in parallel across the whole operation, and aggressively
// amd64 without ADX, perform better than the compiler output.
// TODO(filippo): file cmd/compile performance issue.
-var supportADX = cpu.X86.HasADX && cpu.X86.HasBMI2
+var supportADX = cpu.X86HasADX && cpu.X86HasBMI2
+
+func init() {
+ if cpu.AMD64 {
+ impl.Register("aes", "ADX", &supportADX)
+ }
+}
//go:noescape
func addMulVVW1024(z, x *uint, y uint) (c uint)
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// derived from crypto/internal/bigmod/nat_riscv64.s
+// derived from crypto/internal/fips/bigmod/nat_riscv64.s
//go:build !purego
var S390XHasSHA3 = cpu.S390X.HasSHA3
var S390XHasSHA512 = cpu.S390X.HasSHA512
var X86HasAES = cpu.X86.HasAES
+var X86HasADX = cpu.X86.HasADX
var X86HasAVX = cpu.X86.HasAVX
var X86HasAVX2 = cpu.X86.HasAVX2
var X86HasBMI2 = cpu.X86.HasBMI2
import (
"crypto"
- "crypto/internal/bigmod"
"crypto/internal/boring"
"crypto/internal/boring/bbig"
+ "crypto/internal/fips/bigmod"
"crypto/internal/randutil"
"crypto/rand"
"crypto/subtle"
< crypto/internal/fips/ssh
< crypto/internal/fips/tls12
< crypto/internal/fips/tls13
+ < crypto/internal/fips/bigmod
< crypto/internal/fips/nistec/fiat
< crypto/internal/fips/nistec
< crypto/internal/fips/ecdh
< encoding/asn1
< golang.org/x/crypto/cryptobyte/asn1
< golang.org/x/crypto/cryptobyte
- < crypto/internal/bigmod
< crypto/dsa, crypto/elliptic, crypto/rsa
< crypto/ecdsa
< CRYPTO-MATH;