-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: main
Are you sure you want to change the base?
PSQv2 #1048
Conversation
There was a problem hiding this 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.
9dd51a1
to
75e432e
Compare
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. |
libcrux-psq/src/protocol/keys.rs
Outdated
} | ||
|
||
pub(crate) fn serialize_encrypt(&self, payload: &impl SerializeBytes, aad: &[u8]) -> Vec<u8> { | ||
let mut ciphertext = vec![0u8; payload.tls_serialized_len() + 16]; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Fixes #1044
Fixes #1043