# Re: \[PATCH iproute2-next v2\] lib/bpf\_legacy: Use userspace SHA-1 code instead of AF\_ALG

- From: Simon Richter \<hidden\>
- Date: 2025-11-13 08:51:49 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/11/7939770
- Thread: https://ratatoskr.run/netdev/2025/09/7933413/t.md

```text
Hi,

On 11/13/25 4:25 PM, Ard Biesheuvel wrote:

> Also, I strongly agree with Eric that a syscall interface to perform
> crypto s/w arithmetic that could easily execute in user space is
> something that should have never been added, and creates portability
> concerns for no good reason.

Would it make sense to add crypto (and other transform) operations to the vdso, and make the decision whether the syscall is beneficial from there, depending on request/batch size (speed vs overhead tradeoff), data source/sink and available hardware?

For example, "gzip -d" pulling data from a file and writing to a file will need to transfer the data to userspace first, process it there, then transfer it back to kernelspace so it can be written to a file.

That's a lot of syscall and transfer overhead compared to just a single "decompress this file" call that keeps the data entirely in kernelspace -- so we benefit already even if there is no hardware gzip decompressor, and users that have one (such as myself) would benefit even further.

   Simon
```
