Reorder and rename for clarification

This commit is contained in:
Thomas Eizinger 2021-05-11 12:25:56 +10:00
parent 4933d7f1b7
commit 07d544adde
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

View File

@ -19,21 +19,13 @@ pub fn sign(
fake_responses: [Scalar; RING_SIZE - 1], fake_responses: [Scalar; RING_SIZE - 1],
z: Scalar, z: Scalar,
pseudo_output_commitment: EdwardsPoint, pseudo_output_commitment: EdwardsPoint,
L: EdwardsPoint, L_0: EdwardsPoint,
R: EdwardsPoint, R_0: EdwardsPoint,
I: EdwardsPoint, I: EdwardsPoint,
) -> Signature { ) -> Signature {
let D = z * H_p_pk; let D = z * H_p_pk;
let D_inv_8 = D * INV_EIGHT; let D_inv_8 = D * INV_EIGHT;
let prefix = clsag_round_hash_prefix(
ring.as_ref(),
commitment_ring.as_ref(),
pseudo_output_commitment,
msg,
);
let h_0 = hash_to_scalar(&[&prefix, L.compress().as_bytes(), R.compress().as_bytes()]);
let mus = AggregationHashes::new( let mus = AggregationHashes::new(
&ring, &ring,
&commitment_ring, &commitment_ring,
@ -42,6 +34,14 @@ pub fn sign(
H_p_pk.compress(), H_p_pk.compress(),
); );
let prefix = clsag_round_hash_prefix(
ring.as_ref(),
commitment_ring.as_ref(),
pseudo_output_commitment,
msg,
);
let h_0 = hash_to_scalar(&[&prefix, L_0.compress().as_bytes(), R_0.compress().as_bytes()]);
let h_last = fake_responses let h_last = fake_responses
.iter() .iter()
.enumerate() .enumerate()