Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions elliptic-curve/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,13 @@ impl IsHigh for Scalar {
}

/// Example affine point type
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[derive(Clone, Copy, Default, Debug, Eq, PartialEq)]
pub enum AffinePoint {
/// Result of fixed-based scalar multiplication.
FixedBaseOutput(Scalar),

/// Identity.
#[default]
Identity,

/// Base point.
Expand Down Expand Up @@ -506,12 +507,6 @@ impl ConditionallySelectable for AffinePoint {
}
}

impl Default for AffinePoint {
fn default() -> Self {
Self::Identity
}
}

impl DefaultIsZeroes for AffinePoint {}

impl From<NonIdentity<AffinePoint>> for AffinePoint {
Expand Down Expand Up @@ -569,12 +564,13 @@ impl TryFrom<AffinePoint> for NonIdentity<AffinePoint> {
}

/// Example projective point type
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[derive(Clone, Copy, Default, Debug, Eq, PartialEq)]
pub enum ProjectivePoint {
/// Result of fixed-based scalar multiplication
FixedBaseOutput(Scalar),

/// Is this point the identity point?
#[default]
Identity,

/// Is this point the generator point?
Expand Down Expand Up @@ -620,12 +616,6 @@ impl ConditionallySelectable for ProjectivePoint {
}
}

impl Default for ProjectivePoint {
fn default() -> Self {
Self::Identity
}
}

impl DefaultIsZeroes for ProjectivePoint {}

impl From<AffinePoint> for ProjectivePoint {
Expand Down
9 changes: 2 additions & 7 deletions password-hash/src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use base64ct::{
};

/// Base64 encoding variants.
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
#[derive(Copy, Clone, Default, Debug, Eq, PartialEq, PartialOrd, Ord)]
#[non_exhaustive]
pub enum Encoding {
/// "B64" encoding: standard Base64 without padding.
Expand All @@ -16,6 +16,7 @@ pub enum Encoding {
/// 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2b, 0x2f
/// ```
/// <https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md#b64>
#[default]
B64,

/// bcrypt encoding.
Expand Down Expand Up @@ -47,12 +48,6 @@ pub enum Encoding {
ShaCrypt,
}

impl Default for Encoding {
fn default() -> Self {
Self::B64
}
}

impl Encoding {
/// Decode a Base64 string into the provided destination buffer.
pub fn decode(self, src: impl AsRef<[u8]>, dst: &mut [u8]) -> Result<&[u8], B64Error> {
Expand Down