Skip to content

PSQv2 #1048

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

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

PSQv2 #1048

wants to merge 21 commits into from

Conversation

jschneider-bensch
Copy link
Collaborator

@jschneider-bensch jschneider-bensch commented Jul 2, 2025

  • Query mode
  • Registration mode (WIP)
  • Full PQ mode

Fixes #1044
Fixes #1043

Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

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

Looks like this needs to be rebased onto main.

@jschneider-bensch
Copy link
Collaborator Author

I've now implemented registration mode as well, and addressed your comments. In registration mode, the inner initiator payload is passed out for an application to validate, as discussed.
The PR is still missing a lot of documentation, but I would be happy to receive feedback on the overall structure, if possible.

@jschneider-bensch jschneider-bensch marked this pull request as ready for review July 8, 2025 08:34
@jschneider-bensch jschneider-bensch requested review from a team as code owners July 8, 2025 08:34
}

pub(crate) fn serialize_encrypt(&self, payload: &impl SerializeBytes, aad: &[u8]) -> Vec<u8> {
let mut ciphertext = vec![0u8; payload.tls_serialized_len() + 16];
Copy link
Member

Choose a reason for hiding this comment

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

If we want to follow snow APIs, we should have the caller always pass in the output bytes to write into. That's usually nicer for networking to avoid coyping things around.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So you mean the application ultimately will pass in output bytes?

Message {
ephemeral_ecdh_pk: responder_ephemeral_ecdh_pk,
ciphertext,
aad: aad.to_vec(),
Copy link
Member

Choose a reason for hiding this comment

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

aad should maybe be owned here again.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's still not consistent what's owned and what not everywhere. I think I had some trouble with serialization when there were named lifetimes.

pub(crate) key: AEADKey,
}

pub struct SessionState<'keys> {
Copy link
Member

Choose a reason for hiding this comment

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

How is this session state being loaded/stored? And how are the referenced keys being filled in when this happens.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I haven't implemented session storage yet, but the idea was to use tls_codec for that as well. But indeed I wonder how the references should be handled

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.

[PSQ] Implement protocol [PSQ] TLSCodec as wire format
2 participants