Discussion:
EVP_DIGESTINIT(3) vs. MD5(3) and my CPU
Peter J. Philipp
2021-05-24 08:14:06 UTC
Permalink
Hi,

I did a search on marc.info on this but didn't come to a conclusion. So the
subject already says it, the MD5(3) manpage says that the EVP functions should
be used, ok. I'm hoping that using the EVP functions will give me hardware
support at these hashing functions much like AESNI, however, how do I know that
my CPU supports hardware accelleration of MD5, SHA1, or SHA256? What flags
must I know on the cpu?

I'm about to do a conversion on my main program which uses all these hash
mechanisms to EVP, I'd love to get cpu support. If I don't get MD5 support
I would replace it with a SHA1 or SHA2 function in my code.

Here is a sample CPU on one of my vps's:

cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,TOPEXT,FSGSBASE,BMI1,AVX2,SMEP,BMI2,RDSEED,ADX,SMAP,CLFLUSHOPT,SHA,IBPB,SSBD,XSAVEOPT,XSAVEC,XGETBV1

I see AES (AESNI?), SHA (does this offload SHA hashing?).

Best Regards,
-peter

Loading...