mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-02-01 18:14:57 -05:00
Fix TODO by instructing Vec
This commit is contained in:
parent
38123a324f
commit
b944f0f989
@ -122,26 +122,24 @@ fn challenge(
|
|||||||
Ok(Scalar::from_bytes_mod_order(output))
|
Ok(Scalar::from_bytes_mod_order(output))
|
||||||
}
|
}
|
||||||
|
|
||||||
// h_0 = keccak256("CLSAG_round" || ring ||
|
/// Compute the prefix for the hash common to every iteration of the ring signature algorithm.
|
||||||
// ring of commitments || pseudooutput commitment || msg || alpha * G ||
|
///
|
||||||
// alpha * hash_to_point(signing pk))
|
/// "CLSAG_round" || ring || ring of commitments || pseudooutput commitment || msg || alpha * G
|
||||||
//
|
|
||||||
// where alpha is random
|
|
||||||
|
|
||||||
// TODO: Create ring newtype
|
|
||||||
fn clsag_round_hash_prefix(
|
fn clsag_round_hash_prefix(
|
||||||
ring: &[u8],
|
ring: &[u8],
|
||||||
commitment_ring: &[u8],
|
commitment_ring: &[u8],
|
||||||
pseudo_output_commitment: &EdwardsPoint,
|
pseudo_output_commitment: &EdwardsPoint,
|
||||||
msg: &[u8],
|
msg: &[u8],
|
||||||
) -> Vec<u8> {
|
) -> Vec<u8> {
|
||||||
// TODO: Set capacity
|
let domain_prefix = HASH_KEY_CLSAG_ROUND.as_bytes();
|
||||||
let mut prefix = Vec::new();
|
let pseudo_output_commitment = pseudo_output_commitment.compress().as_bytes();
|
||||||
|
|
||||||
prefix.extend(HASH_KEY_CLSAG_ROUND.as_bytes());
|
let mut prefix = Vec::with_capacity(domain_prefix.len() + ring.len() + commitment_ring.len() + pseudo_output_commitment.len() + msg.len());
|
||||||
|
|
||||||
|
prefix.extend(domain_prefix);
|
||||||
prefix.extend(ring);
|
prefix.extend(ring);
|
||||||
prefix.extend(commitment_ring);
|
prefix.extend(commitment_ring);
|
||||||
prefix.extend(pseudo_output_commitment.compress().as_bytes());
|
prefix.extend(pseudo_output_commitment);
|
||||||
prefix.extend(msg);
|
prefix.extend(msg);
|
||||||
|
|
||||||
prefix
|
prefix
|
||||||
|
Loading…
x
Reference in New Issue
Block a user