Skip to content
Snippets Groups Projects
Commit 8a9267f3 authored by Mihails VALTUSOVS's avatar Mihails VALTUSOVS :speech_balloon:
Browse files

fix minor coin flip issues again

parent 44d4e39c
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
* Olavi Äikäs
* See git history for contributions
*/
#![allow(non_snake_case)]
// mod prime_gen;
use super::prime_gen;
......@@ -36,7 +37,7 @@ pub fn generate_keys(size: usize) -> (BigUint, BigUint, BigUint , BigUint) {
let N = &P * &Q;
let mut y = astarzstar::rand_astar(&N);
while !check_quadratic_residuoity(&y, &N, &P, &Q) {
while check_quadratic_residuoity(&y, &N, &P, &Q) {
y = astarzstar::rand_astar(&N);
}
......@@ -51,7 +52,7 @@ pub fn guess_whether_quadratic_residue(N: &BigUint, y: &BigUint, q: &BigUint) ->
return false;
}
if y == q {
return true;
return false;
}
let mut rng = thread_rng();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment