KiK0S

Untitled

Nov 2nd, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. bool check() {
  2.     if (bp(g, mod - 1) != 1) {
  3.         return 0;
  4.     }
  5.     for (int i = 1; i * i <= (mod - 1); i++) {
  6.         if ((mod - 1) % i == 0) {
  7.             if (bp(g, i) == 1) {
  8.                 return 0;
  9.             }
  10.         }
  11.     }
  12.     return 1;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment