-
Notifications
You must be signed in to change notification settings - Fork 16
Roadmap for a unified QUIC/TLS Multistream atop EverCrypt AEAD #227
Comments
Starting on |
We chatted about key expansion this morning. It's on the radar of @parno. I don't know if @karthikbhargavan's C implementation of AES-GCM also features key expansion. Can you elaborate on 3. -- what does "connect to HACL*" mean? |
@protz Do you mean IVs of non-standard length? I recall talking about that. I don't remember discussing key expansion. |
Ah sorry, I got confused between the two. My bad. Then I don't know why Spec.AEAD misses key expansion. I see it there: https://github.com/project-everest/hacl-star/blob/fstar-master/specs/Spec.AEAD.fsti#L114 |
Regarding maximum input length, for AES-GCM, I believe @R1kM has a branch where he's working on increasing that to the NIST spec's limit. I'm not sure how far along he is. |
Regarding maximum input length, I had started around a week ago, but I was preempted and it still needs some more work. I'll look at it in the next few days. |
@protz:
|
val lemma_encrypt_decrypt: #a:supported_alg -> k:kva -> n:iv a -> aad:ad a -> p:plain a ->
Lemma (decrypt k n aad (encrypt k n aad p) == Some p) |
Tasks for upgrading the memory model:
|
I don't see how this relates to
I think this is another flaw, but also a case of 1. Maximum input length is too short.
Although I guess you meant 4 instead of 3
And this is yet another defect to add to the list. |
@ad-l , I pushed a change to fstar-master that doesn't restrict the length of the input or output for the Vale AES-GCM, which should address points 1 and 2. Let me know if you have any other issue with this. |
@s-zanella in 8d0b407 Pkg, DefineTable and Mem are now fully verified. Can you take care of Idx? I'm moving to KDF now |
@s-zanella Some problems I identified when looking at
let lemma_honest_parent (i:regid) (lbl:label) (ctx:context)
: Lemma (requires wellformed_derive i lbl ctx /\ registered (derive i lbl ctx) /\ ~(honest_idh ctx))
(ensures honest (derive i lbl ctx) ==> honest i) I'm wondering what would be one axiom that could help us prove these lemmas without introducing inconsistency. The natural idea is: assume val give_witness: p:mem_predicate -> Ghost mem
(requires witnessed p) (ensures fun h -> p h) but I recall Asseem telling me this is not sound. In any case it is not enough, for instance trying to prove the if model then
let log : Idx.i_honesty_table = Idx.honesty_table in
let h = give_witness (MDM.defined log (derive i lbl ctx)) in
let t = MDM.repr (HS.sel h log) in
assert((~(honest_idh ctx) /\ DM.sel t (derive i lbl ctx) <> Some false) ==> (DM.sel t i <> Some false));
assert(MDM.contains log (derive i lbl ctx) true h ==> MDM.contains log i true h);
admit()
else () |
@ad-l
val lemma_honest_parent (i:regid) (lbl:label) (ctx:context)
: ST unit (requires fun h0 ->
wellformed_derive i lbl ctx /\
registered (derive i lbl ctx) /\
~(honest_idh ctx) /\
honest (derive i lbl ctx))
(ensures fun h0 _ h1 -> h0 == h1 /\ honest i)
let lemma_honest_parent i lbl ctx =
if model then
let log : i_honesty_table = honesty_table in
testify (MDM.contains log (derive i lbl ctx) true);
let x = MDM.lookup log i in
()
else () |
@ad-l val lemma_witnessed_true (p:mem_predicate) :
Lemma (requires (forall h. p h)) (ensures witnessed p)
let lemma_witnessed_true p =
lemma_witnessed_constant True;
weaken_witness (fun _ -> True) p val lemma_honest_parent (i:regid) (lbl:label) (ctx:context)
: Lemma (requires
wellformed_derive i lbl ctx /\
registered (derive i lbl ctx) /\
~(honest_idh ctx) /\
honest (derive i lbl ctx))
(ensures honest i)
let lemma_honest_parent i lbl ctx =
if model then
let log : i_honesty_table = honesty_table in
lemma_witnessed_true (fun h -> MDM.contains log (derive i lbl ctx) true h ==> MDM.contains log i true h);
lemma_witnessed_impl (MDM.contains log (derive i lbl ctx) true) (MDM.contains log i true)
else () |
We still rely on compatibility lemmas to bridge between old style ( |
I propagated the Idx changes. As discussed, I'm preparing to merge to |
We want to implement a unified Multistream API atop EverCrypt AEAD that can be used for both QUIC and TLS.
Requirements:
Tasks:
Mem
,Idx
,Pkg
, andPkg.Tree
to the same modernLowStar.Buffer
memory model used in EverCrypt. @ad-l and @s-zanellaKDF
package an rekeying test to new memory model @ad-l or @s-zanellaAEAD.Pkg
package atopEverCrypt.AEAD.fsti
inhacl-star@fstar-master
. As a first step we want anAEAD.fsti
module that does the buffer<->bytes conversion for keys and wraps overEverCrypt.AEAD.fsti
(we'll need to add a specification for create inSpec.AEAD
).AEAD.Pkg
packagesAEAD.fsti
, extracts and passes unit tests when linked againstlibevercrypt
. @s-zanellaPNE
(QUIC packet number encryption) package with unit tests passing when linked againstlibevercrypt
@ad-lIV
package to new memory model @s-zanellaStreamAE
wrapper (combinator, not a package) for TLS streams built fromAEAD
andIV
packages @s-zanellaQUICStream
wrapper built fromAEAD
,IV
, andPNE
packages @ad-lTransportSecret
module creating streams from eitherStreamAE
orQUICStream
. Some other module will dispatch these streams toMultistream
Multistream
API that provides encrypt/decrypt for application and create_stream for receiving new streams created fromTransportSecret
. TheMultistream
internal state will possibly have typeSeq index & Seq (Map position bytes)
@fournetTransportSecret
module with old Handshake moduleTasks in hacl-star we depend on:
Spec.AEAD
Done, but still limited by using
uint32_t
for lengths . Thanks @R1kM!decrypt
is shorter than maximum output ofencrypt
. See https://github.com/project-everest/hacl-star/blob/fstar-master/specs/Spec.AEAD.fsti#L117 - the max size of cipher should bemax_length a + tag_length a
, notmax_length a
.Although EverCrypt.AEAD.fsti doesn't use expand explicitly, it is part of the abstract invariant in the implementation: https://github.com/project-everest/hacl-star/blob/ca3e12f21d1879f192f19105dcc43ffe2f6e350b/providers/evercrypt/fst/EverCrypt.AEAD.fst#L61
Spec.AEAD
is missing a correctness lemmadecrypt k n aad (encrypt k n aad p) == Some p
Added, but admitted until we prove correctness of individual algorithms.
Spec.AEAD
. The implementation of AES-GCM in _dev is proved memory safe only. I see this other comment that may be relevant: https://github.com/project-everest/hacl-star/blob/fstar-master/providers/evercrypt/fst/EverCrypt.AEAD.fst#L54Issues to remember:
The text was updated successfully, but these errors were encountered: