Switch to using for all crate level uses

This commit is contained in:
phayes 2019-03-18 09:29:05 -07:00
parent f2399316bf
commit bbd63fbba4
No known key found for this signature in database
GPG Key ID: 728E71482E8E0832
4 changed files with 17 additions and 17 deletions

View File

@ -3,8 +3,8 @@ use num_bigint::{BigUint, RandPrime};
use num_traits::{FromPrimitive, One, Zero};
use rand::Rng;
use errors::{Error, Result};
use key::RSAPrivateKey;
use crate::errors::{Error, Result};
use crate::key::RSAPrivateKey;
/// Default exponent for RSA keys.
const EXP: u64 = 65537;

View File

@ -1,5 +1,5 @@
use errors::{Error, Result};
use key::{PublicKey, RSAPrivateKey};
use crate::errors::{Error, Result};
use crate::key::{PublicKey, RSAPrivateKey};
use num_bigint::{BigInt, BigUint, ModInverse, RandBigInt, Sign::Plus};
use num_traits::{One, Signed, Zero};
use rand::Rng;

View File

@ -7,11 +7,11 @@ use rand::{Rng, ThreadRng};
#[cfg(feature = "serde1")]
use serde::{Deserialize, Serialize};
use algorithms::generate_multi_prime_key;
use errors::{Error, Result};
use hash::Hash;
use padding::PaddingScheme;
use pkcs1v15;
use crate::algorithms::generate_multi_prime_key;
use crate::errors::{Error, Result};
use crate::hash::Hash;
use crate::padding::PaddingScheme;
use crate::pkcs1v15;
lazy_static! {
static ref MIN_PUB_EXPONENT: BigUint = BigUint::from_u64(2).unwrap();
@ -445,7 +445,7 @@ pub fn check_public(public_key: &impl PublicKey) -> Result<()> {
#[cfg(test)]
mod tests {
use super::*;
use internals;
use crate::internals;
use num_traits::{FromPrimitive, ToPrimitive};
use rand::{thread_rng, ThreadRng};

View File

@ -2,10 +2,10 @@ use num_bigint::BigUint;
use rand::Rng;
use subtle::{Choice, ConditionallySelectable, ConstantTimeEq};
use errors::{Error, Result};
use hash::Hash;
use internals;
use key::{self, PublicKey, RSAPrivateKey};
use crate::errors::{Error, Result};
use crate::hash::Hash;
use crate::internals;
use crate::key::{self, PublicKey, RSAPrivateKey};
// Encrypts the given message with RSA and the padding
// scheme from PKCS#1 v1.5. The message must be no longer than the
@ -243,9 +243,9 @@ mod tests {
use rand::thread_rng;
use sha1::{Digest, Sha1};
use hash::Hashes;
use key::RSAPublicKey;
use padding::PaddingScheme;
use crate::hash::Hashes;
use crate::key::RSAPublicKey;
use crate::padding::PaddingScheme;
#[test]
fn test_non_zero_bytes() {