Skip to content

Commit 2dc2b0e

Browse files
authored
Rename X25519 to Curve25519 (#302)
1 parent 7da97be commit 2dc2b0e

File tree

6 files changed

+142
-142
lines changed

6 files changed

+142
-142
lines changed

.github/workflows/main.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
- --features ristretto255-u64,ristretto255-voprf
1717
- --features ristretto255-u32,ristretto255-voprf
1818
-
19-
- --features x25519-u64,ristretto255-u64,ristretto255-voprf
20-
- --features x25519-u32,ristretto255-u32,ristretto255-voprf
21-
- --features x25519-u64
22-
- --features x25519-u32
19+
- --features curve25519-u64,ristretto255-u64,ristretto255-voprf
20+
- --features curve25519-u32,ristretto255-u32,ristretto255-voprf
21+
- --features curve25519-u64
22+
- --features curve25519-u32
2323
frontend_feature:
2424
-
2525
- --features argon2
@@ -64,10 +64,10 @@ jobs:
6464
- --features ristretto255-u64,ristretto255-voprf
6565
- --features ristretto255-u32,ristretto255-voprf
6666
-
67-
- x25519-u64,ristretto255-u64,ristretto255-voprf
68-
- x25519-u32,ristretto255-u64,ristretto255-voprf
69-
- x25519-u64
70-
- x25519-u32
67+
- curve25519-u64,ristretto255-u64,ristretto255-voprf
68+
- curve25519-u32,ristretto255-u64,ristretto255-voprf
69+
- curve25519-u64
70+
- curve25519-u32
7171
steps:
7272
- uses: actions/checkout@v3
7373
- uses: hecrj/setup-rust-action@v1
@@ -138,10 +138,10 @@ jobs:
138138
- ristretto255-u64,ristretto255-voprf
139139
- ristretto255-u32,ristretto255-voprf
140140
-
141-
- x25519-u64,ristretto255-u64,ristretto255-voprf
142-
- x25519-u32,ristretto255-u32,ristretto255-voprf
143-
- x25519-u64
144-
- x25519-u32
141+
- curve25519-u64,ristretto255-u64,ristretto255-voprf
142+
- curve25519-u32,ristretto255-u32,ristretto255-voprf
143+
- curve25519-u64
144+
- curve25519-u32
145145
frontend_feature:
146146
- argon2
147147
- serde
@@ -161,10 +161,10 @@ jobs:
161161
- --features ristretto255-u64,ristretto255-voprf
162162
- --features ristretto255-u32,ristretto255-voprf
163163
-
164-
- --features x25519-u64,ristretto255-u64,ristretto255-voprf
165-
- --features x25519-u32,ristretto255-u32,ristretto255-voprf
166-
- --features x25519-u32
167-
- --features x25519-u32
164+
- --features curve25519-u64,ristretto255-u64,ristretto255-voprf
165+
- --features curve25519-u32,ristretto255-u32,ristretto255-voprf
166+
- --features curve25519-u32
167+
- --features curve25519-u32
168168
steps:
169169
- name: Checkout sources
170170
uses: actions/checkout@v3
@@ -201,15 +201,15 @@ jobs:
201201
uses: actions-rs/cargo@v1
202202
with:
203203
command: clippy
204-
args: --all-targets --features argon2,std,x25519-u64 -- -D warnings
204+
args: --all-targets --features argon2,std,curve25519-u64 -- -D warnings
205205

206206
- name: Run cargo doc
207207
uses: actions-rs/cargo@v1
208208
env:
209209
RUSTDOCFLAGS: -D warnings
210210
with:
211211
command: doc
212-
args: --no-deps --document-private-items --features argon2,std,x25519-u64
212+
args: --no-deps --document-private-items --features argon2,std,curve25519-u64
213213

214214
format:
215215
name: cargo fmt

Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ rust-version = "1.57"
1212
version = "2.0.0"
1313

1414
[features]
15+
curve25519 = ["curve25519-dalek"]
16+
curve25519-fiat-u32 = ["curve25519-dalek/fiat_u32_backend", "curve25519"]
17+
curve25519-fiat-u64 = ["curve25519-dalek/fiat_u64_backend", "curve25519"]
18+
curve25519-u32 = ["curve25519-dalek/u32_backend", "curve25519"]
19+
curve25519-u64 = ["curve25519-dalek/u64_backend", "curve25519"]
20+
curve255195519-simd = ["curve25519-dalek/simd_backend", "curve25519"]
1521
default = ["ristretto255-u64", "ristretto255-voprf", "serde"]
1622
ristretto255 = ["curve25519-dalek", "voprf/ristretto255"]
1723
ristretto255-fiat-u32 = ["curve25519-dalek/fiat_u32_backend", "ristretto255"]
@@ -22,12 +28,6 @@ ristretto255-u64 = ["curve25519-dalek/u64_backend", "ristretto255"]
2228
ristretto255-voprf = ["ristretto255", "voprf/ristretto255-ciphersuite"]
2329
serde = ["serde_", "generic-array/serde", "voprf/serde"]
2430
std = ["getrandom"]
25-
x25519 = ["curve25519-dalek"]
26-
x25519-fiat-u32 = ["curve25519-dalek/fiat_u32_backend", "x25519"]
27-
x25519-fiat-u64 = ["curve25519-dalek/fiat_u64_backend", "x25519"]
28-
x25519-simd = ["curve25519-dalek/simd_backend", "x25519"]
29-
x25519-u32 = ["curve25519-dalek/u32_backend", "x25519"]
30-
x25519-u64 = ["curve25519-dalek/u64_backend", "x25519"]
3131

3232
[dependencies]
3333
argon2 = { version = "0.4", default-features = false, features = [
@@ -74,7 +74,7 @@ harness = false
7474
name = "opaque"
7575

7676
[package.metadata.docs.rs]
77-
features = ["argon2", "std", "x25519-u64"]
77+
features = ["argon2", "std", "curve25519-u64"]
7878
targets = []
7979

8080
[[example]]

src/key_exchange/group/x25519.rs src/key_exchange/group/curve25519.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// License, Version 2.0 found in the LICENSE-APACHE file in the root directory
66
// of this source tree.
77

8-
//! Key Exchange group implementation for X25519
8+
//! Key Exchange group implementation for Curve25519
99
1010
use curve25519_dalek::constants::ED25519_BASEPOINT_TABLE;
1111
use curve25519_dalek::montgomery::MontgomeryPoint;
@@ -22,11 +22,11 @@ use subtle::ConstantTimeEq;
2222
use super::KeGroup;
2323
use crate::errors::InternalError;
2424

25-
/// Implementation for X25519.
26-
pub struct X25519;
25+
/// Implementation for Curve25519.
26+
pub struct Curve25519;
2727

28-
/// The implementation of such a subgroup for Ristretto
29-
impl KeGroup for X25519 {
28+
/// The implementation of such a subgroup for Curve25519
29+
impl KeGroup for Curve25519 {
3030
type Pk = MontgomeryPoint;
3131
type PkLen = U32;
3232
type Sk = Scalar;

src/key_exchange/group/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
//! Includes the KeGroup trait and definitions for the key exchange groups
99
10+
#[cfg(feature = "curve25519")]
11+
pub mod curve25519;
1012
mod elliptic_curve;
1113
#[cfg(feature = "ristretto255")]
1214
pub mod ristretto255;
13-
#[cfg(feature = "x25519")]
14-
pub mod x25519;
1515

1616
use digest::core_api::BlockSizeUser;
1717
use digest::{Digest, OutputSizeUser};

src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1106,9 +1106,9 @@
11061106
//! `curve25519-dalek` will fail to compile without a selected backend. This
11071107
//! enables the use of [`Ristretto255`] as a `KeGroup` and `OprfCs`.
11081108
//!
1109-
//! - The `x25519` feature is similar to the `ristretto255` feature and requires
1110-
//! to select a backend like `x25519-u64`, other backends are the same as in
1111-
//! `ristretto255-*`. This enables [`X25519`] as a `KeGroup`.
1109+
//! - The `curve25519` feature is similar to the `ristretto255` feature and
1110+
//! requires to select a backend like `curve25519-u64`, other backends are the
1111+
//! same as in `ristretto255-*`. This enables [`Curve25519`] as a `KeGroup`.
11121112
//!
11131113
//! - The `ristretto255-simd` feature is re-exported from [curve25519-dalek](https://doc.dalek.rs/curve25519_dalek/index.html#backends-and-features)
11141114
//! and enables parallel formulas, using either AVX2 or AVX512-IFMA. This will
@@ -1157,10 +1157,10 @@ mod tests;
11571157
pub use ciphersuite::CipherSuite;
11581158
pub use rand;
11591159

1160+
#[cfg(feature = "curve25519")]
1161+
pub use crate::key_exchange::group::curve25519::Curve25519;
11601162
#[cfg(feature = "ristretto255")]
11611163
pub use crate::key_exchange::group::ristretto255::Ristretto255;
1162-
#[cfg(feature = "x25519")]
1163-
pub use crate::key_exchange::group::x25519::X25519;
11641164
pub use crate::messages::{
11651165
CredentialFinalization, CredentialFinalizationLen, CredentialRequest, CredentialRequestLen,
11661166
CredentialResponse, CredentialResponseLen, RegistrationRequest, RegistrationRequestLen,

0 commit comments

Comments
 (0)