drogue-iot / embedded-tls

An Rust TLS 1.3 implementation for embedded devices.
Apache License 2.0
168 stars 21 forks source link

Use minimal buffer for label expansion #95

Closed bugadani closed 1 year ago

bugadani commented 1 year ago

Instead of a hardcoded 512 byte vector, use a buffer size appropriate for the actual CipherSuite instance.

I have made a few assumptions here but the 512 buffer was also an assumption, I assume :) If only I didn't need to use typenum here...

bugadani commented 1 year ago

Typenum will still be useful for the foreseeable future because of the math demonstrated here isn't possible with const generics. Also there are a bunch of unstable features that could maybe make this PR nicer, but it is, what it is right now :)