Skip to content

feat: adopt pontifex channel in the verifier enclave - #96

Merged
Takaros999 merged 3 commits into
mainfrom
takis/pontifex-channel-api
Sep 5, 2026
Merged

feat: adopt pontifex channel in the verifier enclave#96
Takaros999 merged 3 commits into
mainfrom
takis/pontifex-channel-api

Conversation

@Takaros999

@Takaros999 Takaros999 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

PR 1 of 3, integrating pontifex 2.0.0.

This PR:

  • Adopts ChannelEnclave for the encryption key
  • Attests the public key commitment because the key is too large now and returns public_key along with the attestation doc
  • Updates the /matches route, to use the Channel for the sealing/unsealing operations

To reduce the scope of this PR, I focused on just adopting a pontifex any simplifications we can can follow up with.

@Takaros999
Takaros999 force-pushed the takis/pontifex-channel-api branch from 7990d5f to 3d515bb Compare September 4, 2026 21:46
@Takaros999 Takaros999 changed the title feat!: adopt pontifex channel and expose attested public keys feat: adopt pontifex channel in the verifier enclave Sep 4, 2026
@Takaros999
Takaros999 force-pushed the takis/pontifex-channel-api branch from 3d515bb to 59824f8 Compare September 4, 2026 21:55
@Takaros999
Takaros999 marked this pull request as ready for review September 4, 2026 21:59
@Takaros999

Copy link
Copy Markdown
Collaborator Author

@codex review

Comment thread verifier/enclave-types/src/matches.rs Outdated
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MatchRequest {
/// The sealed request: `enc || ciphertext`, relayed verbatim.
/// The Pontifex sealed request, relayed verbatim.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

NIT:

Suggested change
/// The Pontifex sealed request, relayed verbatim.
/// The sealed request, relayed verbatim.

Comment thread verifier/enclave-types/src/matches.rs Outdated
#[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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// The Pontifex sealed response, readable only by the requester.
/// The sealed response, readable only by the requester.

Comment thread verifier/enclave/src/routes/matches.rs Outdated
fn inputs(credential: &[u8], threshold: f32) -> MatchInputs {
MatchInputs {
version: CHANNEL_VERSION,
version: MATCH_PROTOCOL_VERSION,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 thread verifier/enclave/src/routes/matches.rs Outdated
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);
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we really need this test? Seems to only test the pontifex sealed channel impl

Comment thread verifier/sealed-types/src/lib.rs Outdated
Comment on lines +14 to +15
/// Version of the Flamingo match payload.
pub const MATCH_PROTOCOL_VERSION: u8 = 1;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can be removed imo. See comments above.

Comment thread verifier/sealed-types/src/lib.rs Outdated
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";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
pub const MATCH_CHANNEL_DOMAIN: &str = "flamingo-verifier/matches";
pub const MATCH_CHANNEL_DOMAIN: &str = "flamingo-verifier/matches/v1";

paolodamico
paolodamico previously approved these changes Sep 4, 2026
@Takaros999
Takaros999 merged commit 0b985a1 into main Sep 5, 2026
14 checks passed
@Takaros999
Takaros999 deleted the takis/pontifex-channel-api branch September 5, 2026 01:10
@github-actions github-actions Bot mentioned this pull request Sep 4, 2026
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