Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp884944rwd; Thu, 15 Jun 2023 03:32:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4kpHGlUOwd08Egjmd+Sj5mNSPMGp2RBfZrRuGoV+MB9IDOxi0OVv/6MmN/HHmlF+GN94cS X-Received: by 2002:a17:902:da8b:b0:1b0:3d54:358f with SMTP id j11-20020a170902da8b00b001b03d54358fmr20266895plx.0.1686825156525; Thu, 15 Jun 2023 03:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686825156; cv=none; d=google.com; s=arc-20160816; b=tAaHBG/el2DiJz+1kPUAo9nQCiQ8AXbJ8A1Y2eJpusPpjKmHfRzI67Vm4P+LWIwL7x Ao4942PE0vaOjuU7AM3UHm+YBdjaLtFGZVTqpkebg6GcXPJc/eiJK/ov/99TSmEFybpz k7J+r5yNqridxFhx7egEeto0TXGQFE7J9L4zQE5a0+FIlman9doA/XUYp0rvoYdhDXL2 odPUSyFcy3j/ACWpX4tWaCbYyZo4SXMs5SLihQ8+0axCpXqyYXZpbeqWGSzRB+e/Z1IW Ga56i5Clr03HIMTEomimWng19ovcAlQ0ConF141MLuMEYlJHND3lApSPNDWwwu4UsmcF DN0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=CuwzC6EAuba6Q0UySaoupoBS87dQ2jqiivvg1ZYK1Fc=; b=ZVm05H4zTuIhQjXPVFEwCARw4j9KfeGewfL4BTM3oTJjKWxh9Mk/kND59aes2PGAF3 Hsh8IrIYzqOS32TiVgwtIQFl2tFIpunKs3tY3GFPXl1E5BqbeT3ARvCaQ/+CYgWGg1jj BH76fbricah/1TzTdw/ysz/+HH74DM28RQS/wH09NOcfkMC//IyZTO4JQG6pmd7QZQY7 ZNI/2UxNoG45936NvKATi0iX8VN/BzwV+XBE09QEY+uSY0mxSMU0tL90/2VDbC5vsSnG bfq9BpmJvfzfcg6g8lFmj7CiH7rq5m6UdSSWC3X5A2Yp/521JODsBGFLrLqiqAEDDXCM GqcA== 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 s4-20020a170902ea0400b001afe7fcb257si8910886plg.64.2023.06.15.03.32.17; Thu, 15 Jun 2023 03:32:36 -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 S241250AbjFOK0a (ORCPT + 99 others); Thu, 15 Jun 2023 06:26:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240481AbjFOK03 (ORCPT ); Thu, 15 Jun 2023 06:26:29 -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 9E70C123; Thu, 15 Jun 2023 03:26:26 -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 1q9kB4-003Hle-09; Thu, 15 Jun 2023 18:26:07 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Thu, 15 Jun 2023 18:26:05 +0800 Date: Thu, 15 Jun 2023 18:26:05 +0800 From: Herbert Xu To: David Howells Cc: Linus Torvalds , Roberto Sassu , Eric Biggers , Stefan Berger , Mimi Zohar , dmitry.kasatkin@gmail.com, Jarkko Sakkinen , Ard Biesheuvel , keyrings@vger.kernel.org, Linux Crypto Mailing List Subject: [v2 PATCH 0/5] crypto: Add akcipher interface without SGs Message-ID: References: <570802.1686660808@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <570802.1686660808@warthog.procyon.org.uk> 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 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 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. 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