Uh oh!
There was an error while loading. Please reload this page.
finish inout migration - #664
Conversation
tarcieri
commented
Mar 14, 2025
Nice, thanks |
bcd2cac to
13bea12CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
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.
oh, in case it's not the same backing buffer for in and out?
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.
This one probably needs to be get_out, to compute a MAC over the ciphertext
There was a problem hiding this comment.
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.
This probably needs to pass plaintext and the receiver needs to load plaintext from in and write to out
baloo
commented
Mar 14, 2025
Need to remake this PR from scratch. |
tarcieri
commented
Mar 14, 2025
baloo
commented
Mar 14, 2025
I think I need a util for inout to duplicate the backing buffer from the original slice to flush out the misuse of |
tarcieri
commented
Mar 14, 2025
@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.