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

feat:Communication Layer #50

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open

Conversation

fabian-hk
Copy link
Contributor

This PR is an early version of a communication layer. It is a draft PR because it is not yet ready to merge. Currently, the following functionality is implemented:

  • Confidential send and receive functions
  • Authenticated send and receive functions

Note that these functions can and probably will change before this PR can be merged.

You can find minimal example protocols for these functions in this repository: https://github.com/fabian-hk/dolev-yao-star-communication-layer-examples/tree/main

Copy link
Collaborator

@TWal TWal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks overall good, my main question are:

  • What is the use of the receiver predicates? I don't understand what goal they achieve, and the pre-conditions they appear in seem in general difficult to prove.
  • I think we could require sender predicates to stay true when the trace grows, this would avoid using something like forall tr'. tr <$ tr' ==> higher_pred tr' ...

Makefile Show resolved Hide resolved
src/lib/communication/DY.Lib.Communication.API.fst Outdated Show resolved Hide resolved
src/lib/communication/DY.Lib.Communication.API.Lemmas.fst Outdated Show resolved Hide resolved
src/lib/communication/DY.Lib.Communication.API.Lemmas.fst Outdated Show resolved Hide resolved
src/lib/communication/DY.Lib.Communication.API.Lemmas.fst Outdated Show resolved Hide resolved
src/lib/communication/DY.Lib.Communication.API.Lemmas.fst Outdated Show resolved Hide resolved
Copy link
Contributor

@qaphla qaphla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding some preliminary comments so they don't get lost while reading through the rest of the PR.

src/lib/communication/DY.Lib.Communication.API.fst Outdated Show resolved Hide resolved
src/lib/communication/DY.Lib.Communication.API.fst Outdated Show resolved Hide resolved
src/lib/communication/DY.Lib.Communication.API.fst Outdated Show resolved Hide resolved
src/lib/communication/DY.Lib.Communication.API.fst Outdated Show resolved Hide resolved
@fabian-hk fabian-hk force-pushed the feature/communication-layer branch from a9f3be2 to d0682e8 Compare December 10, 2024 11:11
@fabian-hk fabian-hk changed the base branch from main to feature/add-key-to-crypto-preds December 10, 2024 11:12
@fabian-hk fabian-hk force-pushed the feature/add-key-to-crypto-preds branch from f2945e2 to 96c58c5 Compare December 20, 2024 13:27
@fabian-hk fabian-hk force-pushed the feature/communication-layer branch from 129ea3a to 46081f2 Compare December 20, 2024 15:12
Base automatically changed from feature/add-key-to-crypto-preds to main December 23, 2024 09:22
@fabian-hk fabian-hk force-pushed the feature/communication-layer branch from 46081f2 to e54cca9 Compare December 26, 2024 14:25
@fabian-hk fabian-hk force-pushed the feature/communication-layer branch from b3630b9 to c2205c5 Compare January 10, 2025 09:21
@fabian-hk fabian-hk requested a review from qaphla January 22, 2025 15:49
@fabian-hk fabian-hk marked this pull request as ready for review January 22, 2025 15:49
@fabian-hk fabian-hk requested a review from a team as a code owner January 22, 2025 15:49
@fabian-hk
Copy link
Contributor Author

This PR is ready to be merged from my side. There will be improvements in the future, but I believe this is a solid basis.

…sponse; Updated pre-condition of send_response_proof
…r a meaning full trace printing function; Com Layer trace printing functions
@fabian-hk fabian-hk force-pushed the feature/communication-layer branch from 3743479 to 7deb02c Compare January 23, 2025 17:03
qaphla
qaphla previously approved these changes Jan 24, 2025
Copy link
Contributor

@qaphla qaphla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I have a lot of comments, I think it's probably best to get this merged properly, and then I can turn the most relevant ones into issues for the future (since none seem really blocking to me, more things that we should keep in mind as we continue to use this library and see what additional functionality we want out of it). It would be nice if a few of the small changes were made, but these also seem not critical to me, and I think for the sake of ease of review, it would be better to get this merged, and then do a follow-up cleanup PR for any minor changes.

src/lib/communication/README.md Outdated Show resolved Hide resolved
src/lib/communication/DY.Lib.Communication.Data.fst Outdated Show resolved Hide resolved
src/lib/communication/DY.Lib.Communication.Properties.fst Outdated Show resolved Hide resolved
Comment on lines +139 to +146
// We explicitly do not use `event_triggered tr receiver
// (CommConfReceiveMsg receiver (serialize a payload))` as a
// post-condition here. The reason for the following form of the
// post-condition is that it allows us on the higher layer to assert a
// statement `b` contained in the `higher_layer_preds` that depends on
// some field `field1` of the payload in the following way: `b
// payload.field1 \/ is_publishable tr payload.field1`.
event_triggered tr sender (CommConfSendMsg sender receiver (serialize a payload))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not entirely obvious to me why this is needed --- my intuition is that CommConfReceiveMsg existing implies a corresponding earlier CommConfSendMsg must exist (or that the payload is publishable), and so this would seem to me to be a slightly stronger guarantee with ReceiveMsg instead. Does that implication not actually hold, or is there some other technical problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a technical issue but I did not further investigate it because this form worked for me.

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

Successfully merging this pull request may close these issues.

3 participants