Merge pull request #1826 from TheBlueMatt/2022-10-idempotency-err
[rust-lightning] / lightning / src / util / chacha20poly1305rfc.rs
index 3254e8b0134d298517fcc9095792fb48c9935b50..552226ca3e64121569cd2ff65589152255db9c05 100644 (file)
 // This is a port of Andrew Moons poly1305-donna
 // https://github.com/floodyberry/poly1305-donna
 
-use ln::msgs::DecodeError;
-use util::ser::{FixedLengthReader, LengthRead, LengthReadableArgs, Readable, Writeable, Writer};
-use io::{self, Read, Write};
+use crate::ln::msgs::DecodeError;
+use crate::util::ser::{FixedLengthReader, LengthRead, LengthReadableArgs, Readable, Writeable, Writer};
+use crate::io::{self, Read, Write};
 
 #[cfg(not(fuzzing))]
 mod real_chachapoly {
-       use util::chacha20::ChaCha20;
-       use util::poly1305::Poly1305;
+       use crate::util::chacha20::ChaCha20;
+       use crate::util::poly1305::Poly1305;
        use bitcoin::hashes::cmp::fixed_time_eq;
 
        #[derive(Clone, Copy)]
@@ -228,7 +228,6 @@ impl<'a, T: Writeable> Writeable for ChaChaPolyWriteAdapter<'a, T> {
 /// Enables the use of the serialization macros for objects that need to be simultaneously decrypted and
 /// deserialized. This allows us to avoid an intermediate Vec allocation.
 pub(crate) struct ChaChaPolyReadAdapter<R: Readable> {
-       #[allow(unused)] // This will be used soon for onion messages
        pub readable: R,
 }
 
@@ -330,9 +329,9 @@ pub use self::fuzzy_chachapoly::ChaCha20Poly1305RFC;
 
 #[cfg(test)]
 mod tests {
-       use ln::msgs::DecodeError;
+       use crate::ln::msgs::DecodeError;
        use super::{ChaChaPolyReadAdapter, ChaChaPolyWriteAdapter};
-       use util::ser::{self, FixedLengthReader, LengthReadableArgs, Writeable};
+       use crate::util::ser::{self, FixedLengthReader, LengthReadableArgs, Writeable};
 
        // Used for for testing various lengths of serialization.
        #[derive(Debug, PartialEq, Eq)]