Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure against riscv64 #666

Closed
paralin opened this issue Jun 25, 2022 · 7 comments
Closed

Build failure against riscv64 #666

paralin opened this issue Jun 25, 2022 · 7 comments

Comments

@paralin
Copy link
Contributor

paralin commented Jun 25, 2022

github.com/jacobsa/crypto/cmac
golang.org/x/sys/cpu
# github.com/jacobsa/crypto/cmac
vendor/github.com/jacobsa/crypto/cmac/hash.go:97:3: undefined: xorBlock

See: http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/build-end.log

@paralin
Copy link
Contributor Author

paralin commented Jun 25, 2022

Riscv: jacobsa/crypto#13
Fixed by this PR: jacobsa/crypto#14

paralin added a commit to paralin/gocryptfs that referenced this issue Jun 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Issue: rfjakob#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jun 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
@paralin
Copy link
Contributor Author

paralin commented Jun 25, 2022

paralin added a commit to paralin/gocryptfs that referenced this issue Jun 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Issue: rfjakob#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jun 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jun 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jun 27, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jun 27, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 8, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 11, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to paralin/gocryptfs that referenced this issue Jul 14, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Issue: rfjakob#666

Upstream PR: jacobsa/crypto#13

Unaddressed on jacobsa/crypto:

jacobsa/crypto#14 (comment)

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 14, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 15, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 15, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 19, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 24, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 24, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 25, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Jul 26, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
@rfjakob
Copy link
Owner

rfjakob commented Jul 31, 2022

That jacobsa/crypto is unmaintained is a problem.

Does https://github.com/google/tink/blob/master/go/daead/subtle/aes_siv.go work on RISC-V ?

@paralin
Copy link
Contributor Author

paralin commented Jul 31, 2022

Probably. I don't see why not. I can test it soon

paralin added a commit to skiffos/buildroot that referenced this issue Aug 2, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to skiffos/buildroot that referenced this issue Aug 2, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this issue Aug 2, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
@rfjakob
Copy link
Owner

rfjakob commented Sep 5, 2022

Looks like tink won't work as it only supports a single associated data string: https://github.com/google/tink/blob/214697ad4ad090947ffbfe7b5e9a1c7ee46c6058/go/daead/subtle/aes_siv.go#L114
gocryptfs uses two.

@rfjakob
Copy link
Owner

rfjakob commented Sep 5, 2022

For posterity: Speed of tink is a little slower but acceptable

gocryptfs/internal/speed $ go test -bench .
BenchmarkAESSIV-4                 	   64172	     18444 ns/op	 222.07 MB/s
BenchmarkTinkAESSIV-4             	   55764	     21730 ns/op	 188.50 MB/s
diff --git a/internal/speed/speed.go b/internal/speed/speed.go
index aef3ad6..75b21b3 100644
--- a/internal/speed/speed.go
+++ b/internal/speed/speed.go
@@ -14,6 +14,8 @@ import (
 
 	"golang.org/x/crypto/chacha20poly1305"
 
+	"github.com/google/tink/go/daead/subtle"
+
 	"github.com/rfjakob/gocryptfs/v2/internal/cryptocore"
 	"github.com/rfjakob/gocryptfs/v2/internal/siv_aead"
 	"github.com/rfjakob/gocryptfs/v2/internal/stupidgcm"
@@ -97,7 +99,32 @@ func bEncrypt(b *testing.B, c cipher.AEAD) {
 		// Encrypt and append to nonce
 		c.Seal(dst, iv, in, authData)
 	}
+}
+
+func bTinkAESSIV(b *testing.B) {
+	c, err := subtle.NewAESSIV(randBytes(64))
+	if err != nil {
+		panic(err)
+	}
+
+	authData := randBytes(adLen)
+	iv := randBytes(16)
+	in := make([]byte, blockSize)
+	dst := make([]byte, len(in)+len(iv)+16)
+	copy(dst, iv)
 
+	b.SetBytes(int64(len(in)))
+	b.ResetTimer()
+	for i := 0; i < b.N; i++ {
+		// Reset dst buffer
+		dst = dst[:len(iv)]
+		// Encrypt and append to nonce
+		o, err := c.EncryptDeterministically(in, authData)
+		if err != nil {
+			panic(err)
+		}
+		dst = append(dst, o...)
+	}
 }
 
 func bDecrypt(b *testing.B, c cipher.AEAD) {
diff --git a/internal/speed/speed_test.go b/internal/speed/speed_test.go
index 5f3001b..261af4f 100644
--- a/internal/speed/speed_test.go
+++ b/internal/speed/speed_test.go
@@ -82,3 +82,7 @@ func BenchmarkStupidChacha(b *testing.B) {
 func BenchmarkStupidChachaDecrypt(b *testing.B) {
 	bDecrypt(b, stupidgcm.NewChacha20poly1305(randBytes(32)))
 }
+
+func BenchmarkTinkAESSIV(b *testing.B) {
+	bTinkAESSIV(b)
+}

woodsts pushed a commit to woodsts/buildroot that referenced this issue Sep 14, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Fixes:
- http://autobuild.buildroot.net/results/caa60874781c4077273884eb37281cc9e02ef9ac/
- rfjakob/gocryptfs#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit 33c1ad4)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
paralin added a commit to paralin/gocryptfs that referenced this issue Dec 8, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Issue: rfjakob#666

Upstream PR: jacobsa/crypto#13

Unaddressed on jacobsa/crypto:

jacobsa/crypto#14 (comment)

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to paralin/gocryptfs that referenced this issue Dec 8, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Issue: rfjakob#666

Upstream PR: jacobsa/crypto#13

Unaddressed on jacobsa/crypto:

jacobsa/crypto#14 (comment)

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to paralin/gocryptfs that referenced this issue Dec 8, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Issue: rfjakob#666

Upstream PR: jacobsa/crypto#13

Unaddressed on jacobsa/crypto:

jacobsa/crypto#14 (comment)

Signed-off-by: Christian Stewart <christian@paral.in>
paralin added a commit to paralin/gocryptfs that referenced this issue Dec 8, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Issue: rfjakob#666

Upstream PR: jacobsa/crypto#13

Signed-off-by: Christian Stewart <christian@paral.in>
rfjakob pushed a commit that referenced this issue Dec 21, 2022
Replace dependency jacobsa/crypto with a fork with support for riscv64.

Issue: #666

Upstream PR: jacobsa/crypto#13

Unaddressed on jacobsa/crypto:

jacobsa/crypto#14 (comment)

Signed-off-by: Christian Stewart <christian@paral.in>
@rfjakob
Copy link
Owner

rfjakob commented Dec 21, 2022

Fixed via 7ee4c8e .

@rfjakob rfjakob closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants