Normalize the use of use.

Avoid using `super::` to import top-level submodules of *ring*. Sort
`use` lines alphabetically.
This commit is contained in:
Brian Smith 2016-06-14 22:10:50 -10:00
parent 867a0e6ae8
commit bc764776bb
15 changed files with 17 additions and 21 deletions

View File

@ -26,7 +26,7 @@
mod chacha20_poly1305;
mod aes_gcm;
use super::{constant_time, init, polyfill};
use {constant_time, init, polyfill};
pub use self::chacha20_poly1305::{CHACHA20_POLY1305, CHACHA20_POLY1305_OLD};
pub use self::aes_gcm::{AES_128_GCM, AES_256_GCM};

View File

@ -14,7 +14,7 @@
#![allow(unsafe_code)]
use super::super::{aead, bssl, c, polyfill};
use {aead, bssl, c, polyfill};
const AES_128_KEY_LEN: usize = 128 / 8;
const AES_256_KEY_LEN: usize = 32; // 256 / 8

View File

@ -14,8 +14,8 @@
#![allow(unsafe_code)]
use {aead, c, polyfill};
use core;
use super::super::{aead, c, polyfill};
const CHACHA20_KEY_LEN: usize = 256 / 8;
const POLY1305_STATE_LEN: usize = 256;

View File

@ -12,7 +12,7 @@
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
use super::c;
use c;
pub fn map_result(bssl_result: c::int) -> Result<(), ()> {
match bssl_result {

View File

@ -16,7 +16,7 @@
#![allow(unsafe_code)]
use super::c;
use c;
/// Returns `Ok(())` if `a == b` and `Err(())` otherwise. The comparison of
/// `a` and `b` is done in constant time with respect to the contents of each,

View File

@ -26,8 +26,8 @@
#![allow(unsafe_code)]
use {c, init, polyfill};
use core;
use super::{c, init, polyfill};
// XXX: endian-specific.
// XXX: Replace with `const fn` when `const fn` is stable:

View File

@ -13,10 +13,9 @@
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
use {c, polyfill};
use core;
use core::num::Wrapping;
use c;
use polyfill;
use super::MAX_CHAINING_LEN;
pub const BLOCK_LEN: usize = 512 / 8;

View File

@ -138,8 +138,8 @@ extern {
#[cfg(test)]
mod tests {
use {file_test, rand, signature};
use untrusted;
use super::Ed25519KeyPair;
use untrusted;
/// Test vectors from BoringSSL.
#[test]

View File

@ -16,10 +16,9 @@
#![allow(unsafe_code)]
use {agreement, c, ec, rand};
use bssl;
use untrusted;
use {agreement, bssl, c, ec, rand};
use super::{EC_GROUP, EC_GROUP_P256, EC_GROUP_P384};
use untrusted;
/// A key agreement algorithm.
macro_rules! ecdh {

View File

@ -17,8 +17,8 @@
//! ECDSA Signatures using the P-256 and P-384 curves.
use {bssl, c, der, digest, ec, signature, signature_impl};
use untrusted;
use super::{EC_GROUP, EC_GROUP_P256, EC_GROUP_P384};
use untrusted;
#[cfg(not(feature = "no_heap"))]
struct ECDSA {
@ -136,8 +136,8 @@ extern {
#[cfg(test)]
mod tests {
use {file_test, der, signature};
use untrusted;
use super::*;
use untrusted;
#[test]
fn test_signature_ecdsa_verify() {

View File

@ -16,9 +16,7 @@
#![allow(unsafe_code)]
use {agreement, c, ec, rand};
use bssl;
use {agreement, bssl, c, ec, rand};
use untrusted;

View File

@ -12,11 +12,11 @@
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
use digest;
use std;
use std::string::String;
use std::vec::Vec;
use std::io::BufRead;
use super::digest;
pub struct TestCase {
attributes: std::collections::HashMap<String, String>,

View File

@ -28,7 +28,7 @@
//! constructed as `hmac::SigningKey::new(digest_alg, salt)`.
use super::hmac;
use hmac;
/// Fills `out` with the output of the HKDF Extract-and-Expand operation for
/// the given inputs.

View File

@ -148,7 +148,7 @@
//! # fn main() { main_with_result().unwrap() }
//! ```
use super::{constant_time, digest, rand};
use {constant_time, digest, rand};
/// A key to use for HMAC signing.
pub struct SigningKey {

View File

@ -105,7 +105,7 @@
//! assert!(db.verify_password("alice", "@74d7]404j|W}6u").is_ok());
//! }
use super::{constant_time, digest, hmac, polyfill};
use {constant_time, digest, hmac, polyfill};
/// Fills `out` with the key derived using PBKDF2 with the given inputs.
///