Skip to content

Commit deb6b71

Browse files
Return constant from signing fn
This is necessary so we can build adaptor signatures on top of this.
1 parent fee1f70 commit deb6b71

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/clsag/sign.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn sign(
2929
L: EdwardsPoint,
3030
R: EdwardsPoint,
3131
I: EdwardsPoint,
32-
) -> Clsag {
32+
) -> (Clsag, Scalar) {
3333
let D = z * H_p_pk;
3434
let D_inv_8 = D * INV_EIGHT;
3535
let adjusted_commitment_ring =
@@ -97,11 +97,16 @@ pub fn sign(
9797
h_prev = h
9898
}
9999

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

102-
Clsag {
103-
s: responses.to_vec(),
104-
c1: h_0,
105-
D: D_inv_8,
106-
}
102+
responses[signing_key_index] = alpha - h_prev * mu_P * signing_key - stupid_constant;
103+
104+
(
105+
Clsag {
106+
s: responses.to_vec(),
107+
c1: h_0,
108+
D: D_inv_8,
109+
},
110+
stupid_constant,
111+
)
107112
}

0 commit comments

Comments
 (0)