-
Notifications
You must be signed in to change notification settings - Fork 179
finish inout migration #664
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
|
Nice, thanks |
bcd2cac to
13bea12
Compare
| init_ctr(&self.enc_cipher, tag).apply_keystream_partial(buffer.into()); | ||
| self.polyval.update_padded(buffer); | ||
| init_ctr(&self.enc_cipher, tag).apply_keystream_partial(buffer.reborrow()); | ||
| self.polyval.update_padded(buffer.get_in()); |
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 one needs to be get_out, since it's authenticating the decrypted plaintext (since the "SIV" tag is calculated from the plaintext)
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.
oh, in case it's not the same backing buffer for in and out?
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.
Yes
|
It might be good to add some basic smoke tests of the |
| ctr.apply_keystream_partial(buffer.reborrow()); | ||
|
|
||
| let full_tag = self.compute_tag(mask, associated_data, buffer); | ||
| let full_tag = self.compute_tag(mask, associated_data, buffer.get_in()); |
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.
This one probably needs to be get_out, to compute a MAC over the ciphertext
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.
Yeah there is probably a whole slew of those, I assumed the backing buffer was unique.
| let siv_tag = s2v(&mut self.mac, headers, plaintext)?; | ||
| self.xor_with_keystream(siv_tag, plaintext); | ||
| let siv_tag = s2v(&mut self.mac, headers, plaintext.get_in())?; | ||
| self.xor_with_keystream(siv_tag, plaintext.get_out()); |
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.
This probably needs to pass plaintext and the receiver needs to load plaintext from in and write to out
|
Need to remake this PR from scratch. |
|
I think I need a util for inout to duplicate the backing buffer from the original slice to flush out the misuse of |
|
@baloo that's what I was suggesting re: smoke tests, which can use separate buffers for input and output. Once you have a basic framework for them you can put them in |
No description provided.