diff --git a/Makefile b/Makefile index e7534be..87423a4 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,17 @@ BENCH_OPTS ?= -v -bench=. -run="^_" -benchmem TEST_PATH ?= ./... DBG = 1 OPTS_ENV = +OPTS_TAGS ?= -tags noasm +ARCH = $(shell uname -m) + +ifeq ($(ARCH), ppc64le) + NOASM+=1 +endif + +ifeq ($(ARCH), riscv64) + NOASM+=1 + OPTS_TAGS+= -timeout 0 +endif ifeq ($(NOASM),1) OPTS+=$(OPTS_TAGS) diff --git a/dh/csidh/fp511.go b/dh/csidh/fp511.go index 1bc1292..0dfc5fe 100644 --- a/dh/csidh/fp511.go +++ b/dh/csidh/fp511.go @@ -1,3 +1,5 @@ +// +build noasm amd64 arm64 ppc64le riscv64 + package csidh import ( diff --git a/drbg/internal/aes/aes_test.go b/drbg/internal/aes/aes_test.go index 377c5f3..df54d40 100644 --- a/drbg/internal/aes/aes_test.go +++ b/drbg/internal/aes/aes_test.go @@ -1,6 +1,8 @@ // Copyright 2009 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 noasm amd64 arm64 ppc64le riscv64 + package aes diff --git a/drbg/internal/aes/cipher.go b/drbg/internal/aes/cipher.go index db233df..8e4bc72 100644 --- a/drbg/internal/aes/cipher.go +++ b/drbg/internal/aes/cipher.go @@ -1,6 +1,7 @@ // Copyright 2009 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 noasm amd64 arm64 ppc64le riscv64 package aes diff --git a/drbg/internal/aes/cipher_noasm.go b/drbg/internal/aes/cipher_noasm.go new file mode 100644 index 0000000..5c66bf5 --- /dev/null +++ b/drbg/internal/aes/cipher_noasm.go @@ -0,0 +1,27 @@ +// +build noasm ppc64le riscv64 + +package aes + +import( + "errors" +) + +type AESAsm struct { +} + +func (a *AESAsm) SetKey(key []byte) error { + panic("NotImplemented") + return errors.New("ErrNotImplemented") +} + +func (a *AESAsm) Encrypt(dst, src []byte) { + panic("NotImplemented") +} + +func (a *AESAsm) Decrypt(dst, src []byte) { + panic("NotImplemented") +} + +func expandKey(key []byte, enc, dec []uint32) { + expandKeyGo(key, enc, dec) +} diff --git a/drbg/internal/aes/generic.go b/drbg/internal/aes/generic.go index 53308ae..88fac78 100644 --- a/drbg/internal/aes/generic.go +++ b/drbg/internal/aes/generic.go @@ -1,6 +1,7 @@ // Copyright 2009 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 noasm amd64 arm64 ppc64le riscv64 // This Go implementation is derived in part from the reference // ANSI C implementation, which carries the following notice: