]> www.ginac.de Git - cln.git/blob - tests/test_I_dpb.cc
Fix crashes in find_univpoly_ring and related functions
[cln.git] / tests / test_I_dpb.cc
1 #include "test_I.h"
2
3 int test_I_dpb (int iterations)
4 {
5         int error = 0;
6         int i;
7         // Check against ash.
8         for (i = iterations; i > 0; i--) {
9                 cl_I a = testrandom_I();
10                 cl_I b = testrandom_I();
11                 sintL s = random32() % 1024;
12                 sintL p = random32() % 1024;
13                 cl_I mask = ash(ash(1,s)-1,p);
14                 ASSERT4(dpb(a,b,cl_byte(s,p)) == logxor(logand(ash(a,p),mask),logandc2(b,mask)), a,s,p,b);
15         }
16         return error;
17 }