Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp956134rwd; Tue, 13 Jun 2023 02:45:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ECA/o3LegRAuqXvHWMlFLodW+P6LMsTifdfTz2gfakGS+zVVaJmC8ygIgV/fs/NR5xG8o X-Received: by 2002:a05:6402:524e:b0:502:465:28e0 with SMTP id t14-20020a056402524e00b00502046528e0mr9217654edd.0.1686649555491; Tue, 13 Jun 2023 02:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686649555; cv=none; d=google.com; s=arc-20160816; b=jNvoN8gyh+xg3wW33+Ip6dAodEEJ+ByMFrZuU3oBjYhzV/75cS/X22naYjfeJfjeF1 QT/dVxfVcKhxCVMcqTE80MDbK9+k6raqPKeCufTOGVGr8jsWCTvJurZKcfOBshDnA86w eOJuy5EEIQ5wADuhO1RxpxNfHQnuRV8RrTyB4UMSU9kF6nTvVWXVSWVks8CyMdbpOMMM jDjDr3dHsxyLWe/IOe0uGUijAdJFxpW+EBGm8GSwqbsAci0Y839fGrDvbzkyfh9XTajc DsPfNfTIYrw3N5C9oyEZLzPmPY/qFubcEkFbfiGBH51wljLnlFu0MhEgSAP4PmKKWJ28 JiAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date; bh=1beMZ5b3Bd7cAsyopT3KJPFOAP5NqPNp4dnDtplhchg=; b=p+iLL9lPv8NiPE6gNfFagR9s+yM9Rlj8MXqLWEx7xgykkfpQ71CAZVY9u6L29mViXf 5hbMJKcGyAIE1Mm8gshP/8rIx0Oe7HfkR1gUlXk8yNjoU2QEYDzbxwNDnylIcBxY+Ocb Vax/Ve6pGcdXUKWQhOtgHZ05lkN3vxtEIJb26Ihfijd191RLkW2UM6Kdbcwo8ZVQyQHy vmrAHcIpDk8RO5UaJRyDBVyffAyH3LQmT4Jy9LE3fDPuoDbsmB9tsGH7Erd+4iOLqDIA NszaoWrhs3lBj3MvczkBRRJkMcmuhVgA5/AX3Xhl60cIpVZCNLwOSQ2WVU5aICtaQWYK 3dFA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r8-20020aa7d148000000b00514a6a6fad0si7749839edo.311.2023.06.13.02.45.24; Tue, 13 Jun 2023 02:45:55 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241203AbjFMJg2 (ORCPT + 99 others); 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-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=2.7 required=5.0 tests=BAYES_00,HELO_DYNAMIC_IPADDR2, PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,TVD_RCVD_IP, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** 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 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, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt