From 06826f85d89a2ba53bf9fc00f5a1e2657dbc08d1 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 30 Aug 2025 14:42:47 +0100 Subject: [PATCH] brontide: add new maxMessageSize variable --- brontide/noise.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/brontide/noise.go b/brontide/noise.go index a55806399..53f951adb 100644 --- a/brontide/noise.go +++ b/brontide/noise.go @@ -35,6 +35,10 @@ const ( // header and it's MAC. encHeaderSize = lengthHeaderSize + macSize + // maxMessageSize is the maximum size of an encrypted message including + // the MAC. This is the max payload (65535) plus the MAC size (16). + maxMessageSize = math.MaxUint16 + macSize + // keyRotationInterval is the number of messages sent on a single // cipher stream before the keys are rotated forwards. keyRotationInterval = 1000