Does crypto/AES work on hardware that doesn't have the aes instruction set? Hello, Will crypto/aes, cipher/GCM work on hardware without embedded aes support?

86 views
Skip to first unread message

Sean

unread,
Dec 3, 2021, 12:51:02 AM12/3/21
to golang-nuts
Hello,

Will **crypto/aes**, **cipher/GCM** work on hardware without embedded aes support?

What I want to know is how these packages respond in cases where there is no embedded AES support (fast is not important).

Matthew Walster

unread,
Dec 3, 2021, 3:53:53 AM12/3/21
to Sean, golang-nuts
Sure, it's enabled in a build constraint:


It's not an exact science, there's no testing for the instruction afaict, it's just that anything running the amd64 architecture has the aesni instructions. I assume likewise for arm64.

M

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e55ee408-fdf3-4472-9e87-84647197ed73n%40googlegroups.com.

Matthew Walster

unread,
Dec 3, 2021, 3:57:41 AM12/3/21
to Sean, golang-nuts
Whoops, yes, there is a feature flag there I missed "supportsAES" etc. It appears to be gated on that instruction being present, at which time the operation becomes roughly constant time.

M


Reply all
Reply to author
Forward
0 new messages