From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93507C433E6 for ; Sun, 24 Jan 2021 14:39:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6051D22EBE for ; Sun, 24 Jan 2021 14:39:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726304AbhAXOjT (ORCPT ); Sun, 24 Jan 2021 09:39:19 -0500 Received: from mo4-p03-ob.smtp.rzone.de ([85.215.255.102]:9571 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726160AbhAXOjS (ORCPT ); Sun, 24 Jan 2021 09:39:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1611498974; s=strato-dkim-0002; d=chronox.de; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:From: Subject:Sender; bh=djudYJy4uCamF9BzVNn1GVJzDuSOcjWUTDquOv2MIAg=; b=sJK3VgK9gIIlDsEQaGs1M22T+lu7W4ec6DIucOL17q0b8MWOFcRtYDfv7mnzL/50sP oABJ2bCanz/1Ws4DZMqkzZqn0YqSw/0QIhkfVwEZQXGHeUvEOyxnzJZlu2HZYrKlXkDy YXw5rQHjD2plhMoPwxy4sLvMLdz+6B8qQiclc/Z74r/zHDOYpf3R9ahRe5/lLtvRT0DT 0Iq4iIY3i78J7hOwJhCVME5gU6fr+zqPqsyk/RHSVNrQ3uL9QynaUv/AJl1Sdxgv8aBj 0wUPu3uWlQ//U+EktRI5vseziNPEOhQdjgkOV89bp51727aDAUoO7WYjy8TxSXRwHdsU OZwg== X-RZG-AUTH: ":P2ERcEykfu11Y98lp/T7+hdri+uKZK8TKWEqNyiHySGSa9k9xmwdNnzGHXPZI/ScIzb9" X-RZG-CLASS-ID: mo00 Received: from positron.chronox.de by smtp.strato.de (RZmta 47.12.1 DYNA|AUTH) with ESMTPSA id Z04c46x0OEaDesY (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sun, 24 Jan 2021 15:36:13 +0100 (CET) From: Stephan =?ISO-8859-1?Q?M=FCller?= To: Ard Biesheuvel Cc: Herbert Xu , Eric Biggers , Jarkko Sakkinen , Mat Martineau , David Howells , Linux Crypto Mailing List , linux-fscrypt@vger.kernel.org, Linux Kernel Mailing List , keyrings@vger.kernel.org, simo@redhat.com Subject: Re: [PATCH v2 0/7] Add KDF implementations to crypto API Date: Sun, 24 Jan 2021 15:36:13 +0100 Message-ID: <3522419.MHq7AAxBmi@positron.chronox.de> In-Reply-To: References: <1772794.tdWV9SEqCh@positron.chronox.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Am Sonntag, 24. Januar 2021, 15:32:59 CET schrieb Ard Biesheuvel: Hi Ard, > On Sun, 24 Jan 2021 at 15:23, Ard Biesheuvel wrote: > > On Sun, 24 Jan 2021 at 15:10, Stephan M=FCller wr= ote: > > > Hi, > > >=20 > > > The key derviation functions are considered to be a cryptographic > > > operation. As cryptographic operations are provided via the kernel > > > crypto API, this patch set consolidates the KDF implementations into = the > > > crypto API. > > >=20 > > > The KDF implementations are provided as service functions. Yet, the > > > interface to the two provided KDFs are identical with the goal to all= ow > > > them to be transformed into a crypto API template eventually. > >=20 > > Why? There are typically two reasons to use the crypto API abstractions: > > - the algorithm is not known at compile time, so we need the runtime > > dispatch that the crypto API implements, > > - the algorithm may be implemented by a h/w accelerator which is > > discovered at runtime via the driver stack > >=20 > > In other cases, a library API is much more suitable, even in the case > > where we may provide arch-specific accelerated implementations of such > > an algorithm. >=20 > Hmm, apologies if I got the wrong end of the stick here - this prose > and the naming of some of the crypto_hkdf_xxx routines and function > pointers in the test code made me think that this is more than it > actually is. >=20 > What we are talking about are basically library wrappers around shash > instances to perform HKDF, right? Sorry, our emails just crossed each other. Yes, you are absolutely correct. The KDF implementations are wrappers aroun= d=20 the SHASH API. Conceptually the provided API is what templates actually sho= uld=20 do. As mentioned in the other email, however, adding a template was and is not= =20 considered appropriate at the time. Yet, I would like to keep the path open= to=20 transform the KDF implementations into a template. Ciao Stephan