Skip to content

Commit

Permalink
Rename X25519 to Curve25519
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Dec 19, 2022
1 parent 7da97be commit 4c630ea
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 142 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- --features ristretto255-u64,ristretto255-voprf
- --features ristretto255-u32,ristretto255-voprf
-
- --features x25519-u64,ristretto255-u64,ristretto255-voprf
- --features x25519-u32,ristretto255-u32,ristretto255-voprf
- --features x25519-u64
- --features x25519-u32
- --features curve25519-u64,ristretto255-u64,ristretto255-voprf
- --features curve25519-u32,ristretto255-u32,ristretto255-voprf
- --features curve25519-u64
- --features curve25519-u32
frontend_feature:
-
- --features argon2
Expand Down Expand Up @@ -64,10 +64,10 @@ jobs:
- --features ristretto255-u64,ristretto255-voprf
- --features ristretto255-u32,ristretto255-voprf
-
- x25519-u64,ristretto255-u64,ristretto255-voprf
- x25519-u32,ristretto255-u64,ristretto255-voprf
- x25519-u64
- x25519-u32
- curve25519-u64,ristretto255-u64,ristretto255-voprf
- curve25519-u32,ristretto255-u64,ristretto255-voprf
- curve25519-u64
- curve25519-u32
steps:
- uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v1
Expand Down Expand Up @@ -138,10 +138,10 @@ jobs:
- ristretto255-u64,ristretto255-voprf
- ristretto255-u32,ristretto255-voprf
-
- x25519-u64,ristretto255-u64,ristretto255-voprf
- x25519-u32,ristretto255-u32,ristretto255-voprf
- x25519-u64
- x25519-u32
- curve25519-u64,ristretto255-u64,ristretto255-voprf
- curve25519-u32,ristretto255-u32,ristretto255-voprf
- curve25519-u64
- curve25519-u32
frontend_feature:
- argon2
- serde
Expand All @@ -161,10 +161,10 @@ jobs:
- --features ristretto255-u64,ristretto255-voprf
- --features ristretto255-u32,ristretto255-voprf
-
- --features x25519-u64,ristretto255-u64,ristretto255-voprf
- --features x25519-u32,ristretto255-u32,ristretto255-voprf
- --features x25519-u32
- --features x25519-u32
- --features curve25519-u64,ristretto255-u64,ristretto255-voprf
- --features curve25519-u32,ristretto255-u32,ristretto255-voprf
- --features curve25519-u32
- --features curve25519-u32
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand Down Expand Up @@ -201,15 +201,15 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --features argon2,std,x25519-u64 -- -D warnings
args: --all-targets --features argon2,std,curve25519-u64 -- -D warnings

- name: Run cargo doc
uses: actions-rs/cargo@v1
env:
RUSTDOCFLAGS: -D warnings
with:
command: doc
args: --no-deps --document-private-items --features argon2,std,x25519-u64
args: --no-deps --document-private-items --features argon2,std,curve25519-u64

format:
name: cargo fmt
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

* Added CipherSuite API for specifying underlying primitives
* Added support for specifying a slow password hashing function
* Collapsed SignalKeyPair to X25519KeyPair
* Collapsed SignalKeyPair to Curve25519KeyPair
* Updated the envelope implementation to match the suggested XOR-based
construction in https://tools.ietf.org/html/draft-krawczyk-cfrg-opaque-06
* Included randomized tests for testing try_from crashes
Expand Down
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ rust-version = "1.57"
version = "2.0.0"

