-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: introduce has_usage
to improve bytes invariant
#67
Conversation
In the previous commits, I:
I did not define I will try to use this PR in MLS*, see if it works well and report back. Otherwise, aside from the |
I confirm this is allowing me to simplify proofs in MLS*, because I can now remove most of "or is publishable" statements in the intermediate security lemmas. |
e27024b
to
0b303e7
Compare
This still looks overall like a reasonable approach to me (in general, even --- it feels like if we can avoid thinking about the corrupt case unless it's necessary, and just propagate it onwards for the most part, then we might also save effort in proofs). I think the TODO should probably be addressed before this is finished, and either a change made or a note added that we can strengthen the postcondition of, for instance, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to have been cleaned up --- I think there are still some syntactic mismatches between, for instance, the invariant lemma for pk_enc and that for pk_dec (publishable vs (get_label can_flow public), but not semantic ones that I noticed. That said, I'm not inclined to push for work on making these match right now, because now that the main label changes are in, I plan to update #51 to work in the new setting, which should make these more immediately equivalent.
Ah, good catch. I have fixed it while I'm at it, and will merge once the CI goes back green. |
Builds on #66.
When doing proofs on protocols more complex than NSL or ISO-DH, I noticed that it was annoying to do proofs with
get_usage
, because we rarely are 100% certain thatget_usage key == …
. However, in what I've seen, we can always proveget_usage key == … \/ is_publishable tr key
(more on that below).Hence, this PR introduces
and use it systematically in the pre and post-conditions to prove
bytes_invariant
.I think that contrary to
get_usage key == …
, we can always provehas_usage tr key usg
on a key:key
was encrypted using public-key encryption:key
is encrypted by a honest principal that knowshas_usage tr key usg
, we can put this information in the public-key encryption predicatekey
is encrypted by the attacker, then it is publishablekey
is obtained via a KEM, we have the same property for roughly the same reasons as in the case of public-key encryptionkey
is derived viakey = kdf_expand prk info
thenget_usage prk == …
allows to deduceget_usage key == …
, andis_publishable tr prk
allows to deduceis_publishable tr key
, sohas_usage tr prk …
allows to deducehas_usage tr key …
The key properties of
has_usage
are:The proofs of NSL and ISO-DH were easy to update, and the proofs of HPKE were greatly simplified (because before we always had to reason like "either this has the correct usage, or this is publishable", which we don't need to do anymore).
This is still a draft, that I am posting to collect thoughts.
The next steps are:
get_usage
completely and definehas_usage
directlyusage
from theRand
constructor ofbytes
(discussed with @qaphla in feat: make labels erasable #54)admit
s in the proofs ofkdf_extract