Skip to content

Conversation

SchrodingerZhu
Copy link

No description provided.

@SchrodingerZhu
Copy link
Author

SchrodingerZhu commented Nov 21, 2023

Patch will change hash behavior w/ or w/o VAES. Bascially, it increases the batch size to 2x128bits for large enough input and add another two rounds of aesenc before summarizing the values into the hasher states.


Without VAES:
image


With VAES:
image

@SchrodingerZhu SchrodingerZhu marked this pull request as ready for review November 21, 2023 22:56
@tkaitchuck tkaitchuck self-requested a review December 29, 2023 20:12
}
}

pub(crate) fn shuffle_and_add_vec256(base: Vector256, to_add: Vector256) -> Vector256 {
Copy link
Owner

Choose a reason for hiding this comment

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

Here and below, these should probably have an inline annotation

self.hash_in(value.convert());
} else {
if data.len() > 32 {
if data.len() > 128 {
Copy link
Owner

Choose a reason for hiding this comment

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

This is sub-optimal. It's handling the >128 case but then the >64 case below is only for 65-128, which could be specialized be more efficient.
I would be tempted to avoid the additional if check if possible as branch mispredictions are more common and costly than show up in benchmarks where the data is predictable. But I don't have a good sense on how much is lost operating on 4 blocks at a time as opposed to 8.

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