Re: [Cfrg] Recommended bit length before truncating a hash mod p

Gilles Van Assche <gilles.vanassche@st.com> Fri, 22 March 2019 13:17 UTC

Return-Path: <gilles.vanassche@st.com>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 454F6127A73 for <cfrg@ietfa.amsl.com>; Fri, 22 Mar 2019 06:17:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.751
X-Spam-Level:
X-Spam-Status: No, score=-1.751 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, KHOP_DYNAMIC=0.85, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 53Y_EfJJBFkB for <cfrg@ietfa.amsl.com>; Fri, 22 Mar 2019 06:17:15 -0700 (PDT)
Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C2BB512796D for <cfrg@irtf.org>; Fri, 22 Mar 2019 06:17:14 -0700 (PDT)
Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2MDEnnJ016687 for <cfrg@irtf.org>; Fri, 22 Mar 2019 14:17:12 +0100
Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2r8q5bv1qk-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for <cfrg@irtf.org>; Fri, 22 Mar 2019 14:17:12 +0100
Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BA4813A for <cfrg@irtf.org>; Fri, 22 Mar 2019 13:17:10 +0000 (GMT)
Received: from Webmail-eu.st.com (sfhdag6node2.st.com [10.75.127.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0C7834EF0 for <cfrg@irtf.org>; Fri, 22 Mar 2019 13:17:10 +0000 (GMT)
Received: from [10.137.2.67] (10.75.127.45) by SFHDAG6NODE2.st.com (10.75.127.17) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 22 Mar 2019 14:17:09 +0100
To: cfrg@irtf.org
References: <mailman.3617.1553248218.6143.cfrg@irtf.org> <CALNOPK+SmbcVHz49D1ZUV8cdq81YEUn5Xrmn4kB3dftrV7Ygbg@mail.gmail.com> <CA+iU_qkh1qOyxm6j0gjy28wP4QMbX5GBmsPZ082etB7nCW2Kjg@mail.gmail.com>
From: Gilles Van Assche <gilles.vanassche@st.com>
Openpgp: preference=signencrypt
Autocrypt: addr=gilles.vanassche@st.com; keydata= xsDiBD8SkBwRBADFdM4ygHSMHFx6T5i2h1kJYurvDCbak3XS/+n6xLU6MXePU3PD6Onpuc9g 2lEFnVko+SrjK0+2VJOdwd5tDel1EkAVEwbB8mDNDaxyalhiLw7CQEgZVpFGgMOaFiUPUhYZ KwwkzKf9IDb5uG+DmUTSNBBBNohnhSDo9ZHxZejNPQCg/7Wg+vfKwyrniTAVOwmyzh86FgcD /RZrWc9oqkbwhJGiRtGZyZuARtDvWxwFs35UfbySbiBRrhHNezR+0XP2iI2bOSCNr2k2pP0r WA7UgQ1x/RQ+D9Abgd/P2fFSgaodKQ3MjPoKo8FS0yAMFt7crOaRQm/IuHauUXWfw4VyeXcG gKm1sMV9ApK0Xh0NLERJ9F5FtQRaA/42+3Np6IRPEqRAlyg1uAJzBa7QAXd1QTWxkzEImHvr w1Xdvo6OYNnOPe8XVoMjdY3BaZ/arKmeyScsEKczeWqNXuIPhCYo24sRw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+fowkwEGBECAAwF Aj8SkBwFGwwAAAAACgkQc/9XCxoSKFjvmgCfYxaz3jP35HUmtYu5DSH+fktMwuQAoMitXa0b 5wlXzvzHaXtqpPhetYjM
Message-ID: <7cf999fd-9074-f9b0-91c1-4eab09fbcef1@st.com>
Date: Fri, 22 Mar 2019 14:18:48 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1
MIME-Version: 1.0
In-Reply-To: <CA+iU_qkh1qOyxm6j0gjy28wP4QMbX5GBmsPZ082etB7nCW2Kjg@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Language: en-US
X-Originating-IP: [10.75.127.45]
X-ClientProxiedBy: SFHDAG3NODE1.st.com (10.75.127.7) To SFHDAG6NODE2.st.com (10.75.127.17)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-22_08:, , signatures=0
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/TDV9noQ9HD89My12CoshEaQnyu0>
Subject: Re: [Cfrg] Recommended bit length before truncating a hash mod p
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Mar 2019 13:17:16 -0000

Dear Markku,

> Some notes since this is a standardization forum:
>
> - It is generally not advisable to say "Keccak" when you mean SHA3.
> The padding mechanism was slightly changed from the "final competition
> round" Keccak 3.0 proposal to FIPS 202, making the two incompatible.

I agree with you on avoiding confusion between Keccak and SHA-3.

However, for the sake of completeness, I wanted to point out that the
padding scheme wasn't changed between the final-round proposal and the
FIPS 202 standard. As you know, the FIPS 202 functions are merely
appending a suffix to the input before calling the original final-round
proposal Keccak, for the purpose of domain separation between SHA-3 and
SHAKE.

> Some cryptocurrencies (e.g. Monero) actually use the obsolete
> pre-standardization version and talk of "Keccak" when they refer to it.

I wouldn't use qualifiers like pre- and post-standardization versions,
but instead say that SHA-3 and SHAKE are built on top of Keccak.
Alternatively, they are a subset of Keccak in the sense that only part
of its input space can be addressed through them.

> - FIPS 202 defines not only an actual SHA3-512 but also
> Extendable-Output Functions (XOFs) that allow hashes of any output
> size. The source code link provides a ExtendedKeccak(Hash) method
> which is a "doubly standard-violating" ad hoc construction, having
> nothing to do with the faster, standardized XOFs (SHAKE128 and SHAK256).

Indeed, referring back to the original discussion, having a XOF
interface would simplify the way some protocols are written. (I
deliberately wrote "XOF interface" to include both native XOFs and
traditional fixed-length hash functions with an MGF1-like mode. Of
course, I could only recommend to use native XOFs.)

Kind regards,
Gilles