Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <gmp.h> // For the GMP library
- int main()
- {
- mpz_t n,p,q,e,c,d,h;
- mpz_init(n);
- mpz_init(h);
- mpz_init_set_str(e, "65537", 10);
- mpz_init_set_str(p, "1298849", 10);
- mpz_init_set_str(q, "1298863", 10);
- mpz_mul(n,p,q);
- mpz_sub_ui(p, p, 1UL);
- mpz_sub_ui(q, q, 1UL);
- mpz_mul(h, p, q);
- gmp_printf ("%Zdn", h);
- //This next line segfaults it.
- mpz_invert(d,e,h);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement