Commit Graph

19 Commits

Author SHA1 Message Date
Fmt Bot 8bdd67a368 2025-01-12 automated rustfmt nightly 2025-01-12 01:23:13 +00:00
Tobin C. Harding 2c9fda4135
Add parenthesis to explicitly show precedence
Recent clippy nightly update introduces warnings about precedence. While
ours are, IMO, clear the lint docs have some cases that are not so I
don't think we should ignore this lint. Specifically I could easily miss
this one

  1 << 2 + 3 equals 32, while (1 << 2) + 3 equals 7

ref: https://rust-lang.github.io/rust-clippy/master/#/precede

Add parenthesis to explicitly show precedence. Refactor only no logic
changes.
2025-01-04 15:25:00 +11:00
Tobin C. Harding 85e04315d5
Remove test_ prefix from unit tests
There is a loose convention in Rust to not use `test_` prefix. The
reason being that `cargo test` outputs 'test <test name>' using the
prefix makes the output stutter.

This patch smells a bit like code-churn but having the prefix in some
places and not others is confusing to new contributors and is leading me
to explain this many times now. Lets just fix it.

Remove the prefix unless doing so breaks the code.
2025-01-02 10:06:50 +11:00
calciumbe 9a5970dbfe
chacha20_poly1305: fix typo 2024-12-23 20:44:18 +08:00
merge-script 73e33e5808
Merge rust-bitcoin/rust-bitcoin#3581: Fix re-exports and (manually) format the codebase
727c519efa Re-export amount from primitives (Tobin C. Harding)
84ede349b0 Run the formatter (Tobin C. Harding)
4865d60258 bitcoin: Improve the re-exports ... again (Tobin C. Harding)

Pull request description:

  When we messed with the re-exports recently we failed to notice that the formatter would move the `pub use` blocks around because I only put `rustfmt::skip` on one block, I thought that had the effect of stopping all exports below that block being changed, turns out I was wrong.

  Run the formatter then make some minor changes to the re-exports in `bitcoin`, including changing comments that do not make sense with the new layout.

ACKs for top commit:
  apoelstra:
    ACK 727c519efa771d3ec6a21350e4638b9f1536bfe1; successfully ran local tests

Tree-SHA512: fa9fbadf7efa0a76db6a0a2915fcabeda348c561e4047f9517ca7fba1a2008d5624072b7a9ce6069d71c229a794b4d27c3d96195768e87b3c2c412d611ecbfcf
2024-11-11 20:15:14 +00:00
merge-script c3a4ba2c5a
Merge rust-bitcoin/rust-bitcoin#3593: Release tracking PR: chacha20-poly1305 v0.1.1
2ae6a9abc1 Prep the chacha20-poly1305 crate for release (Nick Johnson)

Pull request description:

  Bump the patch version to `v0.1.1` to include the no_std support.

  Could see this requiring `v0.2.0`, but went with the patch bump.

ACKs for top commit:
  apoelstra:
    ACK 2ae6a9abc1cb6b0f3edb358ebe5e9a0781051abe; successfully ran local tests; let's do it
  tcharding:
    ACK 2ae6a9abc1

Tree-SHA512: 880e8390447c238bfd0e9493682622213b91f7f41c8c320fea6af763e00d73fb30bfc545f420b79614a8b33249abbd08bc9dcb7ace9522a68862194240b7258a
2024-11-11 16:43:11 +00:00
Tobin C. Harding 84ede349b0
Run the formatter
Run `just fmt`, no manual changes.
2024-11-11 14:19:17 +11:00
Nick Johnson 2ae6a9abc1 Prep the chacha20-poly1305 crate for release
Bump the patch version to 0.1.1 to include the no_std support.
2024-11-09 07:23:45 -08:00
Nick Johnson eb0a7b40ec Add callouts to the chacha20-poly1305 public docs
Making it clear in the chacha20-poly1305 documentation that this
implementation is maintained by bitcoin developers and targeted
specifically for bitcoin ecosystem use cases.
2024-11-08 10:56:36 -08:00
Jamil Lambert, PhD 1649b68589
Standardize wording to `constructs a new`
There is a range of different wordings used in the docs of constructor
type functions.

Change all to start with `Constructs a new` or `Constructs an empty`.
2024-11-05 13:02:26 +00:00
Jamil Lambert, PhD 27f94d5540
Replace `creates` with `constructs`
In functions that act like constructors there is a mixture of the usage
of `creates` and `constructs`.

Replace all occurrences of `creates` with `constructs` in the first line
of docs of constructor like functions.
2024-11-05 12:47:28 +00:00
Tobin C. Harding 9f60e1ae26
Copy crate level attributes to chacha20_poly1305
No obvious reason not to; copy the crate level attributes that we have
in all our other crates.
2024-11-04 13:38:19 +11:00
Fmt Bot 5ecf7f2d67 2024-11-03 automated rustfmt nightly 2024-11-03 01:21:14 +00:00
merge-script dbb35c0960
Merge rust-bitcoin/rust-bitcoin#3545: Add no_std flag to the chacha20-poly1305 crate
26ed97877b Add no_std flag to the chacha20-poly1205 crate (Nick Johnson)

Pull request description:

  I unfortunately forgot to copy over the `no_std` configuration when I promoted the chacha20_poly1305 from an internal module (where it inherited the setting) to the main module of the new crate.

  This crate is using a slightly simpler no_std pattern than some other crates in the org. I like the simple approach, but can update it if consistency is valued in this case.

ACKs for top commit:
  tcharding:
    ACK 26ed97877b
  apoelstra:
    ACK 26ed97877bdbee0b9b67db52ff0d53b706361e08; successfully ran local tests

Tree-SHA512: ffa672b7593daa4148ef8584903939e976302138b0aae1f09de647885629e502bcb1380471b29d8cd28ae52a435e52bd22b231c6631528d17fe3090e7f56add7
2024-10-31 22:09:34 +00:00
Nick Johnson 26ed97877b Add no_std flag to the chacha20-poly1205 crate 2024-10-30 20:48:21 -07:00
Leo Nash 7f289a9fdf Bump hex-conservative to 0.3.0 2024-10-31 03:36:22 +00:00
Nick Johnson 7d6ed16dfc Add changelog to chacha20-poly1305 crate
* No other preperation needed for release since the version is already
set in Cargo.toml.
2024-10-28 13:21:39 -07:00
Fmt Bot 2a08b29232 2024-10-20 automated rustfmt nightly 2024-10-20 01:21:52 +00:00
Nick Johnson a5f5c795f5 Add the ChaCha20Poly1305 AEAD crate
* The ChaCha20 stream cipher and the Poly1305 message authenticator
are used in BIP324's encrypted P2P transport protocol.
2024-10-14 20:55:03 -07:00