Skip to content

Commit

Permalink
elliptic-curve: move hash2field into hash2curve module (#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda authored Jan 18, 2022
1 parent 15d2c19 commit 27536e0
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 9 deletions.
2 changes: 2 additions & 0 deletions elliptic-curve/src/hash2curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
//! <https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve>

mod group_digest;
mod hash2field;
mod isogeny;
mod map2curve;
mod osswu;

pub use group_digest::*;
pub use hash2field::*;
pub use isogeny::*;
pub use map2curve::*;
pub use osswu::*;
7 changes: 2 additions & 5 deletions elliptic-curve/src/hash2curve/group_digest.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
//! Traits for handling hash to curve.

use super::MapToCurve;
use crate::{
hash2field::{hash_to_field, ExpandMsg, FromOkm},
ProjectiveArithmetic, Result,
};
use super::{hash_to_field, ExpandMsg, FromOkm, MapToCurve};
use crate::{ProjectiveArithmetic, Result};
use group::cofactor::CofactorGroup;

/// Adds hashing arbitrary byte sequences to a valid group element
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub trait FromOkm {
///
/// [`ExpandMsgXmd`]: crate::hash2field::ExpandMsgXmd
/// [`ExpandMsgXof`]: crate::hash2field::ExpandMsgXof
#[doc(hidden)]
pub fn hash_to_field<'a, E, T>(data: &[&[u8]], domain: &'a [u8], out: &mut [T]) -> Result<()>
where
E: ExpandMsg<'a>,
Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions elliptic-curve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ pub mod ecdh;
#[cfg(feature = "jwk")]
mod jwk;

#[cfg(feature = "hash2curve")]
#[doc(hidden)]
pub mod hash2field;

#[cfg(feature = "hash2curve")]
#[cfg_attr(docsrs, doc(cfg(feature = "hash2curve")))]
pub mod hash2curve;
Expand Down

0 comments on commit 27536e0

Please sign in to comment.