Note that this is bfgminer, with CPU. This is not supposed to have the latest CPU optimizations enabled as it's not used for that in years, maybe a decade or more.
if there's demand now what's really needed is instructions for cpu with AES support. for sure regular sha256() ,openssl, with hardware aes turned on there , is faster than yours now.
Since openssl is a dependency, I suppose it already uses that. Furthermore, this isn't nullama's software. I'm pretty sure it was first released (and maintained - last commit in '21) by Luke Dashjr
.