Skip to content

Commit

Permalink
Merge pull request #89 from nyonson/deprecate-chacha
Browse files Browse the repository at this point in the history
Switch to chacha20-poly1305 crate
  • Loading branch information
rustaceanrob authored Nov 11, 2024
2 parents 2f413d6 + 4fabce3 commit 8547e47
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 964 deletions.
118 changes: 67 additions & 51 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ rust-version = "1.63.0"
default = ["std"]
async = ["std", "futures/std"]
tokio = ["std", "tokio/io-util"]
std = ["alloc", "bitcoin/std", "rand/std", "rand/std_rng"]
alloc = []
std = ["alloc", "bitcoin/std", "chacha20-poly1305/std", "rand/std", "rand/std_rng"]
alloc = ["chacha20-poly1305/alloc"]

[dependencies]
futures = { version = "0.3.30", default-features = false, optional = true }
# Must be under 1.39.0 due to MSRV 1.63.0 requirement.
tokio = { version = ">=1.37.0, <1.39.0", default-features = false, optional = true }
rand = { version = "0.8.0", default-features = false }
bitcoin = { version = "0.32.4", default-features = false }
chacha20-poly1305 = { version = "0.1.1", default-features = false }

[dev-dependencies]
hex = { package = "hex-conservative", version = "0.2.0" }
Expand Down
2 changes: 0 additions & 2 deletions protocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ BIP324 elects to use the ChaCha20Poly1305 Authenticated Encryption with Addition

Poly1305 is a purpose-built MAC, as opposed to something like an HMAC using SHA256 which leverages an existing hash scheme to build a message authentication code. Purpose-built introduces new complexity, but also allows for increased performance.

ChaCha20 and Poly1305 are both implemented in this crate to keep dependencies to a minimum.

## Development

The implementation is tested against vectors from the BIP324 reference and a number of additional library tests.
Expand Down
Loading

0 comments on commit 8547e47

Please sign in to comment.