Skip to content

Commit 0e0eb60

Browse files
committed
musig: Use secret bytes from keypair to rerandomize
In `Session::partial_sign` rerandomize using the secret bytes from the keypair.
1 parent 0fb6a2a commit 0e0eb60

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/musig.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,8 +1179,6 @@ impl Session {
11791179
keypair: &Keypair,
11801180
key_agg_cache: &KeyAggCache,
11811181
) -> PartialSignature {
1182-
// We have no seed here but we want rerandomiziation to happen for `rand` users.
1183-
let seed = [0_u8; 32];
11841182
unsafe {
11851183
let mut partial_sig = MaybeUninit::<ffi::MusigPartialSignature>::uninit();
11861184

@@ -1195,7 +1193,7 @@ impl Session {
11951193
self.as_ptr(),
11961194
)
11971195
},
1198-
Some(&seed),
1196+
Some(&keypair.secret_bytes()),
11991197
);
12001198

12011199
assert_eq!(res, 1);

0 commit comments

Comments
 (0)