F-35 Fighter Jet's C++ Coding Standards [pdf]
----
- 15 minutes ago | 11 points | 2 comments
- URL: https://www.stroustrup.com/JSF-AV-rules.pdf
- Discussions: https://news.ycombinator.com/item?id=46185393
- Summary: LOCKHEED MARTIN’S JOINT STRIKE FIGHTER “2RDU00001 Rev C” DECEMBER 2005 C++ CODING STANDARDS
Purpose: Mandatory rules for safety-critical Air Vehicle software, extending MISRA-C concepts to C++.
Core Goals: Reliability, portability, maintainability, testability, reusability, extensibility, readability.
Key Constraints:
- Functions ≤ 200 logical lines, cyclomatic complexity ≤ 20.
- Strict subset of ISO C++ 2003; no trigraphs, digraphs, wide/multi-byte chars, errno, setjmp/longjmp, stdio, abort/exit, etc.
- Only four preprocessor directives allowed: #ifndef, #define, #endif, #include; no macro constants or inline macros—use const/inline functions.
- Headers *.h, implementations *.cpp; include guards mandatory; forward declarations to cut dependencies.
Style: 120-char lines, 2-space indent, no tabs, lowercase identifiers with underscores, public/protected/private order, braces required for all blocks.
Libraries: Only DO-178B level A certified or in-house safety-critical libraries.
Deviations: “Shall” rules require engineering & product-manager approval and inline documentation.
define
some punk 31 years ago was tired of dealing with "correctly matching const char* vs char*" so they just did
#define CONST
and now it's my problem
COLDCARD's Random Numbers Weren't
----
- 4 days ago | 5 points | 0 comments
- URL: https://coldcard.rip/
- Discussions: https://news.ycombinator.com/item?id=49186715
- Summary: coldcard.rip documents a critical vulnerability in COLDCARD hardware wallets. A build guard only checked whether the hardware RNG macro existed, not whether it was enabled—`#define HAS_RNG 0` would satisfy it. From March 2021, affected devices could generate wallet seeds from predictable inputs, providing only 73.3 bits of entropy at best, and zero in the worst case, instead of the intended 128 bits.
Between July 30 and August 2, 2026, attackers swept 1,432.48 BTC (after miner fees) from 5,477 distinct addresses across 2,896 transactions, consolidating 7,346 UTXOs into 613 destinations. Most of the funds (1,432.46 BTC) remain at tracked destinations. The site catalogs the activity across 10 distinct waves and links to 25 public sources for attribution.
The vulnerability shipped through four commits and two direct pushes with no code reviews. The timeline spans from an initial commit in May 2018 through ongoing loss reports and advisories, with the gap between the first commit and the first on-chain sweep totaling five years.