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

@@ -18,9 +18,8 @@ use frost::{curve::Ed25519, FrostError, FrostView, algorithm::Algorithm};
use dalek_ff_group as dfg;
use crate::{
hash_to_point,
frost::{MultisigError, write_dleq, read_dleq},
ringct::clsag::{ClsagInput, Clsag}
ringct::{hash_to_point, clsag::{ClsagInput, Clsag}}
};
impl ClsagInput {
@@ -129,7 +128,7 @@ impl Algorithm<Ed25519> for ClsagMultisig {
view: &FrostView<Ed25519>,
nonces: &[dfg::Scalar; 2]
) -> Vec<u8> {
self.H = hash_to_point(&view.group_key().0);
self.H = hash_to_point(view.group_key().0);
let mut serialized = Vec::with_capacity(ClsagMultisig::serialized_len());
serialized.extend((view.secret_share().0 * self.H).compress().to_bytes());