You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
472 B

25 years ago
25 years ago
  1. #include "test_I.h"
  2. #include "cln/GV_integer.h"
  3. int test_I_GV (int iterations)
  4. {
  5. int error = 0;
  6. int i;
  7. for (i = iterations; i > 0; i--) {
  8. uintL m = random32() % 70;
  9. uintL len = random32() % 64;
  10. cl_GV_I v = cl_GV_I(len,m);
  11. cl_I M = random_I((cl_I)1 << m) + 1; // 0 < M <= 2^m
  12. cl_I a = random_I(M);
  13. int j;
  14. for (j = 0; j < len; j++)
  15. v[j] = mod(a*(j*j),M);
  16. for (j = len-1; j >= 0; j--)
  17. ASSERT4(v[j] == mod(a*(j*j),M), m,len,M,j);
  18. }
  19. return error;
  20. }