bolt8

Encrypted and authenticated transport, per BOLT #8 (docs.ppad.tech/bolt8).
git clone git://git.ppad.tech/bolt8.git
Log | Files | Refs | README | LICENSE

IMPL1.md (855B)


      1 # IMPL1: Packet framing for decrypt
      2 
      3 ## Steps
      4 1) Decide API shape:
      5    - Option A: Make decrypt strict and require exact packet length.
      6    - Option B: Add decrypt_frame returning remainder, keep decrypt strict
      7      or unchanged.
      8 2) If Option A:
      9    - Add length check that the buffer equals 18 + len + 16.
     10    - Return InvalidLength on trailing bytes.
     11 3) If Option B:
     12    - Implement decrypt_frame :: Session -> ByteString
     13      -> Either Error (ByteString, ByteString, Session).
     14    - decrypt_frame consumes one frame and returns the remainder.
     15    - Keep existing decrypt strict or make it a wrapper over
     16      decrypt_frame that rejects remainder.
     17 4) Add tests for framing behavior:
     18    - Trailing bytes rejected for strict decrypt.
     19    - decrypt_frame returns the correct remainder.
     20 
     21 ## Notes
     22 - Align docstrings with the chosen behavior.
     23 - No new dependencies.