lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACVxJT9NJtqpteJ5hVX8FnBYo00_-NokuB2zgq_tuK2b_qA51A@mail.gmail.com>
Date:   Mon, 27 Mar 2017 16:11:32 +0300
From:   Alexey Dobriyan <adobriyan@...il.com>
To:     Steffen Klassert <steffen.klassert@...unet.com>
Cc:     "herbert@...dor.apana.org.au" <herbert@...dor.apana.org.au>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        David Laight <David.Laight@...lab.com>
Subject: Re: [PATCH v2] xfrm: branchless addr4_match() on 64-bit

On Mon, Mar 27, 2017 at 1:37 PM, Steffen Klassert
<steffen.klassert@...unet.com> wrote:
> On Sat, Mar 25, 2017 at 07:41:17PM +0300, Alexey Dobriyan wrote:
>> After (no branches):
>>
>>       mov    r8d,0x20
>>       mov    rdx,0xffffffffffffffff
>>       mov    esi,DWORD PTR [rsi+0x2c]
>>       mov    ecx,r8d
>>       sub    cl,BYTE PTR [rdi+0x2a]
>>       xor    esi,DWORD PTR [rbx]
>>       mov    rdi,rdx
>>       xor    eax,eax
>>       shl    rdi,cl
>>       bswap  edi
>>
>> Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
>
> Also applied to ipsec-next, thanks for the patches Alexey!

Speaking of optimizations.
1) All those ntohl() invocations inside hashes are likely
unnecessary (hashing is hashing after all).

2) I din't look closely but it can be further optimized by storing
32 - prefixlen (or 128 - prefixlen) but I don't know if you'll accept
such horror. :-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