-
Notifications
You must be signed in to change notification settings - Fork 18k
x/sys/unix: support for AF_ALG sockets #19033
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
Comments
Actually there was a discussion some time ago about trying to use this in the core for accelerated crypto on Linux without needing our own assembly. One discussion is #4299 (comment) but that's not the one I'm thinking of. And I can't find it in my gmail either. I'd be interested in reviewing! I remember @agl was curious about the results/speed as well. |
Good news: I got it working. One hangup is that I can't figure out why Here's a quick and dirty prototype I did with it:
Results:
I can submit what I have now though and maybe someone will have some more insight on the matter. |
Unless a large quantity of data is involved (or we just splice(2) data
without redundant copy?), crossing the user/kernel boundary will very
likely kill much of the performance benefit.
(That is, I think the right approach is for the kernel to expose VDSO calls
to primitive crypto operations, rather than through netlink socket. But in
that case, kernel bugs means updating buggy kernel provided crypto
operations is much harder. Therefore, on balance, the best option is still
do crypto in user space, unless we're talking TPM that wraps keys, but
that's a different story altogether.)
|
CL https://golang.org/cl/36805 mentions this issue. |
Yep, this is my understanding and assumption as well. I just wanted to give this a try to see what could be done with it in Go. |
Just for my own curiosity, I hacked up a quick and dirty SHA1
Perhaps my naive benchmarks are flawed, but honestly, I'm pretty impressed to see that Maybe this could be useful on other architectures outside of amd64? We can open another issue to look into it if needed. Just figured I would share since my curiosity got the best of me. |
During my recent netlink adventures, I learned of
AF_ALG
sockets on Linux. It appears these aren't currently exposed viax/sys/unix
, and it'd be nice if they were.I plan on using @elliotmr's work on adding
AF_CAN
sockets as reference, as discussed in #16188.I'll give this a go, but if someone is already working on this, feel free to ping and we can collaborate!
The text was updated successfully, but these errors were encountered: