Skip to content

Commit

Permalink
Return constant from signing fn
Browse files Browse the repository at this point in the history
This is necessary so we can build adaptor signatures on top of this.
  • Loading branch information
thomaseizinger committed May 20, 2021
1 parent fee1f70 commit deb6b71
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/clsag/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn sign(
L: EdwardsPoint,
R: EdwardsPoint,
I: EdwardsPoint,
) -> Clsag {
) -> (Clsag, Scalar) {
let D = z * H_p_pk;
let D_inv_8 = D * INV_EIGHT;
let adjusted_commitment_ring =
Expand Down Expand Up @@ -97,11 +97,16 @@ pub fn sign(
h_prev = h
}

responses[signing_key_index] = alpha - h_prev * ((mu_P * signing_key) + (mu_C * z));
let stupid_constant = h_prev * mu_C * z;

Clsag {
s: responses.to_vec(),
c1: h_0,
D: D_inv_8,
}
responses[signing_key_index] = alpha - h_prev * mu_P * signing_key - stupid_constant;

(
Clsag {
s: responses.to_vec(),
c1: h_0,
D: D_inv_8,
},
stupid_constant,
)
}

0 comments on commit deb6b71

Please sign in to comment.