Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions elliptic-curve/src/weierstrass.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Elliptic curves in short Weierstrass form.

pub mod point;

/// Marker trait for elliptic curves in short Weierstrass form
pub trait Curve: super::Curve {
/// Should point compression be applied by default?
Expand Down
12 changes: 12 additions & 0 deletions elliptic-curve/src/weierstrass/point.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//! Traits for Weierstrass elliptic curve points

use super::Curve;
use crate::ElementBytes;
use subtle::CtOption;

/// Attempt to decompress an elliptic curve point from its x-coordinate and
/// a boolean flag indicating whether or not the y-coordinate is odd.
pub trait Decompress<C: Curve>: Sized {
/// Attempt to decompress an elliptic curve point
fn decompress(x: &ElementBytes<C>, y_is_odd: bool) -> CtOption<Self>;
}