Skip to content

tls_codec: implement SerializeBytes for VLBytes - #2350

Merged
franziskuskiefer merged 4 commits into
RustCrypto:masterfrom
cryspen:wysiwys/vlbytes_serialize_bytes
Jun 18, 2026
Merged

tls_codec: implement SerializeBytes for VLBytes#2350
franziskuskiefer merged 4 commits into
RustCrypto:masterfrom
cryspen:wysiwys/vlbytes_serialize_bytes

Conversation

@wysiwys

@wysiwys wysiwys commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

This PR implements SerializeBytes for VLBytes. Since the SerializeBytes::tls_serialize() method is now implemented for VLBytes in addition to the existing Serialize::tls_serialize() method, this PR also updates the calls to Serialize::tls_serialize() in this module to explicitly use the method from the Serialize trait.

@franziskuskiefer
franziskuskiefer self-requested a review June 17, 2026 08:29
@wysiwys
wysiwys force-pushed the wysiwys/vlbytes_serialize_bytes branch from e8079de to 72df2d8 Compare June 17, 2026 08:39
@franziskuskiefer franziskuskiefer changed the title implement SerializeBytes for VLBytes tls_codec: implement SerializeBytes for VLBytes Jun 18, 2026

@franziskuskiefer franziskuskiefer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks.

This creates an asymmetry for no_std. I don't think that's necessary.
You could implement it the way &[T] already does it, and move both impls out to a location that is not gated by std.

Comment thread tls_codec/src/quic_vec.rs Outdated
@wysiwys
wysiwys requested a review from franziskuskiefer June 18, 2026 11:52

@franziskuskiefer franziskuskiefer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like CI isn't happy.

@wysiwys
wysiwys force-pushed the wysiwys/vlbytes_serialize_bytes branch from 60f5127 to ff50d18 Compare June 18, 2026 13:24
@wysiwys
wysiwys requested a review from franziskuskiefer June 18, 2026 13:46

@franziskuskiefer franziskuskiefer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, let's get this in.

Just a note that VLByteVec is replacing VLBytes (hence the deprecation).

@franziskuskiefer
franziskuskiefer merged commit e9f27cd into RustCrypto:master Jun 18, 2026
13 checks passed
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.

2 participants