Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3785711rdb; Thu, 14 Sep 2023 02:31:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8crhnLQSXIBwuFbd0C56bGoKXHJW3Sm3R8lMxikh3SA8GcoBmYRqQBr+zlP2cVz4rJph7 X-Received: by 2002:a05:6870:1482:b0:1bb:a891:47fc with SMTP id k2-20020a056870148200b001bba89147fcmr5852344oab.8.1694683892162; Thu, 14 Sep 2023 02:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694683892; cv=none; d=google.com; s=arc-20160816; b=BfKZ/x1GmAP98Het7rVEt7wTDFVaO7eT1QvV3Qz7O8sQ7YVTQmc8Ewn5LrUwwF0S7j LDHwLKfrjROHp8T1vpFEP22NpW4llnajBZol1tyrsJ1pxu0dLL4fH9NXfeff3w//RrkS GpZbxZYxOSt0I59ZT9SJfyeDQ8plGPBKkriXVBPNWUih9SH1v8P4prHr5f3K7+OaMfcf IsdDkhOWgG7yom317ck/yj0bZLo4nP+idjoQRAdgjZXT8ftsg8hZOxWpayTjvKBi3ziB KVtAfP/gLqmrW7aw9TCr9OxMs1IG4qryC2Fp1hi7msf7/UOojwUNMmiQAb/KPmVYMGCz +Hgw== 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=5HGRYG/jZc3okfO6+RkTRGaO7QqGPLRRdNYfi6Smz/I=; fh=OUpgHz8gu+EFyREjScBnwgXxe9p5hHef04jJGlkpTWE=; b=P7jldxRX+ONw/5a2KQL4rWRRkVbRNiF8/ptDCIuNjBpZQ2bzVEapcG5MZnG399Niw0 JVOCuNyHP3/8oW2bFz+Iskpbqg8g+DGt6FrO+mIray2xOSsgm9G85jJyrehk09cMw/Z3 W34zh3vrtkIYY/r+cPHnx0fxQ4hkSCHvHygkaPn7ToUW9rydaUYsjHOV7tRbqKbA9xQv fasjkCAFsA/HYScN9DIQaf6sLJmuHAWqcWJLxMbbkYoPZ9WzUUwt9I3/8bWsZlDHYBkd RIglN4omP/FM40Rdo1tOM9w3dD2RoUYf3C1NeK2TSc3E9W45tWNYHhJCbykkgvwLGX+D 9Gdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VvtSjmX3; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id g13-20020a65594d000000b0057759a5b7c6si1173591pgu.62.2023.09.14.02.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 02:31:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VvtSjmX3; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id DE19380202E7; Thu, 14 Sep 2023 02:18:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231925AbjINJSS (ORCPT + 99 others); Thu, 14 Sep 2023 05:18:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230515AbjINJSR (ORCPT ); Thu, 14 Sep 2023 05:18:17 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6412D9E for ; Thu, 14 Sep 2023 02:18:13 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 067C1C433C8 for ; Thu, 14 Sep 2023 09:18:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694683093; bh=vEkCdkTgriwJjDyyvjt+W9IgitpS32SWKcTtoyv/NC8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VvtSjmX3Xs+rXl0jien8983nDAfpfg//3UhDz1X85WcPAm1jvH1J6S9h9p3Ai8/ML R2oKbVq9G+cAlXLyll2ZaFUy+rESxqr/tq3ukwJBFuqW5OhqzEvKlscOiEMyCplxhr Ldz+MBt5/gkD78y4tav2RzKvct5uuFIx3VNRXicpRgsKUgS+9OdcmWpwkakKzM6/e6 ogdyDz5W3qXZmqKIZTiI2Md7lNoLl3dJXOF/nR0RDW8SvhsOI+sb/5u2+OTah1EX/I Vd9CZNNZqxeDkRfBN0QaaabzlS+MlSP2FyQmFm9mavgIB4U2KnCnNl8qWPuGJT5CBa jI89Q348lt8HA== Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2b962c226ceso10572931fa.3 for ; Thu, 14 Sep 2023 02:18:12 -0700 (PDT) X-Gm-Message-State: AOJu0YyzDGMMESRWn2pVg0klM+/ZgdoqIEDAA3KbUh35SDm/OoREPkDA UUdI5u9Fg+BwFN0M+INBLdKATKEAxKjqzXDCkv0= X-Received: by 2002:a2e:910d:0:b0:2bc:bc70:263f with SMTP id m13-20020a2e910d000000b002bcbc70263fmr4339963ljg.0.1694683091129; Thu, 14 Sep 2023 02:18:11 -0700 (PDT) MIME-Version: 1.0 References: <20230914082828.895403-1-herbert@gondor.apana.org.au> In-Reply-To: From: Ard Biesheuvel Date: Thu, 14 Sep 2023 11:18:00 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/8] crypto: Add lskcipher API type To: Herbert Xu Cc: Linux Crypto Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 14 Sep 2023 02:18:19 -0700 (PDT) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email On Thu, 14 Sept 2023 at 10:56, Herbert Xu wrote: > > On Thu, Sep 14, 2023 at 10:51:21AM +0200, Ard Biesheuvel wrote: > > > > So the intent is for lskcipher to ultimately supplant the current > > cipher entirely, right? And lskcipher can be used directly by clients > > of the crypto API, in which case kernel VAs may be used directly, but > > no async support is available, while skcipher API clients will gain > > access to lskciphers via a generic wrapper (if needed?) > > > > That makes sense but it would help to spell this out. > > Yes that's the idea. It is pretty much exactly the same as how > shash and ahash are handled and used. > > Because of the way I structured the ecb transition code (it will > take an old cipher and repackage it as an lskcipher), we need to > convert the templates first and then do the cipher => lskcipher > conversion. > > > I'd be happy to help out here but I'll be off on vacation for ~3 weeks > > after this week so i won't get around to it before mid October. What I > > will do (if it helps) is rebase my recent RISC-V scalar AES cipher > > patches onto this, and implement ecb(aes) instead (which is the idea > > IIUC?) > > That sounds good. In fact let me attach the aes-generic proof- > of-concept conversion (it can only be applied after all templates > have been converted, so if you test it now everything but ecb/cbc > will be broken). > That helps, thanks. ... > +static struct lskcipher_alg aes_alg = { > + .co = { > + .base.cra_name = "aes", So this means that the base name will be aes, not ecb(aes), right? What about cbc and ctr? It makes sense for a single lskcipher to implement all three of those at least, so that algorithms like XTS and GCM can be implemented cheaply using generic templates, without the need to call into the lskcipher for each block of input.