logoalt Hacker News

johnisgoodtoday at 5:07 AM3 repliesview on HN

So there are more bugs in a more readable and understandable programming language (C) as opposed to asm? What gives? I am asking because intuition would say the opposite since asm is much more lower-level than C.


Replies

waherntoday at 6:28 AM

The core primitives written in assembly operate on fixed sized blocks of data; no allocations, no indexing arrays based on raw user controlled inputs, etc. Moreover, the nature of the algorithms--at least the parts written in assembly, e.g. block transforms--means any bugs tend to result in complete garbage and are caught early during development.

itemize123today at 5:14 AM

compiler optimization is a blackbox. shortcuts to crypto routines will allow side channel attacks

show 1 reply
formerly_proventoday at 7:15 AM

Crypto primitives tend to have very simple control flow (those that don’t are usually insecure) and even simpler data structures. You won’t find many branches beyond “is there another block?” in a typical block cipher or hash, for example.