Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp15882523rwd; Mon, 26 Jun 2023 02:40:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4CPQWp0mqrQAjLwZ+JeZWvUCwG9dLp5dhPm5bElMOOF0rpSpMXc67n6V1CXrpmqadOnOiY X-Received: by 2002:a05:6402:35c3:b0:51d:9a92:24f0 with SMTP id z3-20020a05640235c300b0051d9a9224f0mr2048242edc.4.1687772418093; Mon, 26 Jun 2023 02:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687772418; cv=none; d=google.com; s=arc-20160816; b=Td94yZUy+lq1e6pMGSgMbI9rhxwFyMs/ORKpEkZF+yOz9my4PgP26EAkv4GvSNFjyw LhIof77oAQqyA7BXuK9Lk3wo3ArxPrrzuqG3RIFyacmRJb72xkEnTKhT5Os84tyKwa9Z lrZdWSai2dlciHOqyTY1SZhYyUKMZI//7mY8fWQtdrndU+NLA/ve42YDh18M8jQpzpZj yiatabmkpD9rSh+oKCobdBAn/a6h6LGM/iWDaNmjD34VPGsiO5VsPhGxc2TjzyZVIOi6 qgLeVCrj0d9P7wyYuVoADDLeWT5ZD3t+wBpXR9vi9BxBVF+Gslw9GF0scBWoQeUIhLKt xjBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5kcNJdyng26Ws2hvU1ekxcz5wPdd6qPIpkxxqOvgOAs=; fh=NZu7qcTHiYAaQeg2cNKTwjHSg8/kv0EFuc3L8EIY9+g=; b=VOV/k0zudwz6FFO62zmaRhWs3WatigEZlJBmyBX2kEiZ9chX0ZH32PLSxbJ2UnHflm Gl3AS4YBQdvD4asgC5sU48kxpLOcf7nQxufjvsMkjHXZRbtj279QOklyMge3Z/Bc6ady QBrxnoMsf3YiTVcEhRLMkYMm5B6RFoaIXXQGOuUjSZdEuU8M6sydKdRcLJlQnlpfUYy4 Ztojlbd+2qCquKT6eu0H5qy5MRIlHMaKTvAvg0aLE1bQU3MziA/OHHHnliTMAHPoUHgF 2Rel+eduZ2AmRaPSZ1jR+F/4r0caAvA+WMjvXNEYtbpPaUJSRopskHRgfWQ9bDBo0GEM +KfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mzTX390l; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m18-20020aa7c2d2000000b0051bf45b26b4si2457082edp.326.2023.06.26.02.39.51; Mon, 26 Jun 2023 02:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@kernel.org header.s=k20201202 header.b=mzTX390l; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229946AbjFZJYp (ORCPT + 99 others); Mon, 26 Jun 2023 05:24:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbjFZJYE (ORCPT ); Mon, 26 Jun 2023 05:24:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B03314202; Mon, 26 Jun 2023 02:21:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A324A60DBD; Mon, 26 Jun 2023 09:21:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DF80C43391; Mon, 26 Jun 2023 09:21:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687771294; bh=+nEnClHLi5syrDJOAErMhcML5ks4Z+HxTWODSfJO4SE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mzTX390ltb01R0YtE44Eb1ZBb87LDjlicG2FkBE+ZWBpYphVP8JC+htTowMFnlxoq ttMrMTLLf7WKczewBVMSSOm0uhXYGOcKQhCq63dNwDILkWjqrIjJJp7IvBozf4wcFC lTxoOTV2vucODx1UGgD+qnJc23bzwLVr/6uSr9/RETO8IBr8cI0aEmz4bMMhlP6oAj val6Ms4+XvUVMHeLTrcZSKrx2Sp249rSA90YbaAS+NhSUFXZeWasnboULwtaLO9aed kKAMGWiH+wP1C0m1imA8B0GBUByedKL8joPtJp3ozZ11M+keM7TrfCPZqRsaISMU0m HYor0LB41shlA== Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-4f973035d60so3583766e87.3; Mon, 26 Jun 2023 02:21:33 -0700 (PDT) X-Gm-Message-State: AC+VfDywcJQvq6xZo3jZxX9nYrMpFMSbRGW8iYYZIE9qdhLpdbafZ0MB IuLIozncTRLoOlEet3UwRbGR83/KVoszZYZrjNw= X-Received: by 2002:a05:6512:20cf:b0:4fb:774f:9a84 with SMTP id u15-20020a05651220cf00b004fb774f9a84mr631299lfr.13.1687771291975; Mon, 26 Jun 2023 02:21:31 -0700 (PDT) MIME-Version: 1.0 References: <570802.1686660808@warthog.procyon.org.uk> In-Reply-To: From: Ard Biesheuvel Date: Mon, 26 Jun 2023 11:21:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [v2 PATCH 0/5] crypto: Add akcipher interface without SGs To: Herbert Xu Cc: David Howells , Linus Torvalds , Roberto Sassu , Eric Biggers , Stefan Berger , Mimi Zohar , dmitry.kasatkin@gmail.com, Jarkko Sakkinen , keyrings@vger.kernel.org, Linux Crypto Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-crypto@vger.kernel.org On Thu, 15 Jun 2023 at 12:26, Herbert Xu wrote: > > v2 changes: > > - Rename dsa to sig. > - Add braces around else clause. > > The crypto akcipher interface has exactly one user, the keyring > subsystem. That user only deals with kernel pointers, not SG lists. > Therefore the use of SG lists in the akcipher interface is > completely pointless. > > As there is only one user, changing it isn't that hard. This > patch series is a first step in that direction. It introduces > a new interface for encryption and decryption without SG lists: > > int crypto_akcipher_sync_encrypt(struct crypto_akcipher *tfm, > const void *src, unsigned int slen, > void *dst, unsigned int dlen); > > int crypto_akcipher_sync_decrypt(struct crypto_akcipher *tfm, > const void *src, unsigned int slen, > void *dst, unsigned int dlen); > > I've decided to split out signing and verification because most > (all but one) of our signature algorithms do not support encryption > or decryption. These can now be accessed through the sig interface: > > int crypto_sig_sign(struct crypto_sig *tfm, > const void *src, unsigned int slen, > void *dst, unsigned int dlen); > > int crypto_sig_verify(struct crypto_sig *tfm, > const void *src, unsigned int slen, > const void *digest, unsigned int dlen); > > The keyring system has been converted to this interface. > This looks like a worthwhile improvement to me. As I asked before, could we do the same for the acomp API? The only existing user blocks on the completion, and the vast majority of implementations is software only.