feat: adopt pontifex channel in the verifier enclave - #96
Merged
Conversation
Takaros999
force-pushed
the
takis/pontifex-channel-api
branch
from
September 4, 2026 21:46
7990d5f to
3d515bb
Compare
Takaros999
force-pushed
the
takis/pontifex-channel-api
branch
from
September 4, 2026 21:55
3d515bb to
59824f8
Compare
Takaros999
marked this pull request as ready for review
September 4, 2026 21:59
Collaborator
Author
|
@codex review |
kilianglas
reviewed
Sep 4, 2026
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||
| pub struct MatchRequest { | ||
| /// The sealed request: `enc || ciphertext`, relayed verbatim. | ||
| /// The Pontifex sealed request, relayed verbatim. |
Collaborator
There was a problem hiding this comment.
NIT:
Suggested change
| /// The Pontifex sealed request, relayed verbatim. | |
| /// The sealed request, relayed verbatim. |
| #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] | ||
| pub struct MatchResponse { | ||
| /// The sealed payload: `response_nonce || ciphertext`, readable only by the requester. | ||
| /// The Pontifex sealed response, readable only by the requester. |
Collaborator
There was a problem hiding this comment.
Suggested change
| /// The Pontifex sealed response, readable only by the requester. | |
| /// The sealed response, readable only by the requester. |
| fn inputs(credential: &[u8], threshold: f32) -> MatchInputs { | ||
| MatchInputs { | ||
| version: CHANNEL_VERSION, | ||
| version: MATCH_PROTOCOL_VERSION, |
Collaborator
There was a problem hiding this comment.
I think we can remove the version field. I already wanted to remove this in a prior PR. The version could just be encoded in MATCH_CHANNEL_DOMAIN.
Comment on lines
+415
to
+434
| #[tokio::test] | ||
| async fn rejects_a_wrong_domain_or_tampered_request_before_matching() { | ||
| for (domain, tamper) in [("another-protocol", false), (MATCH_CHANNEL_DOMAIN, true)] { | ||
| let state = crate::test_support::state_with(Arc::new(EchoAttestor)); | ||
| let consumer = ChannelConsumer::from_unverified_public_key( | ||
| ChannelDomain::new(domain), | ||
| &state.encryption_public_key(), | ||
| ) | ||
| .unwrap(); | ||
| let (mut ciphertext, _) = consumer.seal_to_enclave(b"inputs").unwrap(); | ||
| if tamper { | ||
| *ciphertext.last_mut().unwrap() ^= 1; | ||
| } | ||
| let error = handler(state, MatchRequest { body: ciphertext }) | ||
| .await | ||
| .unwrap_err(); | ||
| assert_eq!(error, enclave_types::Error::RequestNotOpened); | ||
| } | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
Do we really need this test? Seems to only test the pontifex sealed channel impl
Comment on lines
+14
to
+15
| /// Version of the Flamingo match payload. | ||
| pub const MATCH_PROTOCOL_VERSION: u8 = 1; |
Collaborator
There was a problem hiding this comment.
Can be removed imo. See comments above.
| pub const MATCH_PROTOCOL_VERSION: u8 = 1; | ||
|
|
||
| /// Pontifex channel domain shared by the consumer and enclave. | ||
| pub const MATCH_CHANNEL_DOMAIN: &str = "flamingo-verifier/matches"; |
Collaborator
There was a problem hiding this comment.
Suggested change
| pub const MATCH_CHANNEL_DOMAIN: &str = "flamingo-verifier/matches"; | |
| pub const MATCH_CHANNEL_DOMAIN: &str = "flamingo-verifier/matches/v1"; |
paolodamico
previously approved these changes
Sep 4, 2026
paolodamico
approved these changes
Sep 5, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 1 of 3, integrating pontifex 2.0.0.
This PR:
ChannelEnclavefor the encryption key/matchesroute, to use the Channel for the sealing/unsealing operationsTo reduce the scope of this PR, I focused on just adopting a pontifex any simplifications we can can follow up with.