From 86832640ed5433d173281c552471576f6afbebbd Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Mon, 7 Jul 2025 17:15:06 -0400 Subject: [PATCH] curve: Undeprecate Scalar::from_bits (#780) --- curve25519-dalek/src/scalar.rs | 4 ---- ed25519-dalek/src/signature.rs | 2 -- 2 files changed, 6 deletions(-) diff --git a/curve25519-dalek/src/scalar.rs b/curve25519-dalek/src/scalar.rs index cd58134..fc8939f 100644 --- a/curve25519-dalek/src/scalar.rs +++ b/curve25519-dalek/src/scalar.rs @@ -271,10 +271,6 @@ impl Scalar { /// `EdwardsPoint::vartime_double_scalar_mul_basepoint`. **Do not use this function** unless /// you absolutely have to. #[cfg(feature = "legacy_compatibility")] - #[deprecated( - since = "4.0.0", - note = "This constructor outputs scalars with undefined scalar-scalar arithmetic. See docs." - )] pub const fn from_bits(bytes: [u8; 32]) -> Scalar { let mut s = Scalar { bytes }; // Ensure invariant #1 holds. That is, make s < 2^255 by masking the high bit. diff --git a/ed25519-dalek/src/signature.rs b/ed25519-dalek/src/signature.rs index ae3f9bf..399b6dd 100644 --- a/ed25519-dalek/src/signature.rs +++ b/ed25519-dalek/src/signature.rs @@ -80,8 +80,6 @@ fn check_scalar(bytes: [u8; 32]) -> Result { // You cannot do arithmetic with scalars construct with Scalar::from_bits. We only use this // scalar for EdwardsPoint::vartime_double_scalar_mul_basepoint, which is an accepted usecase. - // The `from_bits` method is deprecated because it's unsafe. We know this. - #[allow(deprecated)] Ok(Scalar::from_bits(bytes)) }