mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-27 09:05:18 +00:00
Reduce prime check iterations to 1
This commit is contained in:
parent
5d9659d118
commit
a8f91fe50a
@ -112,7 +112,7 @@ pub fn create_discriminant<T: BigNumExt>(seed: &[u8], length: u16) -> T {
|
||||
if !x {
|
||||
let q = u64::from(M) * u64::from(i as u32);
|
||||
n = n + q;
|
||||
if n.probab_prime(2) {
|
||||
if n.probab_prime(1) {
|
||||
return -n;
|
||||
}
|
||||
n = n - q;
|
||||
|
@ -119,7 +119,7 @@ fn hash_prime<T: BigNum>(seed: &[&[u8]]) -> T {
|
||||
hasher.input(i);
|
||||
}
|
||||
let n = T::from(&hasher.fixed_result()[..16]);
|
||||
if n.probab_prime(2) {
|
||||
if n.probab_prime(1) {
|
||||
break n;
|
||||
}
|
||||
j += 1;
|
||||
|
Loading…
Reference in New Issue
Block a user