coinbase / kryptology

Apache License 2.0
847 stars 123 forks source link

Failing tests using non-amd64 generic tag #41

Closed corverroos closed 2 years ago

corverroos commented 2 years ago

I am suspecting there is a bug in the kryptology/pkg/core/curves/native/bls12-381/arithmetic_fallback.go, since there are a bunch of test failures in the kryptology libarary itself when running with generic build tag.

We at Obol implemented bls threshold signature splitting and verification using pkg/sharing/felman.go and pkg/signatures/bls/bls_sig and our tests fail when running with -tags=generic (it passes when running with GOARCH=amd64).

➜  kryptology git:(master) ✗ git rev-parse HEAD
71ffd4cbf01951cd0ee056fc7b45b13ffb178330

➜  kryptology git:(master) ✗ go version
go version go1.17.6 darwin/arm64

➜  kryptology git:(master) ✗ GOARCH=amd64 go test github.com/coinbase/kryptology/pkg/signatures/bbs github.com/coinbase/kryptology/pkg/accumulator
ok      github.com/coinbase/kryptology/pkg/signatures/bbs   (cached)
ok      github.com/coinbase/kryptology/pkg/accumulator  (cached)

➜  kryptology git:(master) ✗ go test -tags=generic github.com/coinbase/kryptology/pkg/signatures/bbs github.com/coinbase/kryptology/pkg/accumulator
--- FAIL: TestBlindSignatureContext (0.04s)
    blind_signature_context_test.go:56:
            Error Trace:    blind_signature_context_test.go:56
            Error:          Received unexpected error:
                            invalid result
            Test:           TestBlindSignatureContext
.... (redacted for brevity)
FAIL
FAIL    github.com/coinbase/kryptology/pkg/signatures/bbs   0.426s
--- FAIL: Test_Membership (0.02s)
    witness_test.go:70:
            Error Trace:    witness_test.go:70
            Error:          Received unexpected error:
                            invalid result
            Test:           Test_Membership
.... (redacted for brevity)
FAIL
FAIL    github.com/coinbase/kryptology/pkg/accumulator  0.373s
FAIL
mikelodder7 commented 2 years ago

Should be fixed with #49