Skip to content

Commit

Permalink
elliptic-curve: derive Copy on PublicKey (#666)
Browse files Browse the repository at this point in the history
The new trait bounds on `AffineArithmetic` ensure that `AffinePoint` is
always `Copy`. So the previously imposed trait bounds prevent `Copy`
impls which should be available by default.
  • Loading branch information
tarcieri authored Jun 9, 2021
1 parent 7b9a416 commit 7d4e916
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions elliptic-curve/src/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use alloc::string::{String, ToString};
/// When the `pem` feature of this crate (or a specific RustCrypto elliptic
/// curve crate) is enabled, a [`FromStr`] impl is also available.
#[cfg_attr(docsrs, doc(cfg(feature = "arithmetic")))]
#[derive(Clone, Debug)]
#[derive(Copy, Clone, Debug)]
pub struct PublicKey<C>
where
C: Curve + ProjectiveArithmetic,
Expand Down Expand Up @@ -260,14 +260,6 @@ where
}
}

impl<C> Copy for PublicKey<C>
where
C: Curve + ProjectiveArithmetic,

AffinePoint<C>: Copy + Clone + Debug,
{
}

impl<C> Eq for PublicKey<C>
where
C: Curve + ProjectiveArithmetic,
Expand Down

0 comments on commit 7d4e916

Please sign in to comment.