Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1545813

Re: HalfSipHash Acceptable Usage

From "Jason A. Donenfeld" <Jason@zx2c4.com>
Newsgroups linux.kernel
Subject Re: HalfSipHash Acceptable Usage
Date 2016-12-21 15:50 +0100
Message-ID <sQQno-4FS-17@gated-at.bofh.it> (permalink)
References <sQFLj-6pl-5@gated-at.bofh.it> <sQHDs-7EN-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Eric,

I computed performance numbers for both 32-bit and 64-bit using the
actual functions in which talking about replacing MD5 with SipHash.
The basic harness is here [1] if you're curious. SipHash was a pretty
clear winner for both cases.

x86_64:
[    1.714302] secure_tcpv6_sequence_number_md5# cycles: 102373398
[    1.747685] secure_tcp_sequence_number_md5# cycles: 92042258
[    1.773522] secure_tcpv6_sequence_number_siphash# cycles: 70786533
[    1.798701] secure_tcp_sequence_number_siphash# cycles: 68941043

x86:
[    1.635749] secure_tcpv6_sequence_number_md5# cycles: 106016335
[    1.670259] secure_tcp_sequence_number_md5# cycles: 95670512
[    1.708387] secure_tcpv6_sequence_number_siphash# cycles: 105988635
[    1.740264] secure_tcp_sequence_number_siphash# cycles: 88225395

>>> 102373398 > 70786533
True
>>> 92042258 > 68941043
True
>>> 106016335 > 105988635
True
>>> 95670512 > 88225395
True

While MD5 is probably faster for some kind of large-data
cycles-per-byte, due to its 64-byte internal state, SipHash -- the
"Sip" part standing "Short Input PRF" -- is fast for shorter inputs.
In practice with the functions we're talking about replacing, there's
no need to hash 64-bytes. So, SipHash comes out faster and more
secure.

I also haven't begun to look focusedly at the assembly my SipHash
implemention is generating, which means there's still window for even
more performance improvements.

Jason


[1] https://git.zx2c4.com/linux-dev/tree/net/core/secure_seq.c?h=siphash-bench#n194

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

HalfSipHash Acceptable Usage "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-19 18:40 +0100
  Re: HalfSipHash Acceptable Usage "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-19 22:10 +0100
  Re: HalfSipHash Acceptable Usage Theodore Ts'o <tytso@mit.edu> - 2016-12-20 22:40 +0100
    Re: HalfSipHash Acceptable Usage "George Spelvin" <linux@sciencehorizons.net> - 2016-12-21 00:10 +0100
    Re: HalfSipHash Acceptable Usage Eric Dumazet <eric.dumazet@gmail.com> - 2016-12-21 01:00 +0100
      Re: HalfSipHash Acceptable Usage "George Spelvin" <linux@sciencehorizons.net> - 2016-12-21 04:30 +0100
        Re: HalfSipHash Acceptable Usage Eric Dumazet <eric.dumazet@gmail.com> - 2016-12-21 06:30 +0100
          Re: HalfSipHash Acceptable Usage "George Spelvin" <linux@sciencehorizons.net> - 2016-12-21 07:40 +0100
            Re: HalfSipHash Acceptable Usage "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-21 15:30 +0100
              Re: HalfSipHash Acceptable Usage "George Spelvin" <linux@sciencehorizons.net> - 2016-12-21 17:00 +0100
                Re: HalfSipHash Acceptable Usage "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-21 17:40 +0100
                Re: [kernel-hardening] Re: HalfSipHash Acceptable Usage Rik van Riel <riel@redhat.com> - 2016-12-21 17:50 +0100
                Re: HalfSipHash Acceptable Usage Linus Torvalds <torvalds@linux-foundation.org> - 2016-12-21 18:30 +0100
                Re: HalfSipHash Acceptable Usage "George Spelvin" <linux@sciencehorizons.net> - 2016-12-21 19:10 +0100
                Re: HalfSipHash Acceptable Usage Andy Lutomirski <luto@amacapital.net> - 2016-12-22 03:10 +0100
          Re: HalfSipHash Acceptable Usage "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-21 15:50 +0100
            Re: HalfSipHash Acceptable Usage Eric Dumazet <eric.dumazet@gmail.com> - 2016-12-21 17:00 +0100
              Re: HalfSipHash Acceptable Usage "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-21 17:40 +0100
              Re: [kernel-hardening] Re: HalfSipHash Acceptable Usage Rik van Riel <riel@redhat.com> - 2016-12-21 17:40 +0100
                Re: [kernel-hardening] Re: HalfSipHash Acceptable Usage Eric Dumazet <eric.dumazet@gmail.com> - 2016-12-21 18:10 +0100
              Re: HalfSipHash Acceptable Usage "George Spelvin" <linux@sciencehorizons.net> - 2016-12-21 19:40 +0100
                Re: HalfSipHash Acceptable Usage "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-21 19:50 +0100
                Re: HalfSipHash Acceptable Usage Theodore Ts'o <tytso@mit.edu> - 2016-12-21 23:30 +0100
                Re: HalfSipHash Acceptable Usage "George Spelvin" <linux@sciencehorizons.net> - 2016-12-22 01:20 +0100
                Re: HalfSipHash Acceptable Usage "George Spelvin" <linux@sciencehorizons.net> - 2016-12-22 02:20 +0100

csiph-web