Advertisement
Guest User

Untitled

a guest
Apr 29th, 2012
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. //pseudocode
  2.  
  3. int main() {
  4. p = 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084171;
  5. g = 1717829880366207009516117596335367088558084999998952205599979459063929499736583746670572176471460312928594829675428279466566527115212748467589894601965568;
  6. h = 3239475104050450443565264378728065788649097520952449527834792452971981976143292558073856937958553180532878928001494706097394108577585732452307673444020333;
  7. B = 2^20;
  8. for i from 0 to B:
  9. inv = inv(g) mod p; //using mpz_invert() function
  10. pow = inv^i mod p // mpz_powm_ui() function
  11. mul = h * pow mod p; // mpz_mul()
  12. result = mul mod p; // mpz_mod()
  13. hash.add(result); // using map
  14. end
  15.  
  16. comp = g^B mod p // mpz_powm_ui()
  17.  
  18. for i from 0 to B:
  19. temp = comp ^ i mod p //mpz_powm_ui()
  20. if temp is found in hash
  21. show i
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement