mirror of
https://github.com/lightningnetwork/lnd.git
synced 2026-08-20 13:27:27 +02:00
In this commit, we add the ability to inject a custom random source for generating JIT (Just-In-Time) signing nonces in MuSig2 sessions. By default, MuSig2 signing nonces are generated using crypto/rand, which makes signatures non-deterministic across runs. For test vector generation, we need fully reproducible signatures from a fixed seed. A new `customNonceRand` field is threaded through `MusigSession`, `MusigSessionCfg`, `MusigPairSession`, and exposed via the `WithCustomSigningRand` channel option. When set, the custom reader is passed to `musig2.WithCustomRand()` during JIT nonce generation in `SignCommit`. All existing callers pass `fn.None[io.Reader]()` to preserve the current behavior of using the system CSPRNG. |
||
|---|---|---|
| .. | ||
| brontide.go | ||
| brontide_test.go | ||
| chan_observer.go | ||
| daemon_adapters.go | ||
| interfaces.go | ||
| log.go | ||
| musig_chan_closer.go | ||
| musig_nonce_order_test.go | ||
| ping_manager.go | ||
| ping_manager_test.go | ||
| setup_test.go | ||
| test_utils.go | ||