[features]
curve25519 = ["curve25519-dalek"]
curve25519-fiat-u32 = ["curve25519-dalek/fiat_u32_backend", "curve25519"]
curve25519-fiat-u64 = ["curve25519-dalek/fiat_u64_backend", "curve25519"]
curve25519-u32 = ["curve25519-dalek/u32_backend", "curve25519"]
curve25519-u64 = ["curve25519-dalek/u64_backend", "curve25519"]
curve255195519-simd = ["curve25519-dalek/simd_backend", "curve25519"]
default = ["ristretto255-u64", "ristretto255-voprf", "serde"]
ristretto255 = ["curve25519-dalek", "voprf/ristretto255"]
ristretto255-fiat-u32 = ["curve25519-dalek/fiat_u32_backend", "ristretto255"]
Expand All @@ -22,12 +28,6 @@ ristretto255-u64 = ["curve25519-dalek/u64_backend", "ristretto255"]
ristretto255-voprf = ["ristretto255", "voprf/ristretto255-ciphersuite"]
serde = ["serde_", "generic-array/serde", "voprf/serde"]
std = ["getrandom"]
x25519 = ["curve25519-dalek"]
x25519-fiat-u32 = ["curve25519-dalek/fiat_u32_backend", "x25519"]
x25519-fiat-u64 = ["curve25519-dalek/fiat_u64_backend", "x25519"]
x25519-simd = ["curve25519-dalek/simd_backend", "x25519"]
x25519-u32 = ["curve25519-dalek/u32_backend", "x25519"]
x25519-u64 = ["curve25519-dalek/u64_backend", "x25519"]

[dependencies]
argon2 = { version = "0.4", default-features = false, features = [
Expand Down Expand Up @@ -74,7 +74,7 @@ harness = false
name = "opaque"

[package.metadata.docs.rs]
features = ["argon2", "std", "x25519-u64"]
features = ["argon2", "std", "curve25519-u64"]
targets = []

[[example]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// License, Version 2.0 found in the LICENSE-APACHE file in the root directory
// of this source tree.

//! Key Exchange group implementation for X25519
//! Key Exchange group implementation for Curve25519
use curve25519_dalek::constants::ED25519_BASEPOINT_TABLE;
use curve25519_dalek::montgomery::MontgomeryPoint;
Expand All @@ -22,11 +22,11 @@ use subtle::ConstantTimeEq;
use super::KeGroup;
use crate::errors::InternalError;

/// Implementation for X25519.
pub struct X25519;
/// Implementation for Curve25519.
pub struct Curve25519;

/// The implementation of such a subgroup for Ristretto
impl KeGroup for X25519 {
impl KeGroup for Curve25519 {
type Pk = MontgomeryPoint;
type PkLen = U32;
type Sk = Scalar;
Expand Down
4 changes: 2 additions & 2 deletions src/key_exchange/group/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

//! Includes the KeGroup trait and definitions for the key exchange groups
#[cfg(feature = "curve25519")]
pub mod curve25519;
mod elliptic_curve;
#[cfg(feature = "ristretto255")]
pub mod ristretto255;
#[cfg(feature = "x25519")]
pub mod x25519;

use digest::core_api::BlockSizeUser;
use digest::{Digest, OutputSizeUser};
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,9 +1106,9 @@
//! `curve25519-dalek` will fail to compile without a selected backend. This
//! enables the use of [`Ristretto255`] as a `KeGroup` and `OprfCs`.
//!
//! - The `x25519` feature is similar to the `ristretto255` feature and requires
//! to select a backend like `x25519-u64`, other backends are the same as in
//! `ristretto255-*`. This enables [`X25519`] as a `KeGroup`.
//! - The `curve25519` feature is similar to the `ristretto255` feature and
//! requires to select a backend like `curve25519-u64`, other backends are the
//! same as in `ristretto255-*`. This enables [`Curve25519`] as a `KeGroup`.
//!
//! - The `ristretto255-simd` feature is re-exported from [curve25519-dalek](https://doc.dalek.rs/curve25519_dalek/index.html#backends-and-features)
//! and enables parallel formulas, using either AVX2 or AVX512-IFMA. This will
Expand Down Expand Up @@ -1157,10 +1157,10 @@ mod tests;
pub use ciphersuite::CipherSuite;
pub use rand;

#[cfg(feature = "curve25519")]
pub use crate::key_exchange::group::curve25519::Curve25519;
#[cfg(feature = "ristretto255")]
pub use crate::key_exchange::group::ristretto255::Ristretto255;
#[cfg(feature = "x25519")]
pub use crate::key_exchange::group::x25519::X25519;
pub use crate::messages::{
CredentialFinalization, CredentialFinalizationLen, CredentialRequest, CredentialRequestLen,
CredentialResponse, CredentialResponseLen, RegistrationRequest, RegistrationRequestLen,
Expand Down
Loading

0 comments on commit 4c630ea

Please sign in to comment.