Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp163470ybi; Fri, 24 May 2019 01:47:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTUZFNGnhB2FXPXXFJ51jcOEHIS9Z09NA93y1ZQPQ1ZkJIfKQdoD1ZJvh59bGWaMB0t3ph X-Received: by 2002:a63:2bd1:: with SMTP id r200mr41205881pgr.202.1558687640874; Fri, 24 May 2019 01:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558687640; cv=none; d=google.com; s=arc-20160816; b=0BHwjtgpaUQDNSKYaIz6lXAjBy1KzkyHkkxk9Z8aXyz2LSwC13pS5ReKvMNHXV08C6 h7/+JWjgbGuutVt5uM1IoAcNeYR8wajfR8q+GzySogxIeLTaa3Udu/hwSTIeV9g4Y/g4 5m0vVvoDczHEEUb9OOROtLzDMY23im6zNjTot0Pi2Vthy0KyH7wlXRkFakPqK7iNyMA4 yA7Hzs/kgYbTrV2Iig0H4vl+miky9ksTMvjsFxlJ8TppTFshcgThe39B6iZr7550oZRu D7I6UB4ongaPY7WWg2+OyiBtbwjLCQJ/2T6THAnRpiwiW5XMVo2nelA2LGj6nIsE+DB7 26eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Yxsu2RbH+V8qQpRufmIec3nFlM1bh8+oq2gRQyNLWzk=; b=Vpsa4TY+sH6aUmyXdH4j4VqC0p7ezcFnT2jbRtzJAmLWPvvI2hI9Mot7B6YqnPVWav qFx2oXwdHfND+zgJ/IM3b4mil2e0ULo9Y6fEDiRrUc5LB/TcaeAhHL/SaNDPO0H5pVmh Y13Mhl2ZgyYncwnUl6pcCDCbmg2gou/4L/GTtfA7rmXqezb9EMxGr/kkLes6nYTLHKHd rArrPkd37bmyorFoDwTDozUT6UrUc0IfLqtM6itVduNasBYvIS2AGNXd/BZr3ayOo/Lv AGBcXn6eB+0mVFWcKcdTW+PR9IylG8hsvnPjv7/O2+XrFSR0tHIUNnLeNHfEB3RV0Bm1 fMWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=Ky102oXG; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20si2737697pfh.238.2019.05.24.01.47.03; Fri, 24 May 2019 01:47:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=Ky102oXG; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389349AbfEXIqj (ORCPT + 99 others); Fri, 24 May 2019 04:46:39 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:57912 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389341AbfEXIqj (ORCPT ); Fri, 24 May 2019 04:46:39 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 459KjS3cTcz9v2n8; Fri, 24 May 2019 10:46:36 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=Ky102oXG; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id Asa4_l_WQ9QK; Fri, 24 May 2019 10:46:36 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 459KjS2bBNz9v2mv; Fri, 24 May 2019 10:46:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1558687596; bh=Yxsu2RbH+V8qQpRufmIec3nFlM1bh8+oq2gRQyNLWzk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Ky102oXGkptwyX0mviv9p61sazNJy0gqUBgcx6HwlefiqiuPw5MNbllSTxn2SFC7S L0wWhPaZGza+S1ZJI1Gr3+Ldhesl+IbZMqE8RZaAmB5J/cY1cu5DaMT9K/CwJ9ErTN pIupsHLYxGXZ26VeNt19ThEfdbQJKCzrOv7PuHL8= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6B9708B7A3; Fri, 24 May 2019 10:46:37 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 3AoDaHpRNUmx; Fri, 24 May 2019 10:46:37 +0200 (CEST) Received: from PO15451 (po15451.idsi0.si.c-s.fr [172.25.231.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 44AF68B79E; Fri, 24 May 2019 10:46:37 +0200 (CEST) Subject: Re: another testmgr question To: Pascal Van Leeuwen , Eric Biggers Cc: "linux-crypto@vger.kernel.org" References: <20190523185833.GA243994@google.com> <20190523200557.GA248378@gmail.com> <20190523234853.GC248378@gmail.com> From: Christophe Leroy Message-ID: <907eb6a5-dc76-d5ee-eccf-e7bd426a0868@c-s.fr> Date: Fri, 24 May 2019 10:46:37 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Le 24/05/2019 à 10:44, Pascal Van Leeuwen a écrit : >>> Valid? A totally fabricated case, if you ask me. Yes, you could do that, >>> but is it *useful* at all? Really? >>> No, it's not because a file of length 0 is a file of length 0, the length >>> in itself is sufficient guarantee of its contents. The hash does not add >>> *anything* in this case. It's a constant anyway, the same value for *any* >>> zero-length file. It doesn't tell you anything you didn't already know. >>> IMHO the tool should just return a message stating "hashing an empty file >>> does not make any sense at all ...". >>> >> >> Of course it's useful. It means that *every* possible file has a SHA-256 >> digest. So if you're validating a file, you just check the SHA-256 digest; >> or >> if you're creating a manifest, you just hash the file and list the SHA-256 >> digest. Making everyone handle empty files specially would be insane. >> > As I already mentioned in another thread somewhere, this morning in the > shower I realised that this may be useful if you have no expectation of > the length itself. But it's still a pretty specific use case which was > never considered for our hardware. And our HW doesn't seem to be alone in > this. > Does shaXXXsum or md5sum use the kernel crypto API though? The ones from libkcapi do (http://www.chronox.de/libkcapi.html) Christophe