-
Notifications
You must be signed in to change notification settings - Fork 27
Description
patcg-individual-drafts/ipa#56 asks us to authenticate match key encryption with trigger bit, which we don't do currently.
The entry point into match key encryption is hpke module.
- First thing that must be updated is the HPKE Info struct that must now carry a trigger event indicator. I am not a huge fan of boolean values, but we don't have an enum for event type (yet), so it is probably the right time to add it.
Line 16 in cc48eba
| pub struct Info<'a> { |
into_bytesmethod ofInfostruct must correctly serialize this indicator as a single byte integer, according to the spec.
Line 76 in cc48eba
| pub(super) fn into_bytes(self) -> Box<[u8]> { |
After this, we need to update unit tests and property tests to validate the new AAD tag implementation.
sealandopentest methods must take trigger/source event indicator as an parameter
Line 197 in bc2e7e1
| pub fn seal( |
Line 214 in bc2e7e1
| pub fn open( |
- update all unit tests to use the new signature of
sealandopen - update
ipa_info_serializetest to validate that binary format ofInfoincludes trigger byte - update
arbitrary_info_corruptiontest to validate that decryption fails if source event is camouflaged as trigger
@martinthomson the Info struct now represents a single event context because of this trigger bit. I don't think it is a big deal because we can make it cheaply cloneable, so we can follow up on that. @bmcase wants to get his hands dirty with Rust, so this may be a good issue for him to get familiar with our code base.