Implement hash_to_point in Rust

Closes https://github.com/serai-dex/serai/issues/32.
This commit is contained in:
Luke Parker
2022-07-10 16:11:55 -04:00
parent 6ce506a79d
commit 953a873338
10 changed files with 108 additions and 38 deletions

View File

@@ -1,13 +1,20 @@
use curve25519_dalek::edwards::EdwardsPoint;
use curve25519_dalek::{constants::ED25519_BASEPOINT_TABLE, scalar::Scalar, edwards::EdwardsPoint};
pub(crate) mod hash_to_point;
pub use hash_to_point::hash_to_point;
pub mod bulletproofs;
pub mod clsag;
pub mod bulletproofs;
use crate::{
serialize::*,
ringct::{clsag::Clsag, bulletproofs::Bulletproofs}
};
pub fn generate_key_image(secret: Scalar) -> EdwardsPoint {
secret * hash_to_point(&secret * &ED25519_BASEPOINT_TABLE)
}
#[derive(Clone, PartialEq, Debug)]
pub struct RctBase {
pub fee: u64,