Steal rust-crypto's ChaCha20 implementation wholesale
[rust-lightning] / src / util / chacha20poly1305rfc.rs
index 9c86d44b4949e24e86abcc043d5c2de885cef7c1..3468e576dbe48ce1c08a67408b0a0f0782a7614d 100644 (file)
 
 #[cfg(not(feature = "fuzztarget"))]
 mod real_chachapoly {
+       use util::chacha20::ChaCha20;
+
        use crypto::aead::{AeadEncryptor,AeadDecryptor};
-       use crypto::chacha20::ChaCha20;
        use crypto::symmetriccipher::SynchronousStreamCipher;
-       use crypto::poly1305::Poly1305;
        use crypto::mac::Mac;
        use crypto::util::fixed_time_eq;
+       use crypto::poly1305::Poly1305;
 
        use util::byte_utils;
 
        #[derive(Clone, Copy)]
        pub struct ChaCha20Poly1305RFC {
-               cipher  : ChaCha20,
+               cipher: ChaCha20,
                mac: Poly1305,
                finished: bool,
                data_len: usize,