(t *testing.T)
| 36 | } |
| 37 | |
| 38 | func testPrecondition(t *testing.T) (int64, int64, int64) { |
| 39 | // Both prime numbers |
| 40 | t.Helper() |
| 41 | p := int64(61) |
| 42 | q := int64(53) |
| 43 | n := p * q |
| 44 | delta := lcm.Lcm(p-1, q-1) |
| 45 | e := int64(17) // Coprime with delta |
| 46 | if gcd.Recursive(e, delta) != 1 { |
| 47 | t.Fatal("something went wrong: prime numbers are chosen statically and it shouldn't fail at this stage") |
| 48 | } |
| 49 | d, err := modular.Inverse(e, delta) |
| 50 | if err != nil { |
| 51 | t.Fatalf("something went wrong: problem with %q: %v", "modular.Inverse", err) |
| 52 | } |
| 53 | return e, d, n |
| 54 | } |
| 55 | |
| 56 | func TestEncryptDecrypt(t *testing.T) { |
| 57 | for _, test := range rsaTestData { |
no test coverage detected