diff --git a/test/arith_utest.cpp b/test/arith_utest.cpp index 37b6e0a5..ded20256 100644 --- a/test/arith_utest.cpp +++ b/test/arith_utest.cpp @@ -168,13 +168,23 @@ class ArithUtest { // check overflow assert(m / p1 == p2); // std::cerr << " m=" << m << "\n"; - assert(quadiron::arith::exp((b - 1), 2) * quadiron::arith::exp(p, 2) < m); + assert( + quadiron::arith::exp((b - 1), 2) * quadiron::arith::exp(p, 2) + < m); // find x so it is not a quadratic residue in GF_p1 and GF_p2 - assert(quadiron::arith::jacobi(3, p1) == quadiron::arith::jacobi(p1, 3)); - assert(quadiron::arith::jacobi(p1, 3) == quadiron::arith::jacobi(2, 3)); - assert(quadiron::arith::jacobi(3, p2) == quadiron::arith::jacobi(p2, 3)); - assert(quadiron::arith::jacobi(p2, 3) == quadiron::arith::jacobi(2, 3)); + assert( + quadiron::arith::jacobi(3, p1) + == quadiron::arith::jacobi(p1, 3)); + assert( + quadiron::arith::jacobi(p1, 3) + == quadiron::arith::jacobi(2, 3)); + assert( + quadiron::arith::jacobi(3, p2) + == quadiron::arith::jacobi(p2, 3)); + assert( + quadiron::arith::jacobi(p2, 3) + == quadiron::arith::jacobi(2, 3)); assert(quadiron::arith::jacobi(2, 3) == -1); // which means x=3 is not a quadratic residue in GF_p1 and GF_p2 @@ -203,9 +213,11 @@ class ArithUtest { quadiron::SignedDoubleSizeVal bezout[2]; // not explicitely related to GF(97) - assert(2 == quadiron::arith::extended_gcd(240, 46, nullptr, nullptr)); + assert( + 2 == quadiron::arith::extended_gcd(240, 46, nullptr, nullptr)); assert(6 == quadiron::arith::extended_gcd(54, 24, nullptr, nullptr)); - assert(15 == quadiron::arith::extended_gcd(210, 45, nullptr, nullptr)); + assert( + 15 == quadiron::arith::extended_gcd(210, 45, nullptr, nullptr)); // assert(1 == quadiron::arith::extended_gcd(97, 20, bezout, nullptr)); assert(bezout[0] == -7 && bezout[1] == 34); @@ -384,7 +396,8 @@ class ArithUtest { std::vector factors; quadiron::arith::get_prime_factors(order, &factors); - const T len = quadiron::arith::get_code_len_high_compo(&factors, n); + const T len = + quadiron::arith::get_code_len_high_compo(&factors, n); // std::cout << "len=" << len << "\n"; assert(order % len == 0); assert(len >= n); diff --git a/test/buffers_utest.cpp b/test/buffers_utest.cpp index 4b656937..dfc775b1 100644 --- a/test/buffers_utest.cpp +++ b/test/buffers_utest.cpp @@ -49,7 +49,8 @@ class BuffersUtest { delete this->gfp; } - quadiron::vec::Buffers* gen_buffers_rand_data(int n, int size, int _max = 0) + quadiron::vec::Buffers* + gen_buffers_rand_data(int n, int size, int _max = 0) { const int max = (_max == 0) ? max_val : _max; std::uniform_int_distribution dis(0, max - 1); @@ -240,7 +241,8 @@ class BuffersUtest { // tmp vectors to store results quadiron::vec::Buffers vec_T_tmp(n, size); std::vector* mem_T_tmp = vec_T_tmp.get_mem(); - quadiron::vec::pack(mem_char, mem_T_tmp, n, size, word_size); + quadiron::vec::pack( + mem_char, mem_T_tmp, n, size, word_size); // std::cout << "vec_char:"; vec_char.dump(); // std::cout << "vec_T_tmp:"; vec_T_tmp.dump(); // check diff --git a/test/fft_utest.cpp b/test/fft_utest.cpp index c44e4fb1..1e79e858 100644 --- a/test/fft_utest.cpp +++ b/test/fft_utest.cpp @@ -41,7 +41,8 @@ class FFTUtest { int i; for (i = 0; i < 100; i++) { T x = gf.weak_rand(); - assert(1 == quadiron::arith::extended_gcd(97, x, bezout, nullptr)); + assert( + 1 == quadiron::arith::extended_gcd(97, x, bezout, nullptr)); // std::cerr << bezout[0] << "*" << 97 << " " << bezout[1] << "*"; // stdd:cerr << x << "=1\n"; T y = gf.inv(x); @@ -340,8 +341,9 @@ class FFTUtest { } } - void - run_taylor_expand(const quadiron::gf::Field& gf, quadiron::fft::Additive* fft) + void run_taylor_expand( + const quadiron::gf::Field& gf, + quadiron::fft::Additive* fft) { int t = 2 + gf.weak_rand() % (fft->get_n() - 2); int n = t + 1 + gf.weak_rand() % (fft->get_n() - t); @@ -428,7 +430,8 @@ class FFTUtest { quadiron::gf::BinExtension gf(gf_n); std::cout << "test_fftadd_with_n=" << gf_n << "\n"; // n is power of 2 and at least n_data + n_parities - n = quadiron::arith::get_smallest_power_of_2(n_data + n_parities); + n = quadiron::arith::get_smallest_power_of_2( + n_data + n_parities); m = quadiron::arith::log2(n); // std::cerr << "n=" << n << "\n";