mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-26 10:05:19 +00:00
This addresses the Cure53 audit finding BCH-01-010 which identified several implementation deviations from the Noise Protocol Framework specification. Changes: - Expand nonce from 4-byte to 8-byte transmission per spec guidance This provides 2^64 nonce space instead of the limited 2^32 space - Fix integer overflow in replay window check using safe arithmetic - Add constant-time comparison functions for key validation to prevent timing side-channel attacks - Add clearSensitiveData() method to NoiseSymmetricState that clears chaining key and hash after split() operation - Document atomic nonce state updates in decryption Security improvements: - Constant-time operations prevent information leakage via timing analysis - Proper cleanup of symmetric state after handshake completion - Safer arithmetic prevents potential integer overflow issues Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>