Skip to content

Commit f12bd66

Browse files
committed
bump edition to 2024; bump MSRV to 1.85
1 parent 514f255 commit f12bd66

File tree

28 files changed

+102
-91
lines changed

28 files changed

+102
-91
lines changed

.github/workflows/curve25519-dalek.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
run: cargo test --no-default-features --features alloc,precomputed-tables,zeroize,group-bits --target x86_64-unknown-linux-gnu
131131

132132
msrv:
133-
name: Current MSRV is 1.60.0
133+
name: Current MSRV is 1.85.0
134134
runs-on: ubuntu-latest
135135
steps:
136136
- uses: actions/checkout@v3
@@ -139,7 +139,7 @@ jobs:
139139
- run: cargo update -Z minimal-versions
140140
# Now check that `cargo build` works with respect to the oldest possible
141141
# deps and the stated MSRV
142-
- uses: dtolnay/rust-toolchain@1.60.0
142+
- uses: dtolnay/rust-toolchain@1.85.0
143143
- run: cargo build --no-default-features --features serde
144144
# Also make sure the AVX2 build works
145145
- run: cargo build --target x86_64-unknown-linux-gnu

.github/workflows/ed25519-dalek.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
jobs:
2121

2222
msrv:
23-
name: Current MSRV is 1.72.0
23+
name: Current MSRV is 1.85.0
2424
runs-on: ubuntu-latest
2525
steps:
2626
- uses: actions/checkout@v3
@@ -29,5 +29,5 @@ jobs:
2929
- run: cargo update -Z minimal-versions
3030
# Now check that `cargo build` works with respect to the oldest possible
3131
# deps and the stated MSRV
32-
- uses: dtolnay/rust-toolchain@1.72.0
32+
- uses: dtolnay/rust-toolchain@1.85.0
3333
- run: cargo build

.github/workflows/workspace.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
runs-on: ubuntu-latest
8686
steps:
8787
- uses: actions/checkout@v3
88-
- uses: dtolnay/rust-toolchain@1.81.0
88+
- uses: dtolnay/rust-toolchain@1.85.0
8989
with:
9090
components: clippy
9191
- run: cargo clippy --target x86_64-unknown-linux-gnu --all-features

.github/workflows/x25519-dalek.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
jobs:
2121

2222
msrv:
23-
name: Current MSRV is 1.60.0
23+
name: Current MSRV is 1.85.0
2424
runs-on: ubuntu-latest
2525
steps:
2626
- uses: actions/checkout@v3
@@ -29,5 +29,5 @@ jobs:
2929
- run: cargo update -Z minimal-versions
3030
# Now check that `cargo build` works with respect to the oldest possible
3131
# deps and the stated MSRV
32-
- uses: dtolnay/rust-toolchain@1.60.0
32+
- uses: dtolnay/rust-toolchain@1.85.0
3333
- run: cargo build

curve25519-dalek/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ name = "curve25519-dalek"
55
# - update README if required by semver
66
# - if README was updated, also update module documentation in src/lib.rs
77
version = "4.1.3"
8-
edition = "2021"
9-
rust-version = "1.60.0"
8+
edition = "2024"
9+
rust-version = "1.85.0"
1010
authors = ["Isis Lovecruft <[email protected]>",
1111
"Henry de Valence <[email protected]>"]
1212
readme = "README.md"

curve25519-dalek/benches/dalek_benchmarks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use rand::{TryRngCore, rng, rngs::OsRng};
44

55
use criterion::{
6-
criterion_main, measurement::Measurement, BatchSize, BenchmarkGroup, BenchmarkId, Criterion,
6+
BatchSize, BenchmarkGroup, BenchmarkId, Criterion, criterion_main, measurement::Measurement,
77
};
88

99
use curve25519_dalek::constants;

