bolt4

Onion routing protocol, per BOLT #4 (docs.ppad.tech/bolt4).
git clone git://git.ppad.tech/bolt4.git
Log | Files | Refs | README | LICENSE

REVIEW-94936a9.md (825B)


      1 # Review: IMPL5 Error Handling (94936a9)
      2 
      3 ## Status: Approved with minor suggestions
      4 
      5 ## Issues
      6 
      7 ### 1. Duplicate helpers
      8 
      9 `Error.hs` duplicates `constantTimeEq` and `word16BE` from other modules.
     10 
     11 **Suggestion:** Export `constantTimeEq` from Prim, `word16BE` from Codec,
     12 and import in Error.hs.
     13 
     14 **Files:**
     15 - `Prim.hs`: export `constantTimeEq`
     16 - `Codec.hs`: export `word16BE`
     17 - `Error.hs`: remove local definitions, import from above
     18 
     19 **Priority:** Low (cosmetic, reduces maintenance burden)
     20 
     21 ### 2. Consider verifyHmac reuse
     22 
     23 `verifyErrorHmac` in Error.hs computes HMAC and does constant-time
     24 comparison. Could potentially reuse `computeHmac` and `verifyHmac` from
     25 Prim, though the signature differs slightly (um key vs mu key usage).
     26 
     27 **Priority:** Low (current implementation is clear and correct)
     28 
     29 ## No blocking issues