From patchwork Tue May 16 20:28:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 94940 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp688869vqo; Tue, 16 May 2023 13:41:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/LXDYd6GrEX7bThC955MWvB2UNIqLbOPEoy9aQmflIf8sqL5u7x1gJkeCEz6oRiDi/v6R X-Received: by 2002:a17:90b:4c06:b0:246:5f9e:e4cf with SMTP id na6-20020a17090b4c0600b002465f9ee4cfmr37963627pjb.43.1684269715502; Tue, 16 May 2023 13:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684269715; cv=none; d=google.com; s=arc-20160816; b=mszvpbwaVMLqwF5Sr8MMCklfNft1kvcmR/a4XKV/EyIgc0yfcMUkzAdw38YbwzrjND aDYGbpSAzAhuKonpxjIc/Fysn35PiJa3niAWcKDpQHdge5TWDK6gBKLzW7qWW13uIQOS F1eALbh2bekkMx0qgJ4scvjetdNi4PoQ1EU32Ztw4sG7zQbs/I70LZSyB3n29OjB2c4W JgWnbjc4HLtpL1sre76VNaF6hPiDzfXxSugpFaRMPsCgsXQdZzeJerwoNAT3SBVXt6v9 fd1BTj3wY/o2vRpK2dZL8g7drLvTTzMtn3UXcp+Cj0r9+nYPQJMDEJpsWzD8EbnsIBm2 fKjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=juLSYKSOhf6o23UGOiS7BQUmgfowGVVStMoiZQY/FHc=; b=Z//xx+Sc0kAQhggMaOJnlPVr3EEiVDBzS1hvMp3m3RohCCfNPcidnFKHOghvlM3n++ DUphKnruVsNeCVnpUMKAmGmHZHcsgSmcItCKkNRIBECyeXRXl9CWMbsHc0U2N6FC5bS6 JuvtLRwmzkvj0yZj5ilOZhqJCQjMU9xgivrUsQj7gKdArX1iOCADv14SMbMLPVdORGwg QXTw5+yaVeEvDjS5mmBUPRmOrvQvXob0Oci1mN4ERtBr/6FHKoAESmJNVHCS1LBaW8V/ 4fvuK2K+CflFFZMTp8UZSosu1WC39/D9m5hjjME025hRpXSAgYsuqPp34uozxKXxqZD4 tFTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u6M22LyS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p21-20020a637415000000b005309dcba147si10749600pgc.754.2023.05.16.13.41.40; Tue, 16 May 2023 13:41:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=k20201202 header.b=u6M22LyS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbjEPU3D (ORCPT + 99 others); Tue, 16 May 2023 16:29:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbjEPU3C (ORCPT ); Tue, 16 May 2023 16:29:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8160E97; Tue, 16 May 2023 13:29:01 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 16FE461B95; Tue, 16 May 2023 20:29:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39DE4C433EF; Tue, 16 May 2023 20:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684268940; bh=EDUXvpFm3oqJxXTKWuHtRcqYUh4Z5+wpsxniEd1SNNM=; h=From:To:Cc:Subject:Date:From; b=u6M22LySijck3w31eghLndGmrhlfpYacS+co8kUi9aEqP1Lig1QlZcwlbNKLsVCL3 4jgjt7WtoZ2pcROHtcznqo7Z/oMVF7lp5azJZcaMKC2rNWejeLgRNbLetz58qr/x04 /sBcoCNP5mTZ6JLpzDptnHu66pxK04FZZPAvIkgMVntvrAaGp/aBTQiVcwSQqkkLzv rPuV+SDbHs7qVPmEyqKu7e8mGjQ+yAgtabPuSuFWLq6l1d60AUb+LR7F/aHxGoVtPi 8MyZy7Zyk32rrLnIlMHfqIn/cSc91eU00svjwLYRoOddp6mSTRWDYqJPfX/yK1wONE QWU1fiCe+87gw== From: Arnd Bergmann To: Herbert Xu , "David S. Miller" Cc: Arnd Bergmann , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: aegis: add header for internal prototypes Date: Tue, 16 May 2023 22:28:48 +0200 Message-Id: <20230516202855.561496-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766084801465952894?= X-GMAIL-MSGID: =?utf-8?q?1766084801465952894?= From: Arnd Bergmann gcc warns if prototypes are only visible to the caller but not the callee: crypto/aegis128-neon-inner.c:134:6: warning: no previous prototype for 'crypto_aegis128_init_neon' [-Wmissing-prototypes] crypto/aegis128-neon-inner.c:164:6: warning: no previous prototype for 'crypto_aegis128_update_neon' [-Wmissing-prototypes] crypto/aegis128-neon-inner.c:221:6: warning: no previous prototype for 'crypto_aegis128_encrypt_chunk_neon' [-Wmissing-prototypes] crypto/aegis128-neon-inner.c:270:6: warning: no previous prototype for 'crypto_aegis128_decrypt_chunk_neon' [-Wmissing-prototypes] crypto/aegis128-neon-inner.c:316:5: warning: no previous prototype for 'crypto_aegis128_final_neon' [-Wmissing-prototypes] The prototypes cannot be in the regular aegis.h, as the inner neon code cannot include normal kernel headers. Instead add a new header just for the functions provided by this file. Signed-off-by: Arnd Bergmann --- crypto/aegis-neon.h | 17 +++++++++++++++++ crypto/aegis128-neon-inner.c | 1 + crypto/aegis128-neon.c | 12 +----------- 3 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 crypto/aegis-neon.h diff --git a/crypto/aegis-neon.h b/crypto/aegis-neon.h new file mode 100644 index 000000000000..61e5614b45de --- /dev/null +++ b/crypto/aegis-neon.h @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#ifndef _AEGIS_NEON_H +#define _AEGIS_NEON_H + +void crypto_aegis128_init_neon(void *state, const void *key, const void *iv); +void crypto_aegis128_update_neon(void *state, const void *msg); +void crypto_aegis128_encrypt_chunk_neon(void *state, void *dst, const void *src, + unsigned int size); +void crypto_aegis128_decrypt_chunk_neon(void *state, void *dst, const void *src, + unsigned int size); +int crypto_aegis128_final_neon(void *state, void *tag_xor, + unsigned int assoclen, + unsigned int cryptlen, + unsigned int authsize); + +#endif diff --git a/crypto/aegis128-neon-inner.c b/crypto/aegis128-neon-inner.c index 7de485907d81..b6a52a386b22 100644 --- a/crypto/aegis128-neon-inner.c +++ b/crypto/aegis128-neon-inner.c @@ -16,6 +16,7 @@ #define AEGIS_BLOCK_SIZE 16 #include +#include "aegis-neon.h" extern int aegis128_have_aes_insn; diff --git a/crypto/aegis128-neon.c b/crypto/aegis128-neon.c index a7856915ec85..9ee50549e823 100644 --- a/crypto/aegis128-neon.c +++ b/crypto/aegis128-neon.c @@ -7,17 +7,7 @@ #include #include "aegis.h" - -void crypto_aegis128_init_neon(void *state, const void *key, const void *iv); -void crypto_aegis128_update_neon(void *state, const void *msg); -void crypto_aegis128_encrypt_chunk_neon(void *state, void *dst, const void *src, - unsigned int size); -void crypto_aegis128_decrypt_chunk_neon(void *state, void *dst, const void *src, - unsigned int size); -int crypto_aegis128_final_neon(void *state, void *tag_xor, - unsigned int assoclen, - unsigned int cryptlen, - unsigned int authsize); +#include "aegis-neon.h" int aegis128_have_aes_insn __ro_after_init;