Re: [babel] Blake2S, blake2B or neither? [was: rather than ripemd160...]

Markus Stenberg <> Fri, 30 November 2018 13:39 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id E71E11200B3 for <>; Fri, 30 Nov 2018 05:39:47 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id qhDFQzPTc2B0 for <>; Fri, 30 Nov 2018 05:39:45 -0800 (PST)
Received: from ( [IPv6:2001:67c:1be8::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 25CF3123FFD for <>; Fri, 30 Nov 2018 05:39:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;; s=20161220; h=To:References:Message-Id:Content-Transfer-Encoding:Cc:Date: In-Reply-To:From:Subject:Mime-Version:Content-Type:Sender:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=NTpvfRipsk7kDtMEYcsXrNb40Grq744V3S4wiTgK72g=; b=nYxG8aRDWaEzG13R/w0yI4p6El wdOMlTgaW4647HuGdPp/fx3eIBxjeTpQNhY47c4UQ798YgFwpdO4OOTG1aFSmY4aB2B8TigzSg6+Z lQkKw7/SV778ZIjb2YBzbxnpvOsDO1BHb1ISptZSH8N3zSDrG1fIsJ3kWM4qRrOf9drNdTw8KNhLq CSYzblAK2HRyn/vINlgkQD2iej/QmFV6MIRcrAN1iQzv+N/4eX960/ZmVwHDMapoftHXvP8+uLSL9 slM7VvP2Ezd8xkZQjm1p1it6H1BAiDSGSWQ0HXmyRGmrAegG0Aq7aGVFoOznuOOBsLFi6viYJbIgz 1uvcVvMA==;
Received: from ([] helo=yuri.lan) by with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <>) id 1gSj18-0006Ob-Va; Fri, 30 Nov 2018 15:39:39 +0200
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\))
From: Markus Stenberg <>
In-Reply-To: <>
Date: Fri, 30 Nov 2018 15:39:38 +0200
Cc: =?utf-8?Q?Toke_H=C3=B8iland-J=C3=B8rgensen?= <>, =?utf-8?Q?Dave_T=C3=A4ht?= <>, Babel at IETF <>, babel-users <>
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <> <> <> <> <> <> <> <> <> <> <> <> <> <> <>
To: Juliusz Chroboczek <>
X-Mailer: Apple Mail (2.3445.101.1)
X-SA-Exim-Scanned: No (on; SAEximRunCond expanded to false
Archived-At: <>
Subject: Re: [babel] Blake2S, blake2B or neither? [was: rather than ripemd160...]
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "A list for discussion of the Babel Routing Protocol." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 30 Nov 2018 13:39:48 -0000

> On 30 Nov 2018, at 13.23, Juliusz Chroboczek <> wrote:
>>> With these numbers, I withdraw my support of including anything else
>>> than SHA256 as MTI. I think specifying Blake2B or 2S as well makes
>>> sense (mostly for crypto robustness reasons for having alternative
>>> that is specified) but making it MAY-SHOULD seems sensible to me.
>> I can probably live with that :)
> Excellent, it looks like we're converging.  Thanks to both of you for the
> informative and kind discussion.
> At this stage, I see four possibilities:
>  (1) leave the document as it is;
>  (2) add a mention that implementation of Blake2S is RECOMMENDED (SHOULD);
>  (3) add a mention that implementation of Blake2B is RECOMMENDED;
>  (4) add a mention that implementation of both 2B and 2S is RECOMMENDED.
> I am in favour of (1), since I am convinced that SHA256 is fast enough for
> all reasonable devices.  (2) makes sense to me, and I won't oppose it.
> I'll need some convincing in order to do (3) or (4), since Blake2B does
> not appear bring any significant speed advantage over SHA256.
> In either case, I'm planning to implement SHA256, Blake2B and Blake2S in
> the reference implementation.

I do not actually recommend 2B based on the numbers. By looking at them, you notice that the setup time for 2B is higher and even on 64bit platform the gain is not insane even on large operations (25%ish, perhaps). -2BP is what I have and will recommend for large bulk hashing (-P variant allows for paralllelization of hashing to multiple cores), but for smaller stuff it seems Blake2S is faster on both 32 and 64bit.

As they are all based on same cryptographic base, it is likely that if weakness is found in one, it is present in others. That said, as BLAKE algorithm was at the time of SHA-3 contest analyzed to be strictly superior to SHA-2 in some features, it seems unlikely. But you never know.

The above discussion cuts out options 3 and 4 for me.

I am mostly indifferent between 1 and 2; SHA256 (especially with hardware acceleration) is probably faster than Blake (even with just Intel optimized assembler it is 60-70% of Blake 2B), and if we’re talking millions of pps (acceleration present) it is entirely academic anyway for a routing protocol. The tinfoil hat argument for 2 is that it provides fallback if SHA256 breaks down somehow in the future. So I have SLIGHT preference for 2 but am happy enough with 1 as well.