Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/clsag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ mod tests {
#[allow(non_snake_case)]
let I = signing_key * H_p_pk;

let signature = sign(
let (signature, _) = sign(
msg_to_sign,
signing_key,
signing_key_index,
Expand Down
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,
)
}