News for hackers. Stuff that matters.
Re:X86 is a high-level language by tptacek on Wednesday March 25, 2015 @01:00PM (#9264250)
Every major server ISA is, in this sense, "high level": the ISA is documented, but the microarchitecture isn't, and there are timing-relevant details known only to the manufacturers. Aciicmez famously demonstrated this with a timing attack on the branch prediction cache.
Re:X86 is a high-level language by schoen on Wednesday March 25, 2015 @01:59PM (#9264690)
Any idea why the manufacturers haven't shown more interest in helping out crypto implementers? Surely timing attacks are a pretty prominent problem in microprocessor design circles by now.
Re:X86 is a high-level language by brohee on Wednesday March 25, 2015 @02:13PM (#9264820)
Intel added AES, SHA-1 and SHA-256 instruction. They also added the PCLMULQDQ instruction to efficiently implement ECC. Via Padlock also have AES and SHA, and instructions for Montgomery multiplication (RSA speedup). Plenty of ARM SoC vendors offer crypto cores.

So the toolbox to implement e.g. TLS securely is pretty much there.

What isn't here is a way to implement new crypto primitives that would be timing attack and power analysis attack proof. But short of shipping a FPGA, I don't see how they could do it...

Re:X86 is a high-level language by sdevlin on Thursday March 26, 2015 @01:31AM (#9267992)
> They also added the PCLMULQDQ instruction to efficiently implement ECC.

Isn't this more typically used in GHASH implementations? Maybe it's applicable to both.

Re:X86 is a high-level language by pbsd on Thursday March 26, 2015 @04:26AM (#9268352)
PCLMULQDQ is a godsend to both (GCM and binary elliptic curves), since both rely heavily on multiplication performance over F_{2^n}. The current fastest elliptic curve implementations are over binary fields using this instruction: http://eprint.iacr.org/2013/131.
Re:X86 is a high-level language by sdevlin on Thursday March 26, 2015 @08:10AM (#9268956)
Ah, interesting - so this applies in particular to elliptic curves over binary fields.

I may have missed this, but did they note how performance fared in the absence of hardware support?

Also, have binary curves (this or the NIST ones or any others) seen widespread deployment anywhere? I was under the impression that prime field curves were more widely used.

Re:X86 is a high-level language by pbsd on Thursday March 26, 2015 @08:32AM (#9269030)
As far as I know they didn't try to make a good implementation without CLMUL. However, the older endomorphism-free curve2251 implementation [2, 3] is eye-opening:

- the SSSE3 implementation is ~2.7 times slower than with CLMUL - the generic (using mpfq, which should actually be pretty good) implementation is 5-6 times slower than with CLMUL

Binary curves used to be a lot more popular than they are now, before we all had fat multipliers in CPUs. The patent situation is worse for binary fields too, I think. That said, I'm pretty sure there are deployments somewhere using them; Dan Boneh's TLS survey [1] shows an overwhelming 96% of TLS clients using NIST's P-256, but the second most popular curve is NIST's B-233, at 3.6%. I would guess that this is due to hardware accelerators.

[1] http://www.w2spconf.com/2014/papers/TLS.pdf

[2] http://bench.cr.yp.to/web-impl/amd64-titan0-crypto_dh.html

[3] https://eprint.iacr.org/2011/170

Re:X86 is a high-level language by sdevlin on Thursday March 26, 2015 @09:40AM (#9269451)
Great info - thanks!
Re:X86 is a high-level language by lallysingh on Wednesday March 25, 2015 @02:10PM (#9264790)
Their response has been to add new instructions and features to the chip. Like AES-NI in x86.
Re:X86 is a high-level language by xenophonf on Wednesday March 25, 2015 @02:40PM (#9265021)
There's a lot of fear surrounding in-hardware crypto primitives. See for example:

http://arstechnica.com/security/2013/12/we-cannot-trust-inte...

I personally would be very leery of OpenSSL relying on RdRand or AES-NI.

Re:X86 is a high-level language by CHY872 on Wednesday March 25, 2015 @03:08PM (#9265214)
I think that you have extrapolated the legitimate concern around hardware random number generators to AES-NI, where it is not a legitimate concern.

With random numbers, the point is that there's no good way to tell exactly how random something is, and it's quite easy to generate deterministic stuff that looks random.

Furthermore, by changing a couple of transistors, you can destroy the randomness of Intel's generator.

So, you can mix in Intel's random data as part of your entropy pool (because it can't hurt if done properly), but don't use it as a sole source.

The difference with AES-NI is that the spec it's supposed to implement is well known and deterministic. In particular, if it somehow encrypts something wrong, then anyone who tries to decrypt it without AES-NI wouldn't be able to do so.

Then there'd be a public outcry and Intel would have to recall millions and millions of processors (see Pentium floating point bug) with massive cost to them.

So, the only way it could be bad would be if the instructions could somehow leak data to other contexts or devices. This is possible, but is probably not how you'd perform such an attack, and if Intel did that knowingly, you've probably got bigger problems.

tl;dr - It's hard to trust random data and very easy to break Intel's hardware random number generator (couple of transistors), so don't give it importance above current methods because you have no way to verify that it's working as advertised. Not being able to trust AES-NI on the other hand would cost Intel billions and billions and billions. Furthermore, AES-NI is in principle more secure than a software implementation; not vulnerable to cache timing attacks, software bugs etc.

Re:X86 is a high-level language by vilhelm_s on Wednesday March 25, 2015 @05:10PM (#9265935)
Incidentally, D.J. Bernstein argues that hashing an additional randomness source sometimes _can_ hurt: http://blog.cr.yp.to/20140205-entropy.html

I guess it would be difficult in practice to make a malicious hardware randomness source, but it's an interesting perspective; to have confidence in your algorithm you should carefully restrict where the randomness enters it.

Re:X86 is a high-level language by CHY872 on Wednesday March 25, 2015 @09:25PM (#9267246)
This sort of attack would be easy to defeat, though. For example, one fix would be to precompute a few megs of randomness data from your hardware source, and only use it after a few minutes have passed since generation. If the malicious RNG can predict the contents of the rest of the pool after this time (without modifying them) then there are bigger problems with the randomness generation.
Re:X86 is a high-level language by wtallis on Wednesday March 25, 2015 @07:51PM (#9266871)
Yeah, I've always found it odd how proponents of various entropy combining methods think it's reasonable to be afraid of hardware smart enough to know when to sabotage the RNG, but think it's unrealistic to postulate that it would also know the right way to poison their entropy pool.
Re:X86 is a high-level language by nightcracker on Wednesday March 25, 2015 @07:32PM (#9266797)
I disagree. The risk is not that the hardware encryption module like AES-NI encrypts _wrong_, at all.

The risk is that it's possible to escrow the last N used AES-NI keys within the chip, and extract them using custom non-public microcode or physical access.

Re:X86 is a high-level language by CHY872 on Wednesday March 25, 2015 @09:08PM (#9267187)
That's fanciful. If your hardware is vulnerable to such an extent, you might as well keel over and give up on any security. For example, such hardware could reasonably be expected to occasionally scan main memory for crypto keys in the first place, or perhaps install an SSH server and a root user, or...

Again, the reason why people care (or rather, should care) about RNGs is because it's theoretically very easy to tamper with them and very hard to then detect such tampering unless you're actively looking for it: http://arstechnica.com/security/2013/09/researchers-can-slip...

Re:X86 is a high-level language by nightcracker on Wednesday March 25, 2015 @10:06PM (#9267408)
No, scanning main memory is very obvious and easy to detect.

A small one kilobyte of escrow is a lot more nefarious and harder to detect.

Re:X86 is a high-level language by xenophonf on Wednesday March 25, 2015 @04:05PM (#9265556)
That's actually very reassuring. Thanks!