Skip to content

Commit

Permalink
expose missing generator() function for the R25519 curve
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrezot committed Feb 14, 2025
1 parent 73e4f15 commit bc17bd4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use core::ops::{Add, Mul, Sub};
use std::iter::Sum;

use curve25519_dalek::{
constants,
constants::{self, RISTRETTO_BASEPOINT_POINT},
ristretto::{CompressedRistretto, RistrettoPoint},
traits::Identity,
};
Expand Down Expand Up @@ -131,6 +131,12 @@ impl R25519CurvePoint {
pub fn identity() -> Self {
Self(RistrettoPoint::identity())
}

/// Returns the generator element of the curve.
#[must_use]
pub fn generator() -> Self {
Self(RISTRETTO_BASEPOINT_POINT)
}
}

impl<'a> Add<&'a R25519CurvePoint> for R25519CurvePoint {
Expand Down

0 comments on commit bc17bd4

Please sign in to comment.