Skip to content

Commit 1aa98b9

Browse files
committed
Replaces local ChaCha20-Poly1305 with external crate
Migrates ChaCha20-Poly1305 encryption from the local crypto module to rust-bitcoin's `chacha20-poly1305` crate. Integrated the crate across all modules (Router, PeerStorage, Onion Utils, etc.) and removed the deprecated internal implementation. Updated test vectors to align with the new 12-byte nonce construction and ensured SCID encryption remains consistent.
1 parent ec03159 commit 1aa98b9

File tree

14 files changed

+205
-1351
lines changed

14 files changed

+205
-1351
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ jobs:
184184
cargo doc --release
185185
cargo doc --no-default-features --release
186186
env:
187-
RUSTFLAGS: '--cfg=taproot'
188-
RUSTDOCFLAGS: '--cfg=taproot'
187+
RUSTFLAGS: "--cfg=taproot"
188+
RUSTDOCFLAGS: "--cfg=taproot"
189189

190190
check_docs:
191191
runs-on: self-hosted
@@ -241,7 +241,7 @@ jobs:
241241
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
242242
run: |
243243
cd fuzz
244-
RUSTFLAGS="--cfg=fuzzing --cfg=secp256k1_fuzz --cfg=hashes_fuzz" cargo test --verbose --color always --lib --bins -j8
244+
RUSTFLAGS="--cfg=fuzzing --cfg=secp256k1_fuzz --cfg=hashes_fuzz --cfg=chacha20_poly1305_fuzz" cargo test --verbose --color always --lib --bins -j8
245245
cargo clean
246246
- name: Run fuzzers
247247
run: cd fuzz && ./ci-fuzz.sh && cd ..
@@ -307,7 +307,24 @@ jobs:
307307
TOR_PROXY="127.0.0.1:9050" RUSTFLAGS="--cfg=tor" cargo test --verbose --color always -p lightning-net-tokio
308308
309309
notify-failure:
310-
needs: [build-workspace, build-features, build-bindings, build-nostd, build-cfg-flags, build-sync, fuzz, linting, rustfmt, check_release, check_docs, benchmark, ext-test, tor-connect, coverage]
310+
needs:
311+
[
312+
build-workspace,
313+
build-features,
314+
build-bindings,
315+
build-nostd,
316+
build-cfg-flags,
317+
build-sync,
318+
fuzz,
319+
linting,
320+
rustfmt,
321+
check_release,
322+
check_docs,
323+
benchmark,
324+
ext-test,
325+
tor-connect,
326+
coverage,
327+
]
311328
if: failure() && github.ref == 'refs/heads/main'
312329
runs-on: ubuntu-latest
313330
permissions:

lightning/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ lightning-macros = { version = "0.2", path = "../lightning-macros" }
4141
bech32 = { version = "0.11.0", default-features = false }
4242
bitcoin = { version = "0.32.4", default-features = false, features = ["secp-recovery"] }
4343

44+
chacha20-poly1305 = { git = "https://github.com/Abeeujah/rust-bitcoin.git", rev = "fdf898d8651dd876fc36ee77da31350ed35349f9", default-features = false }
4445
dnssec-prover = { version = "0.6", default-features = false }
4546
hashbrown = { version = "0.13", default-features = false }
4647
possiblyrandom = { version = "0.2", path = "../possiblyrandom", default-features = false }

0 commit comments

Comments
 (0)