Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions bccsp/idemix_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,37 @@ package idemix_test
import (
"testing"

idemix "github.com/IBM/idemix/bccsp"
"github.com/IBM/idemix/bccsp/schemes/dlog/crypto/translator/amcl"
bccsp "github.com/IBM/idemix/bccsp/types"
math "github.com/IBM/mathlib"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/stretchr/testify/assert"
)

func TestPlain(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Plain Suite")
}

func TestRevocationKeyExportImport(t *testing.T) {
curve := math.Curves[math.FP256BN_AMCL]
translator := &amcl.Fp256bn{C: curve}

var err error
CSP, err := idemix.New(NewDummyKeyStore(), curve, translator, true)
assert.NoError(t, err)

RevocationPrivateKey, err := CSP.KeyGen(&bccsp.IdemixRevocationKeyGenOpts{Temporary: true})
assert.NoError(t, err)

RevocationPublicKey, err := RevocationPrivateKey.PublicKey()
assert.NoError(t, err)

RevocationPublicKeyBytes, err := RevocationPublicKey.Bytes()
assert.NoError(t, err)

_, err = CSP.KeyImport(RevocationPublicKeyBytes, &bccsp.IdemixRevocationPublicKeyImportOpts{Temporary: true})
assert.NoError(t, err)
}
Loading