From 622644f19d5aa89a0319a498c81a1518fcf5349a Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Wed, 23 May 2018 18:37:15 +0200 Subject: [PATCH] Fixed test for LCM The LCM test was expecting GCD result and because assertion was flipped (missing negation), the test was passing. --- paillier_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/paillier_test.go b/paillier_test.go index 1f3adcd..d8e8218 100644 --- a/paillier_test.go +++ b/paillier_test.go @@ -8,10 +8,11 @@ import ( ) func TestLCM(t *testing.T) { - a := big.NewInt(2 * 3 * 3 * 3 * 5 * 5) - b := big.NewInt(3 * 3 * 5 * 5 * 57 * 11) - exp := big.NewInt(3 * 3 * 5 * 5) - if reflect.DeepEqual(exp, LCM(a, b)) { + a := big.NewInt(1350) + b := big.NewInt(141075) + expected := big.NewInt(282150) + + if !reflect.DeepEqual(expected, LCM(a, b)) { t.Fail() } } @@ -35,7 +36,7 @@ func TestComputeMu(t *testing.T) { exp := big.NewInt(3) if !reflect.DeepEqual(computeMu(g, lambda, n), exp) { - t.Error("lambda is not well computed") + t.Error("mu is not well computed") } }