From f550c00e74617c2110b537619a3d9d0a72645739 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Wed, 23 May 2018 18:43:14 +0200 Subject: [PATCH] Added test for Lambda parameter computation --- paillier_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/paillier_test.go b/paillier_test.go index d8e8218..6eddacb 100644 --- a/paillier_test.go +++ b/paillier_test.go @@ -40,6 +40,16 @@ func TestComputeMu(t *testing.T) { } } +func TestComputeLambda(t *testing.T) { + a := big.NewInt(5) + b := big.NewInt(7) + expected := big.NewInt(12) + + if !reflect.DeepEqual(expected, computeLamda(a, b)) { + t.Error("lambda is not correctly computed") + } +} + func TestEncryptDecryptSmall(t *testing.T) { p := big.NewInt(13) q := big.NewInt(11)