From 73a1417859e1251a93e7157a137ca0d220beb2b2 Mon Sep 17 00:00:00 2001 From: siddharth ravikumar Date: Sun, 14 Aug 2022 14:28:52 -0400 Subject: lib: remove `egcd` No longer needed. --- lib/rsa_test.go | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'lib/rsa_test.go') diff --git a/lib/rsa_test.go b/lib/rsa_test.go index c0d4ce4..eee20c6 100644 --- a/lib/rsa_test.go +++ b/lib/rsa_test.go @@ -8,49 +8,6 @@ import ( "testing" ) -func TestEGCD(t *testing.T) { - a := big.NewInt(128) - b := big.NewInt(96) - r := egcd(a, b) - if r.Gcd.Cmp(big.NewInt(32)) != 0 { - t.Errorf("gcd(128, 96) != 32") - } - if r.X.Cmp(big.NewInt(1)) != 0 || r.Y.Cmp(big.NewInt(-1)) != 0 { - t.Errorf("bézout_coef(128, 96) != {1,-1}") - } - - a = big.NewInt(360) - b = big.NewInt(210) - r = egcd(a, b) - if r.Gcd.Cmp(big.NewInt(30)) != 0 { - t.Errorf("gcd(360, 210) != 30") - } - if r.X.Cmp(big.NewInt(3)) != 0 || r.Y.Cmp(big.NewInt(-5)) != 0 { - t.Errorf("bézout_coef(360, 210) != {3,-5}") - } - - a = big.NewInt(108) - b = big.NewInt(144) - r = egcd(a, b) - if r.Gcd.Cmp(big.NewInt(36)) != 0 { - t.Errorf("gcd(108, 144) != 36") - } - if r.X.Cmp(big.NewInt(-1)) != 0 || r.Y.Cmp(big.NewInt(1)) != 0 { - t.Errorf("bézout_coef(108, 144) != {-1,1}") - } - - a = big.NewInt(240) - b = big.NewInt(46) - r = egcd(a, b) - if r.Gcd.Cmp(big.NewInt(2)) != 0 { - t.Errorf("gcd(240, 46) != 2") - } - if r.X.Cmp(big.NewInt(-9)) != 0 || r.Y.Cmp(big.NewInt(47)) != 0 { - t.Errorf("bézout_coef(240, 46) != {-9,47}") - } - -} - func TestInvMod(t *testing.T) { a := big.NewInt(17) b := big.NewInt(3120) -- cgit v1.2.3