Skip to content

Commit c2240f3

Browse files
committed
serde_json Serialize, Deserialize
1 parent d0461da commit c2240f3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

schnorr_fun/src/blind.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ pub fn unblind_signature(
171171

172172
/// The tweaks used for blinding the nonce and challenge, later used to unblind the signature
173173
#[derive(Debug)]
174+
#[cfg_attr(
175+
feature = "serde",
176+
derive(crate::serde::Deserialize, crate::serde::Serialize),
177+
serde(crate = "crate::serde")
178+
)]
174179
pub struct BlindingTweaks {
175180
/// tweak value alpha
176181
pub alpha: Scalar,
@@ -190,6 +195,11 @@ impl BlindingTweaks {
190195

191196
/// Blinder holds a blinded signature context which is later used to unblind the signature
192197
#[derive(Debug)]
198+
#[cfg_attr(
199+
feature = "serde",
200+
derive(crate::serde::Deserialize, crate::serde::Serialize),
201+
serde(crate = "crate::serde")
202+
)]
193203
pub struct Blinder {
194204
/// tweaked public nonce R' = R + alpha*G + beta * X
195205
pub blinded_nonce: Point,
@@ -269,6 +279,11 @@ impl Blinder {
269279
}
270280

271281
#[derive(Clone, Debug)]
282+
#[cfg_attr(
283+
feature = "serde",
284+
derive(crate::serde::Deserialize, crate::serde::Serialize),
285+
serde(crate = "crate::serde")
286+
)]
272287
/// A signature request which will be sent to the signing server
273288
pub struct SignatureRequest {
274289
/// Blinded challenge request to the signing server

0 commit comments

Comments
 (0)