@@ -31,6 +31,7 @@ pub trait TwistedEdwardsPoint: Sized {
31
31
32
32
fn add_impl ( & self , p2 : & Self ) -> Self ;
33
33
34
+ #[ inline( always) ]
34
35
fn from_xy ( x : Self :: Coordinate , y : Self :: Coordinate ) -> Option < Self >
35
36
where
36
37
for < ' a > & ' a Self :: Coordinate : Mul < & ' a Self :: Coordinate , Output = Self :: Coordinate > ,
@@ -45,15 +46,15 @@ pub trait TwistedEdwardsPoint: Sized {
45
46
}
46
47
47
48
/// Macro to generate a newtype wrapper for [AffinePoint](crate::AffinePoint)
48
- /// that implements elliptic curve operations by using the underlying field operations according to the
49
- /// [formulas](https://en.wikipedia.org/wiki/Twisted_Edwards_curve) for twisted Edwards curves.
49
+ /// that implements elliptic curve operations by using the underlying field operations according to
50
+ /// the [formulas](https://en.wikipedia.org/wiki/Twisted_Edwards_curve) for twisted Edwards curves.
50
51
///
51
52
/// The following imports are required:
52
53
/// ```rust
53
54
/// use core::ops::AddAssign;
54
55
///
55
56
/// use openvm_algebra_guest::{DivUnsafe, Field};
56
- /// use openvm_ecc_guest::{AffinePoint, Group, edwards::TwistedEdwardsPoint};
57
+ /// use openvm_ecc_guest::{edwards::TwistedEdwardsPoint, AffinePoint, Group };
57
58
/// ```
58
59
#[ macro_export]
59
60
macro_rules! impl_te_affine {
@@ -148,8 +149,8 @@ macro_rules! impl_te_affine {
148
149
}
149
150
}
150
151
151
- /// Implements `Group` on `$struct_name` assuming that `$struct_name` implements `TwistedEdwardsPoint`.
152
- /// Assumes that `Neg` is implemented for `&$struct_name`.
152
+ /// Implements `Group` on `$struct_name` assuming that `$struct_name` implements
153
+ /// `TwistedEdwardsPoint`. Assumes that `Neg` is implemented for `&$struct_name`.
153
154
#[ macro_export]
154
155
macro_rules! impl_te_group_ops {
155
156
( $struct_name: ident, $field: ty) => {
@@ -273,8 +274,8 @@ macro_rules! impl_te_group_ops {
273
274
274
275
// This is the same as the Weierstrass version, but for Edwards curves we use
275
276
// TwistedEdwardsPoint::add_impl instead of WeierstrassPoint::add_ne_nonidentity, etc.
276
- // Unlike the Weierstrass version, we do not require the bases to have prime order, since our addition
277
- // formulas are complete.
277
+ // Unlike the Weierstrass version, we do not require the bases to have prime order, since our
278
+ // addition formulas are complete.
278
279
279
280
// MSM using preprocessed table (windowed method)
280
281
// Reference: modified from https://github.com/arkworks-rs/algebra/blob/master/ec/src/scalar_mul/mod.rs
0 commit comments