Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<windows.h>
- #include<iostream>
- using namespace std;
- long long stepmod(long long x, long long y, long long N)
- {
- long long c = 1;
- while (y != 0)
- {
- if (y % 2 == 0)
- {
- y = y / 2;
- x = (x * x) % N;
- }else{
- y--;
- c = (c * x) % N;
- }
- }
- return c;
- }
- int main()
- {
- long long p=1111110001, g=946880040,y=761108829;
- long long a[30]={434691400,1093746706,732399259,842127713,75901103,
- 757531051,98409571,359138174,1078289799,839813855,
- 736404417,413442390,841226712,1030115485,1058340068,
- 236927752,974914967,827373579,310481040,436392971,
- 928419514,277333867,372596855,611108999,736586624,
- 134257583,1071152880,967485502,57451916,939950943};
- long long b[30]={501112675,1052712262,519308732,58415472,577112821,
- 1086359512,73396279,733506096,194954459,144449296,
- 891324424,248404362,42989264,904416285,590425478,
- 431717666,637553779,848251037,876177134,36913882,
- 358189398,734597153,37745997,53227637,610883626,
- 789098393,1074367610,1026688045,896392301,1053596158};
- long long m[30], x;
- for (x = 1; ; x++){
- if (stepmod(g, x, p) == y) break;
- }
- for (int i=0; i<30; i++){
- m[i] = (b[i] * stepmod(a[i], x * (p - 2), p)) % p;
- cout << (char)((m[i] >> 16) % 256)
- << (char)((m[i] >> 8) % 256)
- << (char)(m[i] % 256);
- }
- cout<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement