-
Notifications
You must be signed in to change notification settings - Fork 747
Capsules: SipHash respect leasable buffers and handle arbitrary buffer sizes #3506
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
Conversation
468f316
to
21ba455
Compare
These changes look good to me except for my complaint about the leasable buffer change on the other PR with those changes (#3505 (comment)) |
c7aa1d9
to
a1d11f4
Compare
I rebased this and removed the leasable buffer api commit. |
let (int_bytes, _rest) = input.split_at(mem::size_of::<u64>()); | ||
u64::from_le_bytes(int_bytes.try_into().unwrap()) | ||
let mut eight_buf: [u8; 8] = [0; 8]; | ||
for i in 0..8 { | ||
eight_buf[i] = *input.get(i).unwrap_or(&0); | ||
} | ||
u64::from_le_bytes(eight_buf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks hideous, but it really seems like Rust doesn't have a better story to collect an iterator into a fixed size array yet...
a1d11f4
to
cd5633c
Compare
Do not assume data is at the start of the buffer.
cd5633c
to
1481f9b
Compare
Rebased. |
All reactions
Sorry, something went wrong.
Ok, sorry, I thought this would pass CI on its own. But it doesn't any trying to figure out which changes from the full PR (#3508) make it compile seems like too much work. We'll have to just go with the full PR at this point. These commits are verbatim in that PR, so it could still be helpful to look at this change set. |
All reactions
Sorry, something went wrong.
Merged in #3508. |
All reactions
Sorry, something went wrong.
brghena
lschuermann
Successfully merging this pull request may close these issues.
Pull Request Overview
This pull request updates the siphash capsule to correctly use leasable buffers and to accept data in units not a multiple of 8 bytes.
Testing Strategy
Updating the k-v stack and comparing hashes to an online calculator.
TODO or Help Wanted
n/a
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.