snow icon indicating copy to clipboard operation
snow copied to clipboard

Configure Noise Max Message size - Non-Standard

Open elichai opened this issue 8 months ago • 1 comments

The maximum message size is 2^16 not for any security reason, but because:

Simpler testing, since it's easy to test the maximum sizes. Reduces the likelihood of errors in memory handling, or integer overflow. Enables support for streaming decryption and random-access decryption of large data streams. Enables higher-level protocols that encapsulate Noise messages to use an efficient standard length field of 16 bits.

It was also discussed to modify that for the "NoiseSocket" proposal: https://moderncrypto.org/mail-archive/noise/2017/001230.html

It will be very nice if the library will somehow support configuring this max size (either via a feature/cfg or at runtime?)

I'll also understand if you do not want to deviate from the official spec and consider this out of scope

elichai avatar Aug 03 '25 15:08 elichai

Hey @elichai! So far, snow has an "official spec by default, feature-flagged deviations" type philosophy, such that I could see adding a configurable max message size as a feature-gated option.

mcginty avatar Aug 03 '25 18:08 mcginty