| 43 | } |
| 44 | |
| 45 | TEST(InternalMathTest, Barrett) { |
| 46 | for (int m = 1; m <= 100; m++) { |
| 47 | internal::barrett bt(m); |
| 48 | for (int a = 0; a < m; a++) { |
| 49 | for (int b = 0; b < m; b++) { |
| 50 | ASSERT_EQ((a * b) % m, bt.mul(a, b)); |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | internal::barrett bt(1); |
| 56 | ASSERT_EQ(0, bt.mul(0, 0)); |
| 57 | } |
| 58 | |
| 59 | TEST(InternalMathTest, BarrettIntBorder) { |
| 60 | const int mod_upper = std::numeric_limits<int>::max(); |
nothing calls this directly
no test coverage detected