Skip to content

Commit

Permalink
Fix new nightly redundant import lint warns
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkforest committed Feb 26, 2024
1 parent a62e4a5 commit c6b2203
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ impl VartimeMultiscalarMul for Pippenger {
mod test {
use super::*;
use crate::constants;
use crate::scalar::Scalar;

#[test]
fn test_vartime_pippenger() {
Expand Down
1 change: 0 additions & 1 deletion curve25519-dalek/src/backend/vector/avx2/edwards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

#![allow(non_snake_case)]

use core::convert::From;
use core::ops::{Add, Neg, Sub};

use subtle::Choice;
Expand Down
7 changes: 1 addition & 6 deletions curve25519-dalek/src/edwards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
use core::array::TryFromSliceError;
use core::borrow::Borrow;
use core::fmt::Debug;
use core::iter::Iterator;
use core::iter::Sum;
use core::ops::{Add, Neg, Sub};
use core::ops::{AddAssign, SubAssign};
Expand Down Expand Up @@ -258,7 +257,7 @@ impl TryFrom<&[u8]> for CompressedEdwardsY {
#[cfg(feature = "serde")]
use serde::de::Visitor;
#[cfg(feature = "serde")]
use serde::{self, Deserialize, Deserializer, Serialize, Serializer};
use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[cfg(feature = "serde")]
impl Serialize for EdwardsPoint {
Expand Down Expand Up @@ -1591,17 +1590,13 @@ impl CofactorGroup for EdwardsPoint {
#[cfg(test)]
mod test {
use super::*;
use crate::{field::FieldElement, scalar::Scalar};
use subtle::ConditionallySelectable;

#[cfg(feature = "alloc")]
use alloc::vec::Vec;

#[cfg(feature = "precomputed-tables")]
use crate::constants::ED25519_BASEPOINT_TABLE;

use rand_core::RngCore;

/// X coordinate of the basepoint.
/// = 15112221349535400772501151409588531511454012693041857206046113283949847762202
static BASE_X_COORD_BYTES: [u8; 32] = [
Expand Down
3 changes: 0 additions & 3 deletions curve25519-dalek/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

#![allow(unused_qualifications)]

use core::cmp::{Eq, PartialEq};

use cfg_if::cfg_if;

use subtle::Choice;
Expand Down Expand Up @@ -310,7 +308,6 @@ impl FieldElement {
#[cfg(test)]
mod test {
use crate::field::*;
use subtle::ConditionallyNegatable;

/// Random element a of GF(2^255-19), from Sage
/// a = 1070314506888354081329385823235218444233221\
Expand Down
4 changes: 1 addition & 3 deletions curve25519-dalek/src/ristretto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ impl TryFrom<&[u8]> for CompressedRistretto {
#[cfg(feature = "serde")]
use serde::de::Visitor;
#[cfg(feature = "serde")]
use serde::{self, Deserialize, Deserializer, Serialize, Serializer};
use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[cfg(feature = "serde")]
impl Serialize for RistrettoPoint {
Expand Down Expand Up @@ -1277,8 +1277,6 @@ impl Zeroize for RistrettoPoint {
mod test {
use super::*;
use crate::edwards::CompressedEdwardsY;
use crate::scalar::Scalar;
use crate::traits::Identity;

use rand_core::OsRng;

Expand Down
10 changes: 3 additions & 7 deletions curve25519-dalek/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@
//! has been enabled.

use core::borrow::Borrow;
use core::cmp::{Eq, PartialEq};
use core::convert::TryInto;
use core::fmt::Debug;
use core::iter::{Product, Sum};
use core::ops::Index;
Expand All @@ -124,6 +122,8 @@ use core::ops::{Sub, SubAssign};

use cfg_if::cfg_if;

use crate::constants;

#[cfg(feature = "group-bits")]
use group::ff::{FieldBits, PrimeFieldBits};
#[cfg(feature = "group")]
Expand All @@ -149,7 +149,6 @@ use subtle::CtOption;
use zeroize::Zeroize;

use crate::backend;
use crate::constants;

cfg_if! {
if #[cfg(curve25519_dalek_backend = "fiat")] {
Expand Down Expand Up @@ -402,7 +401,7 @@ impl ConditionallySelectable for Scalar {
#[cfg(feature = "serde")]
use serde::de::Visitor;
#[cfg(feature = "serde")]
use serde::{self, Deserialize, Deserializer, Serialize, Serializer};
use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[cfg(feature = "serde")]
#[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
Expand Down Expand Up @@ -1393,13 +1392,10 @@ pub const fn clamp_integer(mut bytes: [u8; 32]) -> [u8; 32] {
#[cfg(test)]
pub(crate) mod test {
use super::*;
use crate::constants;

#[cfg(feature = "alloc")]
use alloc::vec::Vec;

use rand::RngCore;

/// x = 2238329342913194256032495932344128051776374960164957527413114840482143558222
pub static X: Scalar = Scalar {
bytes: [
Expand Down
5 changes: 2 additions & 3 deletions curve25519-dalek/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@

use core::borrow::Borrow;

use subtle;

use crate::scalar::{clamp_integer, Scalar};
use subtle::ConstantTimeEq;

// ------------------------------------------------------------------------
// Public Traits
Expand All @@ -41,7 +40,7 @@ pub trait IsIdentity {
/// constructor.
impl<T> IsIdentity for T
where
T: subtle::ConstantTimeEq + Identity,
T: ConstantTimeEq + Identity,
{
fn is_identity(&self) -> bool {
self.ct_eq(&T::identity()).into()
Expand Down

0 comments on commit c6b2203

Please sign in to comment.