From patchwork Tue Jun 13 09:35:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 13278184 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C79EC77B7A for ; Tue, 13 Jun 2023 09:36:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241203AbjFMJg2 (ORCPT ); Tue, 13 Jun 2023 05:36:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241756AbjFMJgS (ORCPT ); Tue, 13 Jun 2023 05:36:18 -0400 Received: from 167-179-156-38.a7b39c.syd.nbn.aussiebb.net (167-179-156-38.a7b39c.syd.nbn.aussiebb.net [167.179.156.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 075691BD3; Tue, 13 Jun 2023 02:36:03 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1q90RD-002LN1-Ro; Tue, 13 Jun 2023 17:35:44 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 13 Jun 2023 17:35:43 +0800 Date: Tue, 13 Jun 2023 17:35:43 +0800 From: Herbert Xu To: Linus Torvalds , Roberto Sassu , David Howells , Eric Biggers , Stefan Berger , Mimi Zohar , dmitry.kasatkin@gmail.com, Jarkko Sakkinen , Ard Biesheuvel , keyrings@vger.kernel.org, Linux Crypto Mailing List Subject: [PATCH 0/5] crypto: Add akcipher interface without SGs Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 dsa interface: int crypto_dsa_sign(struct crypto_dsa *tfm, const void *src, unsigned int slen, void *dst, unsigned int dlen); int crypto_dsa_verify(struct crypto_dsa *tfm, const void *src, unsigned int slen, const void *digest, unsigned int dlen); The keyring system has been converted to this interface. The next step would be to convert the code within the Crypto API so that SG lists are not used at all on the software path. This would eliminate the unnecessary copying that currently happens. Thanks,