Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto/aes: S-box cache timing leak #13795

Open
DemiMarie opened this issue Dec 31, 2015 · 7 comments
Open

crypto/aes: S-box cache timing leak #13795

DemiMarie opened this issue Dec 31, 2015 · 7 comments
Labels
Milestone

Comments

@DemiMarie
Copy link

The crypto/aes package uses S-boxes and thus leaks cache timing information. Techniques to avoid this are known and should be used on all platforms Go supports.

If Go does not support the needed vector intrinsics, then support for them should be added.

@cespare
Copy link
Contributor

cespare commented Dec 31, 2015

/cc @agl

@randall77
Copy link
Contributor

We use the vector intrinsics on amd64 whenever they are available on the processor. Are there other specific archs which you are referencing?

@DemiMarie
Copy link
Author

I am referring to the algorithms Go uses. As shown in the paper above, certain vector intrinsics could be used to avoid the need for S-boxes, but Go's implementation of AES does use S-boxes, creating a possible side-channel vulnerability on shared machines.

@randall77
Copy link
Contributor

Go does use the amd64 vector intrinsics if available. It uses the sbox code (in crypto/aes/block.go:encryptBlockGo) only for other architectures and for amd64 chips which don't have AESNI. See crypto/aes/cipher_asm.go.

@bradfitz bradfitz added this to the Unplanned milestone Jan 21, 2016
@DemiMarie
Copy link
Author

Sorry – by "vector intrinsics" I do not mean AES-NI, but rather SSE3+, which OpenSSL uses for bit-sliced AES.

@randall77
Copy link
Contributor

So then I'm not sure what you are requesting. Do you want us to implement bit-sliced AES for chips which are SSE3+ but not AES-NI? Or do you want us to provide the intrinsics (which ones?) which you will need to do so yourself?

Are >= SSE3+ but < AES-NI chips worth targeting?

As far as I can tell, all the ops the paper uses (which isn't entirely clear - it would be really nice if they had assembly listings) are available now in Go assembly.

@DemiMarie
Copy link
Author

Use the bitsliced approach on chips with SSE3+ and no AES-NI. Some low-end
chips produced today lack AES-NI.

Also, please choose at runtime based on CPUID.
On Jan 21, 2016 11:00 PM, "Keith Randall" notifications@github.com wrote:

So then I'm not sure what you are requesting. Do you want us to implement
bit-sliced AES for chips which are SSE3+ but not AES-NI? Or do you want us
to provide the intrinsics (which ones?) which you will need to do so
yourself?

Are >= SSE3+ but < AES-NI chips worth targeting?

As far as I can tell, all the ops the paper uses (which isn't entirely
clear - it would be really nice if they had assembly listings) are
available now in Go assembly.


Reply to this email directly or view it on GitHub
#13795 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants