Advertisement
Guest User

Untitled

a guest
Apr 20th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <gmp.h> // For the GMP library
  2.  
  3. int main()
  4.  
  5. {
  6. mpz_t n,p,q,e,c,d,h;
  7.  
  8. mpz_init(n);
  9. mpz_init(h);
  10. mpz_init_set_str(e, "65537", 10);
  11. mpz_init_set_str(p, "1298849", 10);
  12. mpz_init_set_str(q, "1298863", 10);
  13. mpz_mul(n,p,q);
  14. mpz_sub_ui(p, p, 1UL);
  15. mpz_sub_ui(q, q, 1UL);
  16. mpz_mul(h, p, q);
  17. gmp_printf ("%Zdn", h);
  18.  
  19. //This next line segfaults it.
  20. mpz_invert(d,e,h);
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement