Skip to content
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

Update HPKE encryption of matchkeys according to the latest spec #593

Closed
akoshelev opened this issue Apr 12, 2023 · 3 comments
Closed

Update HPKE encryption of matchkeys according to the latest spec #593

akoshelev opened this issue Apr 12, 2023 · 3 comments

Comments

@akoshelev
Copy link
Collaborator

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.

pub struct Info<'a> {

  • 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

pub fn seal(

pub fn open(

  • 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.

@martinthomson
Copy link
Member

Surely we can reuse Info for all events that share a site, epoch, keyid, and source/trigger bit.

@bmcase
Copy link
Member

bmcase commented Apr 13, 2023

Created a PR to be reviewed, @akoshelev #598

@akoshelev
Copy link
Collaborator Author

fixed in #598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants