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

Bump digest to v0.11.0-pre.3; MSRV 1.71 #523

Merged
merged 6 commits into from
Jan 6, 2024
Merged

Conversation

tarcieri
Copy link
Member

Also bumps crate editions to 2021 where appropriate

@tarcieri tarcieri changed the title [WIP] Bump digest to v0.11.0-pre; MSRV 1.65 Bump digest to v0.11.0-pre.1; MSRV 1.65 Jan 3, 2024
@tarcieri tarcieri marked this pull request as ready for review January 3, 2024 00:04
@tarcieri tarcieri changed the title Bump digest to v0.11.0-pre.1; MSRV 1.65 Bump digest to v0.11.0-pre.2; MSRV 1.65 Jan 3, 2024
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

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

You forgot to update MSRV in a number of crate readmes.

@@ -170,7 +170,7 @@ const BLOCK_SIZE: usize = <WhirlpoolCore as BlockSizeUser>::BlockSize::USIZE;

#[inline(always)]
fn convert(blocks: &[Block<WhirlpoolCore>]) -> &[[u8; BLOCK_SIZE]] {
// SAFETY: GenericArray<u8, U64> and [u8; 64] have
// SAFETY: Array<u8, U64> and [u8; 64] have
// exactly the same memory layout
let p = blocks.as_ptr() as *const [u8; BLOCK_SIZE];
unsafe { core::slice::from_raw_parts(p, blocks.len()) }
Copy link
Member

Choose a reason for hiding this comment

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

It could be worth to remove unsafe lines like this by adding a conversion method to the ArrayOps trait.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's save that for a followup, but I agree

@@ -14,7 +14,7 @@
//! // process input message
//! hasher.update(b"hello world");
//!
//! // acquire hash digest in the form of GenericArray,
//! // acquire hash digest in the form of Array,
Copy link
Member

@newpavlov newpavlov Jan 4, 2024

Choose a reason for hiding this comment

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

Suggested change
//! // acquire hash digest in the form of Array,
//! // acquire hash in the form of `hybrid_array::Array`,

@@ -1,7 +1,7 @@
#![feature(test)]
extern crate test;

use digest::{bench_update, generic_array::typenum::U64};
use digest::{array::typenum::U64, bench_update};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
use digest::{array::typenum::U64, bench_update};
use digest::{typenum::U64, bench_update};

@@ -1,7 +1,7 @@
#![feature(test)]
extern crate test;

use digest::{bench_update, generic_array::typenum::U32};
use digest::{array::typenum::U32, bench_update};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
use digest::{array::typenum::U32, bench_update};
use digest::{typenum::U32, bench_update};

@@ -1,7 +1,7 @@
#![feature(test)]
extern crate test;

use digest::{bench_update, generic_array::typenum::U128};
use digest::{array::typenum::U128, bench_update};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
use digest::{array::typenum::U128, bench_update};
use digest::{typenum::U128, bench_update};

@@ -12,7 +12,7 @@
//! // process input message
//! hasher.update(b"hello world");
//!
//! // acquire hash digest in the form of GenericArray,
//! // acquire hash digest in the form of Array,
Copy link
Member

@newpavlov newpavlov Jan 4, 2024

Choose a reason for hiding this comment

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

Suggested change
//! // acquire hash digest in the form of Array,
//! // acquire hash in the form of `hybrid_array::Array<u8, U16>`,

@@ -49,13 +49,13 @@ pub use digest::{self, Digest};
use crate::compressor::Compressor;
use core::fmt;
use digest::{
array::typenum::{Unsigned, U28, U32, U48, U64},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
array::typenum::{Unsigned, U28, U32, U48, U64},
typenum::{Unsigned, U28, U32, U48, U64},

@@ -12,7 +12,7 @@
//! // process input message
//! hasher.update(b"my message");
//!
//! // acquire hash digest in the form of GenericArray,
//! // acquire hash digest in the form of Array,
Copy link
Member

@newpavlov newpavlov Jan 4, 2024

Choose a reason for hiding this comment

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

Suggested change
//! // acquire hash digest in the form of Array,
//! // acquire hash in the form of `hybrid_array::Array<u8, U32>`,

@@ -11,7 +11,7 @@
//! // process input message
//! hasher.update("The quick brown fox jumps over the lazy dog");
//!
//! // acquire hash digest in the form of GenericArray,
//! // acquire hash digest in the form of Array,
Copy link
Member

@newpavlov newpavlov Jan 4, 2024

Choose a reason for hiding this comment

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

Suggested change
//! // acquire hash digest in the form of Array,
//! // acquire hash in the form of `hybrid_array::Array<u8, U32>`,

@@ -13,7 +13,7 @@
//! // process input message
//! hasher.update(b"hello world");
//!
//! // acquire hash digest in the form of GenericArray,
//! // acquire hash digest in the form of Array,
Copy link
Member

@newpavlov newpavlov Jan 4, 2024

Choose a reason for hiding this comment

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

Suggested change
//! // acquire hash digest in the form of Array,
//! // acquire hash in the form of `hybrid_array::Array<u8, U32>`,

@tarcieri tarcieri changed the title Bump digest to v0.11.0-pre.2; MSRV 1.65 Bump digest to v0.11.0-pre.3; MSRV 1.71 Jan 6, 2024
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

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

I will do a follow-up PR a bit later.

@tarcieri tarcieri merged commit 7febf02 into master Jan 6, 2024
202 checks passed
@tarcieri tarcieri deleted the digest/v0.11.0-pre branch January 6, 2024 06:14
tarcieri added a commit that referenced this pull request Jan 6, 2024
The new MSRV after #523 is 1.71
tarcieri added a commit that referenced this pull request Jan 6, 2024
The new MSRV after #523 is 1.71
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