Skip to content

Conversation

@newpavlov
Copy link
Member

@newpavlov newpavlov commented Sep 27, 2024

Dependency on crypto-common causes some annoyances as mentioned in RustCrypto/traits#1662.

Instead of using the sealed BlockSizes trait, the new code uses monomorphization errors to enforce block size correctness. This is somewhat non-idiomatic, but should be fine in practice since block buffers are usually used with fixed block sizes. After this change BlockSizes probably can be removed from crypto-common.

I decided against vendoring block-buffer code into digest as was proposed in the linked issue because block-buffer has third-party users and having a separate crate should make it a bit easier for reviewers.

@newpavlov newpavlov requested a review from tarcieri September 27, 2024 00:21
@newpavlov newpavlov force-pushed the block-buffer/monomorph_error branch from 1592eca to ac65c94 Compare September 27, 2024 01:20
@newpavlov newpavlov merged commit 021e014 into master Sep 27, 2024
@newpavlov newpavlov deleted the block-buffer/monomorph_error branch September 27, 2024 14:42
newpavlov added a commit that referenced this pull request Nov 7, 2025
### Added
- `ReadBuffer` type ([#823])
- Optional implementation of the `Zeroize` trait ([#963])
- Generic `serialize` and `deserialize` methods ([#1200])
- `ReadBuffer::{read_cached, write_block, reset}` methods ([#1201])

### Changed
- Block sizes must be bigger than 0 and smaller than 256.
  This is enforced using compile-time monomorphization errors. ([#1115])
- Size of `EagerBuffer` is equal to buffer size, while previously it was
equal
  to buffer size plus one byte ([#823])
- Edition changed to 2024 and MSRV bumped to 1.85 ([#1149])

### Removed
- `EagerBuffer::set_data` method. Use the `ReadBuffer` type instead.
([#823])

[#823]: #823
[#963]: #963
[#1115]: #1115
[#1115]: #1116
[#1149]: #1149
[#1200]: #1200
[#1201]: #1201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants