aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/bn256/cloudflare/example_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/crypto/bn256/cloudflare/example_test.go b/crypto/bn256/cloudflare/example_test.go
index b2d19807a..6c285995c 100644
--- a/crypto/bn256/cloudflare/example_test.go
+++ b/crypto/bn256/cloudflare/example_test.go
@@ -6,9 +6,12 @@ package bn256
import (
"crypto/rand"
+ "testing"
+
+ "github.com/stretchr/testify/require"
)
-func ExamplePair() {
+func TestExamplePair(t *testing.T) {
// This implements the tripartite Diffie-Hellman algorithm from "A One
// Round Protocol for Tripartite Diffie-Hellman", A. Joux.
// http://www.springerlink.com/content/cddc57yyva0hburb/fulltext.pdf
@@ -40,4 +43,9 @@ func ExamplePair() {
k3.ScalarMult(k3, c)
// k1, k2 and k3 will all be equal.
+
+ require.Equal(t, k1, k2)
+ require.Equal(t, k1, k3)
+
+ require.Equal(t, len(np), 4) //Avoid gometalinter varcheck err on np
}