Skip to content

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

@akoshelev

Description

@akoshelev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions