bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: af_alg benchmarks and performance


From: Matteo Croce
Subject: Re: af_alg benchmarks and performance
Date: Tue, 8 May 2018 13:07:15 +0200

On Tue, May 8, 2018 at 3:25 AM, Assaf Gordon <address@hidden> wrote:
> A comment about the above:
> Talking about "crypto API" lumps together encryption (e.g. AES) and hashing.
> The link [3] talks about the "AES-NI"  which is used for encryption
> (and from personal anecdotal evidence indeed provide nice speedups).
> These instructions do not help in sha1/256/512 hashing (which is what we're
> interested in).
> Intel also has "SHA Extensions" [7][8], but the only information I could
> find is that the instructions are only for sha1/sha256, and are only availble
> on the weaker models (e.g. Celeron) - because these models do not have
> more advanced SIMD/MIMD instructions. For CPUs with advanced instructions,
> Intel seems to promote AVX-512 instructions as the key to fast hashing [10].
>


Hi Assaf,

for every algorythm the kernel has many implementations. For example
for sha1 we have:
- a generic one writtten in C[1]
- an SSSE3 for CPU from Core2 Duo and newer[2]
- an AVX2 for Haswell and newer[3]
- an implementation using SHA1 instructions, found on low end CPU[4]

for sha256 we have the same and another implementation using AVX which
entered with Sandy Bridge

The same applies for ARM, where there are implementation for ARMv4,
ARMv7, ARMv8 and the newest Crypto Extensions.

I see the same for PPC64 and S390X, in the time being I'll borrow two
machines and provide tests on them.

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/crypto/sha1_generic.c
[2] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/crypto/sha1_ssse3_asm.S
[3] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/crypto/sha1_avx2_x86_64_asm.S
[4] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/crypto/sha1_ni_asm.S
[5] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/crypto
[6] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/crypto

Regards,
-- 
Matteo Croce
per aspera ad upstream



reply via email to

[Prev in Thread] Current Thread [Next in Thread]