Enable hardware acceleration in TOR
On suitable hardware platforms, FreeBSD/OPNsense supports hardware acceleration for crypto. Verified with https://stackoverflow.com/a/28614159/5424487
TOR however is not set up to make use of this. This change should enable it. Especially useful on those weak CPUs commonly used in router boxes. From https://www.freebsd.org/cgi/man.cgi?tor(1):
HardwareAccel 0|1
If non-zero, try to use built-in (static) crypto hardware
acceleration when available. Can not be changed while tor is
running. (Default: 0)
Because TOR (or rather OpenSSL) will fall back to software crypto when hardware crypto is not available, I see no need to make this flag configurable in the web UI, making this a very trivial PR :)
And if anyone is worried about compromised hardware instructions, Tor already took precautions: https://gitlab.torproject.org/tpo/core/tor/-/issues/10402
Sure, why not. Thanks!