mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-26 00:25:17 +00:00
Allow setting prime check iterations <256
This commit is contained in:
parent
1a1554224a
commit
5d9659d118
@ -22,6 +22,8 @@ use std::{
|
|||||||
mem::swap,
|
mem::swap,
|
||||||
ops::{Mul, MulAssign},
|
ops::{Mul, MulAssign},
|
||||||
};
|
};
|
||||||
|
use std::convert::TryInto;
|
||||||
|
|
||||||
mod congruence;
|
mod congruence;
|
||||||
pub(super) mod ffi;
|
pub(super) mod ffi;
|
||||||
|
|
||||||
@ -338,7 +340,8 @@ impl<B: Borrow<GmpClassGroup>> MulAssign<B> for GmpClassGroup {
|
|||||||
|
|
||||||
impl super::BigNum for Mpz {
|
impl super::BigNum for Mpz {
|
||||||
fn probab_prime(&self, iterations: u32) -> bool {
|
fn probab_prime(&self, iterations: u32) -> bool {
|
||||||
self.probab_prime(iterations.max(256) as _) != NotPrime
|
let reps: i32 = iterations.try_into().expect("Iterations fits into i32");
|
||||||
|
self.probab_prime(reps) != NotPrime
|
||||||
}
|
}
|
||||||
|
|
||||||
fn setbit(&mut self, bit_index: usize) {
|
fn setbit(&mut self, bit_index: usize) {
|
||||||
|
Loading…
Reference in New Issue
Block a user