curve25519-dalek/src/backend/serial/curve_models/mod.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ impl ProjectivePoint {
408408
//
409409
// upstream rust issue: https://github.com/rust-lang/rust/issues/46380
410410
//#[doc(hidden)]
411-
impl<'a, 'b> Add<&'b ProjectiveNielsPoint> for &'a EdwardsPoint {
411+
impl<'b> Add<&'b ProjectiveNielsPoint> for &EdwardsPoint {
412412
type Output = CompletedPoint;
413413

414414
fn add(self, other: &'b ProjectiveNielsPoint) -> CompletedPoint {
@@ -430,7 +430,7 @@ impl<'a, 'b> Add<&'b ProjectiveNielsPoint> for &'a EdwardsPoint {
430430
}
431431

432432
//#[doc(hidden)]
433-
impl<'a, 'b> Sub<&'b ProjectiveNielsPoint> for &'a EdwardsPoint {
433+
impl<'b> Sub<&'b ProjectiveNielsPoint> for &EdwardsPoint {
434434
type Output = CompletedPoint;
435435

436436
fn sub(self, other: &'b ProjectiveNielsPoint) -> CompletedPoint {
@@ -452,7 +452,7 @@ impl<'a, 'b> Sub<&'b ProjectiveNielsPoint> for &'a EdwardsPoint {
452452
}
453453

454454
//#[doc(hidden)]
455-
impl<'a, 'b> Add<&'b AffineNielsPoint> for &'a EdwardsPoint {
455+
impl<'b> Add<&'b AffineNielsPoint> for &EdwardsPoint {
456456
type Output = CompletedPoint;
457457

458458
fn add(self, other: &'b AffineNielsPoint) -> CompletedPoint {
@@ -473,7 +473,7 @@ impl<'a, 'b> Add<&'b AffineNielsPoint> for &'a EdwardsPoint {
473473
}
474474

475475
//#[doc(hidden)]
476-
impl<'a, 'b> Sub<&'b AffineNielsPoint> for &'a EdwardsPoint {
476+
impl<'b> Sub<&'b AffineNielsPoint> for &EdwardsPoint {
477477
type Output = CompletedPoint;
478478

479479
fn sub(self, other: &'b AffineNielsPoint) -> CompletedPoint {
@@ -497,7 +497,7 @@ impl<'a, 'b> Sub<&'b AffineNielsPoint> for &'a EdwardsPoint {
497497
// Negation
498498
// ------------------------------------------------------------------------
499499

500-
impl<'a> Neg for &'a ProjectiveNielsPoint {
500+
impl Neg for &ProjectiveNielsPoint {
501501
type Output = ProjectiveNielsPoint;
502502

503503
fn neg(self) -> ProjectiveNielsPoint {
@@ -510,7 +510,7 @@ impl<'a> Neg for &'a ProjectiveNielsPoint {
510510
}
511511
}
512512

513-
impl<'a> Neg for &'a AffineNielsPoint {
513+
impl Neg for &AffineNielsPoint {
514514
type Output = AffineNielsPoint;
515515

516516
fn neg(self) -> AffineNielsPoint {
@@ -558,7 +558,10 @@ impl Debug for AffineNielsPoint {
558558

559559
impl Debug for ProjectiveNielsPoint {
560560
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
561-
write!(f, "ProjectiveNielsPoint{{\n\tY_plus_X: {:?},\n\tY_minus_X: {:?},\n\tZ: {:?},\n\tT2d: {:?}\n}}",
562-
&self.Y_plus_X, &self.Y_minus_X, &self.Z, &self.T2d)
561+
write!(
562+
f,
563+
"ProjectiveNielsPoint{{\n\tY_plus_X: {:?},\n\tY_minus_X: {:?},\n\tZ: {:?},\n\tT2d: {:?}\n}}",
564+
&self.Y_plus_X, &self.Y_minus_X, &self.Z, &self.T2d
565+
)
563566
}
564567
}

curve25519-dalek/src/backend/serial/u64/field.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'b> AddAssign<&'b FieldElement51> for FieldElement51 {
6363
}
6464
}
6565

66-
impl<'a, 'b> Add<&'b FieldElement51> for &'a FieldElement51 {
66+
impl<'b> Add<&'b FieldElement51> for &FieldElement51 {
6767
type Output = FieldElement51;
6868
fn add(self, _rhs: &'b FieldElement51) -> FieldElement51 {
6969
let mut output = *self;
@@ -79,7 +79,7 @@ impl<'b> SubAssign<&'b FieldElement51> for FieldElement51 {
7979
}
8080
}
8181

82-
impl<'a, 'b> Sub<&'b FieldElement51> for &'a FieldElement51 {
82+
impl<'b> Sub<&'b FieldElement51> for &FieldElement51 {
8383
type Output = FieldElement51;
8484
fn sub(self, _rhs: &'b FieldElement51) -> FieldElement51 {
8585
// To avoid underflow, first add a multiple of p.
@@ -108,7 +108,7 @@ impl<'b> MulAssign<&'b FieldElement51> for FieldElement51 {
108108
}
109109
}
110110

111-
impl<'a, 'b> Mul<&'b FieldElement51> for &'a FieldElement51 {
111+
impl<'b> Mul<&'b FieldElement51> for &FieldElement51 {
112112
type Output = FieldElement51;
113113

114114
#[rustfmt::skip] // keep alignment of c* calculations
@@ -213,7 +213,7 @@ impl<'a, 'b> Mul<&'b FieldElement51> for &'a FieldElement51 {
213213
}
214214
}
215215

216-
impl<'a> Neg for &'a FieldElement51 {
216+
impl Neg for &FieldElement51 {
217217
type Output = FieldElement51;
218218
fn neg(self) -> FieldElement51 {
219219
let mut output = *self;

curve25519-dalek/src/backend/vector/avx2/field.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use core::ops::{Add, Mul, Neg};
4545

4646
use crate::backend::serial::u64::field::FieldElement51;
4747
use crate::backend::vector::avx2::constants::{
48-
P_TIMES_16_HI, P_TIMES_16_LO, P_TIMES_2_HI, P_TIMES_2_LO,
48+
P_TIMES_2_HI, P_TIMES_2_LO, P_TIMES_16_HI, P_TIMES_16_LO,
4949
};
5050

5151
use curve25519_dalek_derive::unsafe_target_feature;

curve25519-dalek/src/edwards.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ use core::ops::{Mul, MulAssign};
104104
use cfg_if::cfg_if;
105105

106106
#[cfg(feature = "digest")]
107-
use digest::{array::typenum::U64, Digest};
107+
use digest::{Digest, array::typenum::U64};
108108

109109
#[cfg(feature = "group")]
110110
use {
111-
group::{cofactor::CofactorGroup, prime::PrimeGroup, GroupEncoding},
111+
group::{GroupEncoding, cofactor::CofactorGroup, prime::PrimeGroup},
112112
subtle::CtOption,
113113
};
114114

@@ -126,7 +126,7 @@ use zeroize::Zeroize;
126126
use crate::constants;
127127

128128
use crate::field::FieldElement;
129-
use crate::scalar::{clamp_integer, Scalar};
129+
use crate::scalar::{Scalar, clamp_integer};
130130

131131
use crate::montgomery::MontgomeryPoint;
132132

@@ -137,8 +137,8 @@ use crate::backend::serial::curve_models::ProjectivePoint;
137137

138138
#[cfg(feature = "precomputed-tables")]
139139
use crate::window::{
140-
LookupTableRadix128, LookupTableRadix16, LookupTableRadix256, LookupTableRadix32,
141-
LookupTableRadix64,
140+
LookupTableRadix16, LookupTableRadix32, LookupTableRadix64, LookupTableRadix128,
141+
LookupTableRadix256,
142142
};
143143

144144
#[cfg(feature = "precomputed-tables")]
@@ -622,7 +622,7 @@ impl EdwardsPoint {
622622
// Addition and Subtraction
623623
// ------------------------------------------------------------------------
624624

625-
impl<'a, 'b> Add<&'b EdwardsPoint> for &'a EdwardsPoint {
625+
impl<'b> Add<&'b EdwardsPoint> for &EdwardsPoint {
626626
type Output = EdwardsPoint;
627627
fn add(self, other: &'b EdwardsPoint) -> EdwardsPoint {
628628
(self + &other.as_projective_niels()).as_extended()
@@ -643,7 +643,7 @@ impl<'b> AddAssign<&'b EdwardsPoint> for EdwardsPoint {
643643

644644
define_add_assign_variants!(LHS = EdwardsPoint, RHS = EdwardsPoint);
645645

646-
impl<'a, 'b> Sub<&'b EdwardsPoint> for &'a EdwardsPoint {
646+
impl<'b> Sub<&'b EdwardsPoint> for &EdwardsPoint {
647647
type Output = EdwardsPoint;
648648
fn sub(self, other: &'b EdwardsPoint) -> EdwardsPoint {
649649
(self - &other.as_projective_niels()).as_extended()
@@ -680,7 +680,7 @@ where
680680
// Negation
681681
// ------------------------------------------------------------------------
682682

683-
impl<'a> Neg for &'a EdwardsPoint {
683+
impl Neg for &EdwardsPoint {
684684
type Output = EdwardsPoint;
685685

686686
fn neg(self) -> EdwardsPoint {
@@ -717,7 +717,7 @@ define_mul_assign_variants!(LHS = EdwardsPoint, RHS = Scalar);
717717
define_mul_variants!(LHS = EdwardsPoint, RHS = Scalar, Output = EdwardsPoint);
718718
define_mul_variants!(LHS = Scalar, RHS = EdwardsPoint, Output = EdwardsPoint);
719719

720-
impl<'a, 'b> Mul<&'b Scalar> for &'a EdwardsPoint {
720+
impl<'b> Mul<&'b Scalar> for &EdwardsPoint {
721721
type Output = EdwardsPoint;
722722
/// Scalar multiplication: compute `scalar * self`.
723723
///
@@ -728,7 +728,7 @@ impl<'a, 'b> Mul<&'b Scalar> for &'a EdwardsPoint {
728728
}
729729
}
730730

731-
impl<'a, 'b> Mul<&'b EdwardsPoint> for &'a Scalar {
731+
impl<'b> Mul<&'b EdwardsPoint> for &Scalar {
732732
type Output = EdwardsPoint;
733733

734734
/// Scalar multiplication: compute `scalar * self`.

curve25519-dalek/src/montgomery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ use core::{
5757
use crate::constants::{APLUS2_OVER_FOUR, MONTGOMERY_A, MONTGOMERY_A_NEG};
5858
use crate::edwards::{CompressedEdwardsY, EdwardsPoint};
5959
use crate::field::FieldElement;
60-
use crate::scalar::{clamp_integer, Scalar};
60+
use crate::scalar::{Scalar, clamp_integer};
6161

6262
use crate::traits::Identity;
6363

curve25519-dalek/src/ristretto.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,17 +172,17 @@ use core::ops::{Mul, MulAssign};
172172
#[cfg(feature = "rand_core")]
173173
use rand_core::TryCryptoRng;
174174

175-
#[cfg(feature = "digest")]
176-
use digest::array::typenum::U64;
177175
#[cfg(feature = "digest")]
178176
use digest::Digest;
177+
#[cfg(feature = "digest")]
178+
use digest::array::typenum::U64;
179179

180180
use crate::constants;
181181
use crate::field::FieldElement;
182182

183183
#[cfg(feature = "group")]
184184
use {
185-
group::{cofactor::CofactorGroup, prime::PrimeGroup, GroupEncoding},
185+
group::{GroupEncoding, cofactor::CofactorGroup, prime::PrimeGroup},
186186
rand_core::TryRngCore,
187187
subtle::CtOption,
188188
};
@@ -847,7 +847,7 @@ impl Eq for RistrettoPoint {}
847847
// Arithmetic
848848
// ------------------------------------------------------------------------
849849

850-
impl<'a, 'b> Add<&'b RistrettoPoint> for &'a RistrettoPoint {
850+
impl<'b> Add<&'b RistrettoPoint> for &RistrettoPoint {
851851
type Output = RistrettoPoint;
852852

853853
fn add(self, other: &'b RistrettoPoint) -> RistrettoPoint {
@@ -861,15 +861,15 @@ define_add_variants!(
861861
Output = RistrettoPoint
862862
);
863863

864-
impl<'b> AddAssign<&'b RistrettoPoint> for RistrettoPoint {
864+
impl AddAssign<&RistrettoPoint> for RistrettoPoint {
865865
fn add_assign(&mut self, _rhs: &RistrettoPoint) {
866866
*self = (self as &RistrettoPoint) + _rhs;
867867
}
868868
}
869869

870870
define_add_assign_variants!(LHS = RistrettoPoint, RHS = RistrettoPoint);
871871

872-
impl<'a, 'b> Sub<&'b RistrettoPoint> for &'a RistrettoPoint {
872+
impl<'b> Sub<&'b RistrettoPoint> for &RistrettoPoint {
873873
type Output = RistrettoPoint;
874874

875875
fn sub(self, other: &'b RistrettoPoint) -> RistrettoPoint {
@@ -883,7 +883,7 @@ define_sub_variants!(
883883
Output = RistrettoPoint
884884
);
885885

886-
impl<'b> SubAssign<&'b RistrettoPoint> for RistrettoPoint {
886+
impl SubAssign<&RistrettoPoint> for RistrettoPoint {
887887
fn sub_assign(&mut self, _rhs: &RistrettoPoint) {
888888
*self = (self as &RistrettoPoint) - _rhs;
889889
}
@@ -903,7 +903,7 @@ where
903903
}
904904
}
905905

906-
impl<'a> Neg for &'a RistrettoPoint {
906+
impl Neg for &RistrettoPoint {
907907
type Output = RistrettoPoint;
908908

909909
fn neg(self) -> RistrettoPoint {
@@ -926,15 +926,15 @@ impl<'b> MulAssign<&'b Scalar> for RistrettoPoint {
926926
}
927927
}
928928

929-
impl<'a, 'b> Mul<&'b Scalar> for &'a RistrettoPoint {
929+
impl<'b> Mul<&'b Scalar> for &RistrettoPoint {
930930
type Output = RistrettoPoint;
931931
/// Scalar multiplication: compute `scalar * self`.
932932
fn mul(self, scalar: &'b Scalar) -> RistrettoPoint {
933933
RistrettoPoint(self.0 * scalar)
934934
}
935935
}
936936

937-
impl<'a, 'b> Mul<&'b RistrettoPoint> for &'a Scalar {
937+
impl<'b> Mul<&'b RistrettoPoint> for &Scalar {
938938
type Output = RistrettoPoint;
939939

940940
/// Scalar multiplication: compute `self * scalar`.
@@ -1081,7 +1081,7 @@ impl RistrettoPoint {
10811081
pub struct RistrettoBasepointTable(pub(crate) EdwardsBasepointTable);
10821082

10831083
#[cfg(feature = "precomputed-tables")]
1084-
impl<'a, 'b> Mul<&'b Scalar> for &'a RistrettoBasepointTable {
1084+
impl<'b> Mul<&'b Scalar> for &RistrettoBasepointTable {
10851085
type Output = RistrettoPoint;
10861086

10871087
fn mul(self, scalar: &'b Scalar) -> RistrettoPoint {
@@ -1090,7 +1090,7 @@ impl<'a, 'b> Mul<&'b Scalar> for &'a RistrettoBasepointTable {
10901090
}
10911091

10921092
#[cfg(feature = "precomputed-tables")]
1093-
impl<'a, 'b> Mul<&'a RistrettoBasepointTable> for &'b Scalar {
1093+
impl<'a> Mul<&'a RistrettoBasepointTable> for &Scalar {
10941094
type Output = RistrettoPoint;
10951095

10961096
fn mul(self, basepoint_table: &'a RistrettoBasepointTable) -> RistrettoPoint {

0 commit comments

Comments
 (0)