logoalt Hacker News

userbinatortoday at 2:09 AM1 replyview on HN

and with only 384 KB of RAM.

A 2048-bit RSA key is 256 bytes. A 256-bit symmetric key is 32 bytes and ECDH keys are roughly the same size. The state size of AES is 16 bytes and its S-box is 256 bytes. Efficient implementations use only a few KB of state. The vast majority of cryptographic algorithms just aren't that big, relatively speaking; although as you mention, they are very computationally intense. Hash states are in the dozens to low hundreds of bytes. For TLS implementation, the record buffers are probably going to use the most RAM; 16K each direction + additional overhead.


Replies

tanelivtoday at 10:31 AM

So the loop unrolling must have increased the resident code size quite considerably, on the order of two to three hundred kilobytes?