Skip to content

Commit

Permalink
Add Debug impls
Browse files Browse the repository at this point in the history
  • Loading branch information
survived committed Sep 22, 2023
1 parent 0bcc13e commit 48c5d13
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
mod small_primes;
use std::fmt;

use rand_core::RngCore;
use rug::{Assign, Complete, Integer};

mod small_primes;

/// Wraps any randomness source that implements [`rand_core::RngCore`] and makes
/// it compatible with [`rug::rand`].
pub fn external_rand(rng: &mut impl RngCore) -> rug::rand::ThreadRandState {
Expand Down Expand Up @@ -200,6 +202,18 @@ impl CrtExp {
}
}

impl fmt::Debug for CrtExp {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("CrtExp")
}
}

impl fmt::Debug for Exponent {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("CrtExponent")
}
}

#[cfg(test)]
mod test {
#[test]
Expand Down

0 comments on commit 48c5d13

Please sign in to comment.