3 ms·
Most cryptographic operations are easy to implement. The best part is when you make a mistake, you'll most likely get random nonsense out the end. Floating po
by zgs 4y ago
Most cryptographic operations are easy to implement. The best part is when you make a mistake, you'll most likely get random nonsense out the end. Floating point code is much more difficult, often you'll get an answer that's almost correct or worse one that's correct most places...
- fstokesman 4y agoHeard about a great floating point implementation bug just today. When nintendo released Super Mario 64 for the Wii virtual console, they essentially just made their own emulator that plays a single ROM. The emulator is pretty accurate, though they made a mistake when implementing floating point operation rounding: All operations end up rounding upwards to the next floating point number (as opposed to alternating, depending on the result). A consequence of this was that some of the moving platforms in the game that had a periodic up/down pattern would slowly (over the course of literal days) creep upwards. Ended up being exploited in a speedrun category where the player attempts to press the A button as little as possible.
- sireat 4y agoShades of the floating point truncation bug in Vancouver Stock Exchange Index in the early 1980s: https://en.wikipedia.org/wiki/Vancouver_Stock_Exchange#Rounding_errors_on_its_Index_price https://en.wikipedia.org/wiki/Vancouver_Stock_Exchange#Round... The bug caused the index to creep up to twice the real index.
- grishka 4y agoThe even better part is that you can generate or find test vectors to test your implementation against a known-correct one.