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

SafeEncryptWithContext should use EncryptWithLabel #48

Open
TWal opened this issue Feb 6, 2025 · 0 comments
Open

SafeEncryptWithContext should use EncryptWithLabel #48

TWal opened this issue Feb 6, 2025 · 0 comments

Comments

@TWal
Copy link

TWal commented Feb 6, 2025

MLS defines the safe-ish SignWithLabel, ExpandWithLabel, EncryptWithLabel etc, and the safe API relies on it:

  • SafeSignWithLabel uses SignWithLabel
  • DeriveExtensionSecret uses ExpandWithLabel

However SafeEncryptWithContext doesn't use EncryptWithLabel and operate directly with HPKE.SealBase. Is there a technical reason for this?

I think it should use EncryptWithLabel to ensure proper domain separation with HPKE uses in the MLS RFC. Otherwise, we must ensure that MLS' EncryptContext and Safe API's LabeledExtensionContent cannot be serialized to the same bytestring (to follow the secure formatting rules of the Comparse paper). The latter fact seems to hold, under the condition that LabeledExtensionContent.label uses a QUIC-style length encoding (which is not clear because it is written as opaque label and not opaque label<V>). Using EncryptWithLabel would make that fact straightforward.

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

No branches or pull requests

1 participant