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.
into_bytes method of Info struct must correctly serialize this indicator as a single byte integer, according to the spec.
|
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.
seal and open test methods must take trigger/source event indicator as an parameter
- update all unit tests to use the new signature of
seal and open
- update
ipa_info_serialize test to validate that binary format of Info includes trigger byte
- update
arbitrary_info_corruption test 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.
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
hpkemodule.ipa/src/hpke/info.rs
Line 16 in cc48eba
into_bytesmethod ofInfostruct must correctly serialize this indicator as a single byte integer, according to the spec.ipa/src/hpke/info.rs
Line 76 in cc48eba
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 parameteripa/src/hpke/mod.rs
Line 197 in bc2e7e1
ipa/src/hpke/mod.rs
Line 214 in bc2e7e1
sealandopenipa_info_serializetest to validate that binary format ofInfoincludes trigger bytearbitrary_info_corruptiontest to validate that decryption fails if source event is camouflaged as trigger@martinthomson the
Infostruct 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.