top | item 37275377

(no title)

charsii | 2 years ago

Crypto code should be written in assembly. Zero ambiguity, zero undefined behavior, 100% verifiable.

discuss

order

woodruffw|2 years ago

ISAs regularly leave all kinds of behavior undefined when they think it doesn’t matter (such as the state of the arithmetic flags after operations that shouldn’t need to the tested).

(But this is also irrelevant: assembly can be completely wrong and exploitable while also being perfectly well defined.)

tromp|2 years ago

Readability suffers though, with negative impacts on maintainability and even verifiability (fewer people able/willing to examine the source code).

torstenvl|2 years ago

goto fail wasn't caused by ambiguity or undefined behavior. C's rules here are crystal clear, and conditional branches in assembly also do not make the following instructions condition (unless you're using delay slots à la SPARC).

Heartbleed also wasn't caused by ambiguity or undefined behavior, if you believe compiler writers.

otikik|2 years ago

Wouldn’t the low readability make it easier to slip a vulnerability in by splicing it out into several changes?

dickle|2 years ago

There's plenty of undefined behaviour at that level, just look at Spectre and Meltdown vulnerabilities for example.