mirror of
https://github.com/emmansun/gmsm.git
synced 2025-05-12 03:56:17 +08:00
internal/cpu: move to internal/deps/cpu #310
This commit is contained in:
parent
c43e0488a6
commit
a84fec09af
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
package bigmod
|
package bigmod
|
||||||
|
|
||||||
import "github.com/emmansun/gmsm/internal/cpu"
|
import "github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
|
|
||||||
// amd64 assembly uses ADCX/ADOX/MULX if ADX is available to run two carry
|
// 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
|
// chains in the flags in parallel across the whole operation, and aggressively
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package cpuid
|
package cpuid
|
||||||
|
|
||||||
import "github.com/emmansun/gmsm/internal/cpu"
|
import "github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
HasAES = cpu.X86.HasAES
|
HasAES = cpu.X86.HasAES
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
package cpuid
|
package cpuid
|
||||||
|
|
||||||
import "github.com/emmansun/gmsm/internal/cpu"
|
import "github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
HasAES = cpu.ARM64.HasAES
|
HasAES = cpu.ARM64.HasAES
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/emmansun/gmsm/internal/cpu"
|
"github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
)
|
)
|
||||||
|
|
||||||
var s390xTests = []struct {
|
var s390xTests = []struct {
|
@ -9,7 +9,7 @@ package cpu_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
. "github.com/emmansun/gmsm/internal/cpu"
|
. "github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestX86ifAVX2hasAVX(t *testing.T) {
|
func TestX86ifAVX2hasAVX(t *testing.T) {
|
@ -8,7 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/emmansun/gmsm/internal/cpu"
|
"github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestIsBigEndian(t *testing.T) {
|
func TestIsBigEndian(t *testing.T) {
|
@ -19,7 +19,7 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/emmansun/gmsm/internal/byteorder"
|
"github.com/emmansun/gmsm/internal/byteorder"
|
||||||
"github.com/emmansun/gmsm/internal/cpu"
|
"github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
)
|
)
|
||||||
|
|
||||||
// p256Element is a P-256 base field element in [0, P-1] in the Montgomery
|
// p256Element is a P-256 base field element in [0, P-1] in the Montgomery
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
package sm3
|
package sm3
|
||||||
|
|
||||||
import "github.com/emmansun/gmsm/internal/cpu"
|
import "github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
|
|
||||||
var useAVX2 = cpu.X86.HasAVX2 && cpu.X86.HasBMI2
|
var useAVX2 = cpu.X86.HasAVX2 && cpu.X86.HasBMI2
|
||||||
var useAVX = cpu.X86.HasAVX
|
var useAVX = cpu.X86.HasAVX
|
||||||
|
@ -4,7 +4,7 @@ package sm3
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"github.com/emmansun/gmsm/internal/cpu"
|
"github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
)
|
)
|
||||||
|
|
||||||
var useSM3NI = cpu.ARM64.HasSM3 && os.Getenv("DISABLE_SM3NI") != "1"
|
var useSM3NI = cpu.ARM64.HasSM3 && os.Getenv("DISABLE_SM3NI") != "1"
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/emmansun/gmsm/internal/alias"
|
"github.com/emmansun/gmsm/internal/alias"
|
||||||
"github.com/emmansun/gmsm/internal/cpu"
|
|
||||||
"github.com/emmansun/gmsm/internal/cpuid"
|
"github.com/emmansun/gmsm/internal/cpuid"
|
||||||
|
"github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
)
|
)
|
||||||
|
|
||||||
var supportSM4 = cpu.ARM64.HasSM4 && os.Getenv("DISABLE_SM4NI") != "1"
|
var supportSM4 = cpu.ARM64.HasSM4 && os.Getenv("DISABLE_SM4NI") != "1"
|
||||||
|
@ -6,7 +6,7 @@ package bn256
|
|||||||
// assembly implementations of these functions, provided that they exist.
|
// assembly implementations of these functions, provided that they exist.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/emmansun/gmsm/internal/cpu"
|
"github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
)
|
)
|
||||||
|
|
||||||
// amd64 assembly uses ADCX/ADOX/MULX if ADX is available to run two carry
|
// amd64 assembly uses ADCX/ADOX/MULX if ADX is available to run two carry
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
package bn256
|
package bn256
|
||||||
|
|
||||||
import "github.com/emmansun/gmsm/internal/cpu"
|
import "github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
|
|
||||||
var supportAVX2 = cpu.X86.HasAVX2
|
var supportAVX2 = cpu.X86.HasAVX2
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
package zuc
|
package zuc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/emmansun/gmsm/internal/cpu"
|
|
||||||
"github.com/emmansun/gmsm/internal/cpuid"
|
"github.com/emmansun/gmsm/internal/cpuid"
|
||||||
|
"github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Generate single keyword, 4 bytes.
|
// Generate single keyword, 4 bytes.
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/emmansun/gmsm/internal/cpu"
|
"github.com/emmansun/gmsm/internal/deps/cpu"
|
||||||
"github.com/emmansun/gmsm/internal/cryptotest"
|
"github.com/emmansun/gmsm/internal/cryptotest"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user