Do you know of any Rust impl of ChCha2Poly1305 or AesGcm[128,196,256] that uses GPU (especially CUDA) for encryption?

I'm looking for any Rust impl of ChCha2Poly1305 or AesGcm[128,196,256] that uses GPU (especially CUDA) for encryption?

Why? Those algorithms aren't massively parallel. Also I'm not sure whether Rust can target GPU (I think not, but I haven't looked in a long time).

I want to develop an app that runs on GPU and decrypt some data from disk and feed it to a training app

You can't literally run the whole app on the GPU, can you? You're still gonna have a part which runs on CPU, starts the whole thing and provides the UI. Make it do decryption. You're still pushing that data through RAM, and you are unlikely to win anything speedwise even if it's possible to run AES on GPU.

By the way, you're using algorithms with integrity checks. I'm almost certain you can't do it faster on the GPU, because the checksum is updated by decrypting every block individually.

2 Likes

Yes, after thinking a bit more maybe it's enough to do decryption with CPU, just I would want to take advantage of zero-copy like sendfile() and RDMA. Then I can serve this to a training app which authenticate with private key from OS keyring, where I get also the decryption key.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.