From nobody Tue Aug 22 04:04:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RVG215ZzMz4qGFT; Tue, 22 Aug 2023 04:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RVG212CKdz4FHc; Tue, 22 Aug 2023 04:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692677065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LjIGV5HSelAdZrFoVmwIg8qwHlmbqziWGjjk+ZZlokU=; b=ywjNCgkkMNrgymyuIvoGT1iExw9JUdlSnpWvLJ4wY7BVn2onEzhurMV9csHmqR7QU1ABQP vdn7sANmxKN/f/Qaeo8WljQl+JUCjNekXEey84i0ChO+j6GhmiTLoVBW6qsnyDd3AnHJVO wnWWhRDxiR4V6hH+PmfHEahmbu5ZjgTBD8BbGxJEsPHsPqc496R3PYlfIiazXtyuj3bggC pki8av5wFz3fRhoRw3AnjAl9qJ1+bu7mbQxFscghaowRhNHkCjhLb8l3gyfmJHnPrXAY2F XK7mbbqjtmtYbuBYtWmAScSxQoGxDdJuJUXF2qVe+hXbO+OhxSNiO/4fUsE47Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692677065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LjIGV5HSelAdZrFoVmwIg8qwHlmbqziWGjjk+ZZlokU=; b=ro+UKnywb3bYlyoAmFc0CaPpXTdK/FVjhMV0u7hmM/4FracyqyeRqFYbMJWdcrahTDS9J0 r2W/+fQ4JdRJnTYSLf3P+IL6dMUXRsptqHfQogd9xx6+JGizqCLGXuPfKgn9FycLeFGHAd 9ZGCsVTMSMX6Mm1LxPbhEGrFnQPrdI33YRo3QoCi5yP2lgntnx1p3XGLlzBf3K+j7VIWEC aaenS/GAuC7Cqg2/pOx1leYCkWLm05VTTo+hue2JhNsEncT5wr5CWK1OZJ4eOda4CUVBn8 sLpOtVQ4j8suAj8lYSJYZq59DZCCx9xyURoFFveptr6CoPLiytuRPVOWaojZnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692677065; a=rsa-sha256; cv=none; b=bSKUrzYA3iEaPIA2BqjPqCAerZ9dakOLZMGoEOVAgLhaBDi/Z0TK7WYmsjGOfLd8rWOgh1 JYBYtOly0E5h+6Ua5QbHYuRbmo5Qz9Fe3z3TcM6j9No34zBNrTkSrjdqCItIJFO1IaYTXB lzjis8wydTwLkgmOF+nNmtYDvq6SRa82IJ79Zf3sJ3/5RtMU64X5X+QSMZ9usCVCg5uWZB nguXGsESOOVS+hK+39khPnK4GYGW5HZhOrIStp3/wRcDT2xcpsgp0Aoh/zB606MNmVWK53 zElGvBNIWh0IdzW9H/yZC5zFBTBMvnlXT8XnJBsXP3ig8s0PkpSFMrN7VeQYOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RVG2112XczpK3; Tue, 22 Aug 2023 04:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37M44PYr093506; Tue, 22 Aug 2023 04:04:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37M44PZk093503; Tue, 22 Aug 2023 04:04:25 GMT (envelope-from git) Date: Tue, 22 Aug 2023 04:04:25 GMT Message-Id: <202308220404.37M44PZk093503@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 3250c9d52728 - main - libcrypto: Update assembly build glue for x86 for OpenSSL 3.0. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3250c9d5272821e5b796144c63b1de982cd4e43b Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3250c9d5272821e5b796144c63b1de982cd4e43b commit 3250c9d5272821e5b796144c63b1de982cd4e43b Author: John Baldwin AuthorDate: 2023-08-22 04:02:42 +0000 Commit: John Baldwin CommitDate: 2023-08-22 04:02:42 +0000 libcrypto: Update assembly build glue for x86 for OpenSSL 3.0. Notably, define AES_ASM which is required for any AES acceleration (OpenSSL 1.0 gated all AES acceleration on OPENSSL_CPUID_OBJ instead). Enabling this exposed that new assembly files added in OpenSSL 3.0 needed to be included in the build (aes-x86-64.S and aes-586.S). Both of these files supplant both aes_core.c and aes_cbc.c. The last file had to be moved out of the MI SRCS line for aes and into each ASM_* for non-x86. As part of this I audited the generated configdata.pm for amd64, i386, and aarch64 and found the following additional discrepecancies that are fixed here as well: - Enabled BSAES_ASM on amd64 which requires bsase-x86_64.S - Enabled WHIRLPOOL_ASM on amd64 (asm sources already built) - Enabled CMLL_ASM on amd64 and i386 (asm sources already built) aarch64 had no discreprecancies in configdata.pm, and no *.pl asm generators were missing for aarch64 in Makefile.asm. I did not check powerpc or armv7, but for armv7 all of the asm generators seem to be present in Makefile.asm. Reported by: gallatin (AES-GCM using plain software on amd64) Reviewed by: gallatin, ngie, emaste Differential Revision: https://reviews.freebsd.org/D41539 --- secure/lib/libcrypto/Makefile | 20 ++++++++++---------- secure/lib/libcrypto/Makefile.common | 6 ++++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile index d4102c6cd0cf..f4bd4a3247f3 100644 --- a/secure/lib/libcrypto/Makefile +++ b/secure/lib/libcrypto/Makefile @@ -41,25 +41,25 @@ SRCS+= mem_clr.c .endif # aes -SRCS+= aes_cbc.c aes_cfb.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c +SRCS+= aes_cfb.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c .if defined(ASM_aarch64) -SRCS+= aes_core.c aesv8-armx.S vpaes-armv8.S +SRCS+= aes_cbc.c aes_core.c aesv8-armx.S vpaes-armv8.S ACFLAGS.aesv8-armx.S= -march=armv8-a+crypto .elif defined(ASM_amd64) -SRCS+= aes_core.c aesni-mb-x86_64.S aesni-sha1-x86_64.S aesni-sha256-x86_64.S -SRCS+= aesni-x86_64.S vpaes-x86_64.S +SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S +SRCS+= aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S .elif defined(ASM_arm) -SRCS+= aes-armv4.S aesv8-armx.S bsaes-armv7.S +SRCS+= aes_cbc.c aes-armv4.S aesv8-armx.S bsaes-armv7.S .elif defined(ASM_i386) -SRCS+= aes_core.c aesni-x86.S vpaes-x86.S +SRCS+= aes-586.S aesni-x86.S vpaes-x86.S .elif defined(ASM_powerpc) -SRCS+= aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S +SRCS+= aes_cbc.c aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S .elif defined(ASM_powerpc64) -SRCS+= aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S +SRCS+= aes_cbc.c aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S .elif defined(ASM_powerpc64le) -SRCS+= aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S +SRCS+= aes_cbc.c aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S .else -SRCS+= aes_core.c +SRCS+= aes_cbc.c aes_core.c .endif # asn1 diff --git a/secure/lib/libcrypto/Makefile.common b/secure/lib/libcrypto/Makefile.common index 620bc9178f38..a52e2979060a 100644 --- a/secure/lib/libcrypto/Makefile.common +++ b/secure/lib/libcrypto/Makefile.common @@ -32,8 +32,12 @@ CFLAGS+= -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM CFLAGS+= -DKECCAK1600_ASM CFLAGS+= -DRC4_ASM CFLAGS+= -DMD5_ASM +CFLAGS+= -DAES_ASM +CFLAGS+= -DBSAES_ASM CFLAGS+= -DVPAES_ASM +CFLAGS+= -DWHIRLPOOL_ASM CFLAGS+= -DGHASH_ASM +CFLAGS+= -DCMLL_ASM CFLAGS+= -DECP_NISTZ256_ASM -DX25519_ASM CFLAGS+= -DPADLOCK_ASM CFLAGS+= -DPOLY1305_ASM @@ -53,9 +57,11 @@ CFLAGS+= -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM CFLAGS+= -DRC4_ASM CFLAGS+= -DMD5_ASM CFLAGS+= -DRMD160_ASM +CFLAGS+= -DAES_ASM CFLAGS+= -DVPAES_ASM CFLAGS+= -DWHIRLPOOL_ASM CFLAGS+= -DGHASH_ASM +CFLAGS+= -DCMLL_ASM CFLAGS+= -DECP_NISTZ256_ASM CFLAGS+= -DPADLOCK_ASM CFLAGS+= -DPOLY1305_ASM