Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1140822rwb; Fri, 7 Oct 2022 08:36:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5L9kE12BMfIz64Xo7HRQxNhBuqP4BTWFb93R4N6dmyvgcfAZ9Jbw7WCdnPI1EUyYfWZN3x X-Received: by 2002:a17:902:ce86:b0:17d:c466:3e4f with SMTP id f6-20020a170902ce8600b0017dc4663e4fmr5680837plg.146.1665156991146; Fri, 07 Oct 2022 08:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665156991; cv=none; d=google.com; s=arc-20160816; b=jf1reEXR2q1LrB+JYrGo3acvztCjyi0W9umj4WLboDCE/8aLh+UrRKvcLCEi+gkTTF xP9EaYPNSuwG3xbfCNz0s5JLjAa3oukyAiJdPjAkBcZviqVf1Jd4ct2yGGFyW4rIUXJg YuK67EIRY08PKJXqscD9VkYvHOaJhIwHnV0ZtYFH469nGTGOUsGIUPFHfIbSi+buxToC 2s4yQ58bOKjEKXw2HQ6p8vDmeKXqp3+PofG3uosJVznlO/GR2o/iyQEz/9iCjo6y249H w2QlLMpANDVj8rt85o5YAvy9Ot6HoMCZ6ypIVmKF2gnj9MI6ZWsf9RfLRZDG28OR2QLq oVWg== 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:dkim-signature; bh=LvctwWh59x04o6QvggrjHW4fwKOToje16pPaZcjYBSc=; b=H22wr1WP5i5NVDKgDvjsmKLWJt2OxKj2LMDoRwtGLr54Rw2RFaXLMrwpmkzrz0dwmu iBlNQ1HiC4Sr008hc2MNQiCy3P68BHT/QNJUbLRDMNmsaY3V0uAwWl/msP/TZWUWjHb2 Zgv1SufYlJ73lh68Qx/YU2NUixgjHiuk80MblD6Fm1yuKDeESOIWCpEgxA9b0RowK1ht NiZbZbmqW0CG1vQUMewx1ZEd2Shzw1WulZgrOjFHsSdmZJduPdCISK1iqG9ZJ6IZ8bRD qXPmPGuYCia0Nyz32GBi0rDhiz8VQUgPZxg7YhtiJQCzcudlubH6CzW675l7EImWmy5t SA0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=Ac0lfxJM; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g1-20020a639f01000000b0045c524975dbsi2943822pge.626.2022.10.07.08.36.17; Fri, 07 Oct 2022 08:36:31 -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=@zx2c4.com header.s=20210105 header.b=Ac0lfxJM; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229964AbiJGPbA (ORCPT + 99 others); Fri, 7 Oct 2022 11:31:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230039AbiJGPa7 (ORCPT ); Fri, 7 Oct 2022 11:30:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03FF88263A for ; Fri, 7 Oct 2022 08:30:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B2285B82369 for ; Fri, 7 Oct 2022 15:30:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEAAAC433C1; Fri, 7 Oct 2022 15:30:54 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="Ac0lfxJM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1665156653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LvctwWh59x04o6QvggrjHW4fwKOToje16pPaZcjYBSc=; b=Ac0lfxJMtAn39FVFvj7IRdU9t/ZWzSWuuilczXKgyhS1H1FOMEw0VyKQRYA9uLSE2sGlp8 yUx2Kt3GUYAX0SwIaD81ymxP8mTCWxf1o14/FQMzr/C88aAL33kFznh5yPHDj5qkI81JnL SMG7gJmCkFSnyF7pIQhB68MuF6wdwnc= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 4f44fcbf (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 7 Oct 2022 15:30:53 +0000 (UTC) Date: Fri, 7 Oct 2022 17:30:52 +0200 From: "Jason A. Donenfeld" To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, ebiggers@kernel.org, keescook@chromium.org, "Nikunj A. Dadhania" Subject: Re: [PATCH] crypto: gcm - Provide minimal library implementation Message-ID: References: <20221007152105.3057788-1-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221007152105.3057788-1-ardb@kernel.org> X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 I haven't looked at this in depth yet, but one thing jumped out: On Fri, Oct 07, 2022 at 05:21:05PM +0200, Ard Biesheuvel wrote: > Implement a minimal library version of GCM based on the existing library > include/crypto/gcm.h | 61 ++ > lib/crypto/gcm.c | 714 ++++++++++++++++++++ > +void gcm_encrypt(const struct gcm_ctx *ctx, u8 *dst, const u8 *src, > + int crypt_len, const u8 *assoc, int assoc_len, > + const u8 iv[GCM_AES_IV_SIZE], u8 *authtag); This should probably all be aes_gcm, aes-gcm.[ch] LIB_AES_GCM and so forth, since GCM is something that works with different block ciphers. Jason