Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cipher+digest: migrate to hybrid array; MSRV 1.65 #1358

Merged
merged 3 commits into from
Oct 27, 2023

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Oct 8, 2023

Continuation of #1319.

Replaces generic-array with hybrid-array, which is built on a combination of typenum and const generics, providing a degree of interoperability between the two systems.

hybrid-array is designed to be a largely drop-in replacement, and the number of changes required to switch are relatively minimal aside from some idiosyncrasies.

@tarcieri tarcieri force-pushed the cipher+digest/hybrid-array branch 2 times, most recently from 2c457b6 to fb64380 Compare October 8, 2023 22:27
@tarcieri
Copy link
Member Author

tarcieri commented Oct 8, 2023

@newpavlov well, there's the next step

Replaces `generic-array` with `hybrid-array`, which is built on a
combination of `typenum` and const generics, providing a degree of
interoperability between the two systems.

`hybrid-array` is designed to be a largely drop-in replacement, and the
number of changes required to switch are relatively minimal aside from
some idiosyncrasies.
@tarcieri tarcieri force-pushed the cipher+digest/hybrid-array branch from fb64380 to f93a1d6 Compare October 27, 2023 00:50
@tarcieri tarcieri changed the title [WIP] cipher+digest: migrate to hybrid array; MSRV 1.65 cipher+digest: migrate to hybrid array; MSRV 1.65 Oct 27, 2023
digest/src/digest.rs Outdated Show resolved Hide resolved
@@ -195,7 +195,7 @@ impl_counter! { u32 u64 u128 }
/// In case if `N` is less or equal to 1, buffer of arrays has length
/// of zero and tail is equal to `self`.
#[inline]
fn into_chunks<T, N: ArrayLength<T>>(buf: &mut [T]) -> (&mut [GenericArray<T, N>], &mut [T]) {
fn into_chunks<T, N: ArraySize>(buf: &mut [T]) -> (&mut [Array<T, N>], &mut [T]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should move this method into hybrid-array? I think we had a recent discussion about it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, although perhaps that could be a followup?

@tarcieri tarcieri marked this pull request as ready for review October 27, 2023 01:11
@tarcieri tarcieri requested a review from newpavlov October 27, 2023 16:03
@tarcieri tarcieri merged commit 102d328 into master Oct 27, 2023
85 checks passed
@tarcieri tarcieri deleted the cipher+digest/hybrid-array branch October 27, 2023 18:15
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.

2 participants