forked from monnerat/BUT2FI_R4.B.10
il faut faire le générateur dans df.c
This commit is contained in:
parent
9a69a4842e
commit
824aecf3e9
@ -7,7 +7,11 @@ uint64 expm(uint64 m, uint64 e, uint64 mod)
|
||||
uint128 _mod = (uint128)mod;
|
||||
|
||||
|
||||
// TODO
|
||||
while (e){
|
||||
if (e & 1) _r=(_r*_m)%_mod;
|
||||
_m=(_m*_m)%_mod;
|
||||
e>>=1;
|
||||
}
|
||||
|
||||
return (uint64)_r;
|
||||
}
|
||||
@ -17,7 +21,10 @@ uint64 generateur(uint64 p)
|
||||
uint64 g=2;
|
||||
uint64 r=1;
|
||||
|
||||
// TODO
|
||||
while(r==1){
|
||||
expm(g,(p-1)/2,p)
|
||||
g++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user