From 16a0920ecd36b56543250d1efebbf745f7149c9e Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 14 Apr 2024 10:00:56 +0200 Subject: [PATCH] Uncommented tests and fixed the errors that arised. Excluded the "_decl.go" files from the linter --- .golangci.yml | 1 + encrypt/ibe/ibe_test.go | 10 ++++------ sign/test/bls_test.go | 6 ++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index e2a66021d..e1ca03702 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -246,3 +246,4 @@ issues: - linters: - govet text: "shadow: declaration of \"err\" shadows declaration" + - path: ".*_decl.go" diff --git a/encrypt/ibe/ibe_test.go b/encrypt/ibe/ibe_test.go index b6d78118b..c5b0a8fc1 100644 --- a/encrypt/ibe/ibe_test.go +++ b/encrypt/ibe/ibe_test.go @@ -1,15 +1,14 @@ package ibe -/* import ( "encoding/hex" "strings" "testing" - bls "github.com/drand/kyber-bls12381" "github.com/stretchr/testify/require" "go.dedis.ch/kyber/v3" "go.dedis.ch/kyber/v3/pairing" + bls "go.dedis.ch/kyber/v3/pairing/circl_bls12381" "go.dedis.ch/kyber/v3/util/random" ) @@ -22,7 +21,7 @@ func newSetting(i uint) ( panic("invalid test") } if i == 1 { - suite := bls.NewBLS12381Suite() + suite := bls.NewSuiteBLS12381() P := suite.G1().Point().Base() s := suite.G1().Scalar().Pick(random.New()) Ppub := suite.G1().Point().Mul(s, P) @@ -34,7 +33,7 @@ func newSetting(i uint) ( return suite, Ppub, ID, sQid, EncryptCCAonG1, DecryptCCAonG1 } // i == 2 - suite := bls.NewBLS12381Suite() + suite := bls.NewSuiteBLS12381() P := suite.G2().Point().Base() s := suite.G2().Scalar().Pick(random.New()) Ppub := suite.G2().Point().Mul(s, P) @@ -245,7 +244,7 @@ func TestBackwardsInteropWithTypescript(t *testing.T) { } func TestCPAEncryptOnG1(t *testing.T) { - suite := bls.NewBLS12381Suite() + suite := bls.NewSuiteBLS12381() P := suite.G1().Point().Pick(random.New()) s := suite.G1().Scalar().Pick(random.New()) Ppub := suite.G1().Point().Mul(s, P) @@ -260,4 +259,3 @@ func TestCPAEncryptOnG1(t *testing.T) { require.NoError(t, err) require.Equal(t, msg, msg2) } -*/ diff --git a/sign/test/bls_test.go b/sign/test/bls_test.go index 23183f6e1..ed681a4d3 100644 --- a/sign/test/bls_test.go +++ b/sign/test/bls_test.go @@ -1,16 +1,14 @@ package test -/* import ( "testing" - bls "github.com/drand/kyber-bls12381" + bls "go.dedis.ch/kyber/v3/pairing/circl_bls12381" sign "go.dedis.ch/kyber/v3/sign/bls" ) func TestBLS12381(t *testing.T) { - suite := bls.NewBLS12381Suite() + suite := bls.NewSuiteBLS12381() scheme := sign.NewSchemeOnG1(suite) SchemeTesting(t, scheme) } -*/