Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3795017pxb; Mon, 21 Feb 2022 06:00:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDzfo08u30Gef3EQFdsmQt6GFgXWOfeKlfTkDMSm6DGQsVNou1qYhjfMvrMKshH8kAegnA X-Received: by 2002:a63:5525:0:b0:372:c376:74f1 with SMTP id j37-20020a635525000000b00372c37674f1mr16108541pgb.433.1645452001600; Mon, 21 Feb 2022 06:00:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645452001; cv=none; d=google.com; s=arc-20160816; b=zCNmm6WZS4aJgAIugxx+h2Q2FC3/P4hMGXWgP6CnHDDwHiEFEPkFlgsN1dX/HixAfb 0Eccs6PXmXaD/9ZnCQQlfSvJiAN52RFFKJh2j39679Je0rQd25Ycd9tFQL/hIsM+cnpw 5ja5O8BFw2gluggZO+CgBbJAPYQRsHGjO3M7NnjXpPLq7oGbKWqxaGUaJo3ZmG/9zgQq rGYLWwulcyoVzPvJKY1sEgt41i8gQcA5cxvUCUtFSyRBN7XLGmAosQMqiVpRi/trxBcI 1qYGL8f59lJfF9uUDZ+HzJCDRvj52VZGlXCtQu2mOLMzyPrVKOQ+urQDkxrWJczKnA84 b9sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=qx0Q18ljVcrXhWvAQ6cUSrAVYJIdsXr8hIUlUK/8QpM=; b=CHL7k06CbVGWLjMiL4h+mZcolmNi14BUc4vrdki20ilcIk4IVPgqI9mtuqwKn3dp5f jLDk/f0J7c1oUCzE3gL/DiU7+FURFaqFqQHmwfmKyj0+43jIugyBOi4HBxB67EdxQDTC 7o5rgZTfhzd4vQsZhX50a0BGBK3DXUQIj8P6W+zMA8YRSLuZpfGd3CuKPg+kgDQa7gNQ ORBBKy2BaIEB75UbbJnxAUjDZ96uvD/+unUXdCzcRFYLQc0g3wq5Q9Oos6b1edu96M5n HqH5sb9jEOTwtG42PF1AUib/Ikx5eQhRLijacKJgxpUZHUpI4t1QFIrI6fqavfcOSa8L eJPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Cqj3DkYx; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p5si29205403pls.250.2022.02.21.05.59.46; Mon, 21 Feb 2022 06:00:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Cqj3DkYx; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358846AbiBUNTE (ORCPT + 99 others); Mon, 21 Feb 2022 08:19:04 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358840AbiBUNTB (ORCPT ); Mon, 21 Feb 2022 08:19:01 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8071B1EEDA; Mon, 21 Feb 2022 05:18:38 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3EA76210F0; Mon, 21 Feb 2022 13:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1645449517; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qx0Q18ljVcrXhWvAQ6cUSrAVYJIdsXr8hIUlUK/8QpM=; b=Cqj3DkYxCZV9tKvMhc20KpHen50b9YvAxjUyjNAy5j3Xvz2X6M0bSDZR+S3amBXFlcd7E4 GyiTc/uusdBsKhLqAoKvJRO3wfHJj0bubdlDIchD/mMCW6ZPJMlJ/ltShHLGbV4Wa1/4JU n5b02J35yPJl5V5IYGUmr/t7NQ9B6+A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1645449517; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qx0Q18ljVcrXhWvAQ6cUSrAVYJIdsXr8hIUlUK/8QpM=; b=LofZw7M41jMg5B5ffe5yCkle/xS/uTOv0SumivGAz0qPUIAYkZOprL+M7W3Dd6TBDjORLq bvgQ+L7Wq+Q15pAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0F39B13AF2; Mon, 21 Feb 2022 13:18:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sKQ3Ai2RE2K2fwAAMHmgww (envelope-from ); Mon, 21 Feb 2022 13:18:37 +0000 Message-ID: <9bfe807a-d14e-feea-6fcd-b1526da16ff5@suse.de> Date: Mon, 21 Feb 2022 14:18:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v4 01/15] crypto: kpp - provide support for KPP template instances Content-Language: en-US To: Nicolai Stange , Herbert Xu , "David S. Miller" Cc: =?UTF-8?Q?Stephan_M=c3=bcller?= , Torsten Duwe , David Howells , Jarkko Sakkinen , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, keyrings@vger.kernel.org References: <20220221121101.1615-1-nstange@suse.de> <20220221121101.1615-2-nstange@suse.de> From: Hannes Reinecke In-Reply-To: <20220221121101.1615-2-nstange@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/21/22 13:10, Nicolai Stange wrote: > The upcoming support for the RFC 7919 ffdhe group parameters will be > made available in the form of templates like "ffdhe2048(dh)", > "ffdhe3072(dh)" and so on. Template instantiations thereof would wrap the > inner "dh" kpp_alg and also provide kpp_alg services to the outside again. > Furthermore, it might be perhaps be desirable to provide KDF templates in > the future, which would similarly wrap an inner kpp_alg and present > themselves to the outside as another kpp_alg, transforming the shared > secret on its way out. > > Introduce the bits needed for supporting KPP template instances. Everything > related to inner kpp_alg spawns potentially being held by such template > instances will be deferred to a subsequent patch in order to facilitate > review. > > Define struct struct kpp_instance in close analogy to the already existing > skcipher_instance, shash_instance and alike, but wrapping a struct kpp_alg. > Implement the new kpp_register_instance() template instance registration > primitive. Provide some helper functions for > - going back and forth between a generic struct crypto_instance and the new > struct kpp_instance, > - obtaining the instantiating kpp_instance from a crypto_kpp transform and > - for accessing a given kpp_instance's implementation specific context > data. > > Annotate everything with proper kernel-doc comments, even though > include/crypto/internal/kpp.h is not considered for the generated docs. > > Signed-off-by: Nicolai Stange > --- > crypto/kpp.c | 20 +++++++++ > include/crypto/internal/kpp.h | 83 +++++++++++++++++++++++++++++++++++ > 2 files changed, 103 insertions(+) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer