Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: eliptic curves #589

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
++
qalisander committed Feb 13, 2025
commit 7046684a1eef9dd81f840048dae4d29037fc95f9
12 changes: 1 addition & 11 deletions lib/crypto/src/curve/short_weierstrass/affine.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ use educe::Educe;
use num_traits::{real::Real, One, Zero};
use zeroize::Zeroize;

use super::{Projective, SWCurveConfig, SWFlags};
use super::{Projective, SWCurveConfig};
use crate::{
curve::AffineRepr,
field::{group::AdditiveGroup, prime::PrimeField, Field},
@@ -137,16 +137,6 @@ impl<P: SWCurveConfig> Affine<P> {
true
}
}

pub fn to_flags(&self) -> SWFlags {
if self.infinity {
SWFlags::PointAtInfinity
} else if self.y <= -self.y {
SWFlags::YIsPositive
} else {
SWFlags::YIsNegative
}
}
}

impl<P: SWCurveConfig> Affine<P> {