summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/aes/asm/aes-586.pl6
-rw-r--r--src/lib/libcrypto/aes/asm/aes-mips.pl2
-rw-r--r--src/lib/libcrypto/aes/asm/aes-ppc.pl2
-rw-r--r--src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl4
-rw-r--r--src/lib/libcrypto/aes/asm/aesni-x86_64.pl30
-rw-r--r--src/lib/libcrypto/aes/asm/bsaes-x86_64.pl2
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_aix.c4
-rw-r--r--src/lib/libcrypto/arch/aarch64/opensslconf.h6
-rw-r--r--src/lib/libcrypto/arch/alpha/opensslconf.h6
-rw-r--r--src/lib/libcrypto/arch/amd64/opensslconf.h4
-rw-r--r--src/lib/libcrypto/arch/arm/opensslconf.h6
-rw-r--r--src/lib/libcrypto/arch/hppa/opensslconf.h6
-rw-r--r--src/lib/libcrypto/arch/i386/opensslconf.h6
-rw-r--r--src/lib/libcrypto/arch/m88k/opensslconf.h6
-rw-r--r--src/lib/libcrypto/arch/mips64/opensslconf.h6
-rw-r--r--src/lib/libcrypto/arch/powerpc/opensslconf.h6
-rw-r--r--src/lib/libcrypto/arch/powerpc64/opensslconf.h4
-rw-r--r--src/lib/libcrypto/arch/riscv64/opensslconf.h6
-rw-r--r--src/lib/libcrypto/arch/sh/opensslconf.h6
-rw-r--r--src/lib/libcrypto/arch/sparc/opensslconf.h6
-rw-r--r--src/lib/libcrypto/arch/sparc64/opensslconf.h6
-rw-r--r--src/lib/libcrypto/asn1/a_mbstr.c4
-rw-r--r--src/lib/libcrypto/asn1/tasn_utl.c4
-rw-r--r--src/lib/libcrypto/bio/bss_dgram.c4
-rw-r--r--src/lib/libcrypto/bn/asm/co-586.pl8
-rw-r--r--src/lib/libcrypto/bn/asm/mips.pl2
-rw-r--r--src/lib/libcrypto/bn/asm/modexp512-x86_64.pl2
-rw-r--r--src/lib/libcrypto/bn/asm/pa-risc2W.s2
-rw-r--r--src/lib/libcrypto/bn/asm/parisc-mont.pl2
-rw-r--r--src/lib/libcrypto/bn/asm/ppc.pl2
-rw-r--r--src/lib/libcrypto/bn/asm/ppc64-mont.pl2
-rw-r--r--src/lib/libcrypto/bn/asm/sparcv9-mont.pl2
-rwxr-xr-xsrc/lib/libcrypto/bn/asm/sparcv9a-mont.pl4
-rw-r--r--src/lib/libcrypto/bn/asm/x86-gf2m.pl2
-rwxr-xr-xsrc/lib/libcrypto/bn/asm/x86-mont.pl4
-rw-r--r--src/lib/libcrypto/bn/asm/x86/comba.pl8
-rw-r--r--src/lib/libcrypto/bn/asm/x86_64-gf2m.pl2
-rw-r--r--src/lib/libcrypto/bn/bn_div.c4
-rw-r--r--src/lib/libcrypto/bn/bn_gcd.c4
-rw-r--r--src/lib/libcrypto/bn/bn_x931p.c8
-rw-r--r--src/lib/libcrypto/cmac/cmac.c4
-rw-r--r--src/lib/libcrypto/comp/c_zlib.c6
-rw-r--r--src/lib/libcrypto/crypto.h8
-rw-r--r--src/lib/libcrypto/des/asm/des_enc.m44
-rw-r--r--src/lib/libcrypto/dh/dh_ameth.c4
-rw-r--r--src/lib/libcrypto/dso/dso.h8
-rw-r--r--src/lib/libcrypto/ec/asm/ecp_nistz256-armv4.pl6
-rw-r--r--src/lib/libcrypto/ec/asm/ecp_nistz256-sparcv9.pl6
-rw-r--r--src/lib/libcrypto/ec/ec.h58
-rw-r--r--src/lib/libcrypto/ec/ecp_nistp224.c4
-rw-r--r--src/lib/libcrypto/ec/ecp_nistp256.c4
-rw-r--r--src/lib/libcrypto/ec/ecp_nistp521.c6
-rw-r--r--src/lib/libcrypto/ecdsa/ecdsa.h6
-rw-r--r--src/lib/libcrypto/engine/README4
-rw-r--r--src/lib/libcrypto/engine/eng_aesni.c4
-rw-r--r--src/lib/libcrypto/engine/eng_list.c4
-rw-r--r--src/lib/libcrypto/engine/eng_padlock.c6
-rw-r--r--src/lib/libcrypto/engine/eng_table.c6
-rw-r--r--src/lib/libcrypto/engine/engine.h4
-rw-r--r--src/lib/libcrypto/err/err.c4
-rw-r--r--src/lib/libcrypto/evp/digest.c4
-rw-r--r--src/lib/libcrypto/evp/evp_enc.c4
-rw-r--r--src/lib/libcrypto/evp/pmeth_lib.c4
-rw-r--r--src/lib/libcrypto/man/PKCS7_dataFinal.36
-rw-r--r--src/lib/libcrypto/man/PKCS7_final.36
-rw-r--r--src/lib/libcrypto/man/X509_check_trust.36
-rw-r--r--src/lib/libcrypto/md32_common.h4
-rw-r--r--src/lib/libcrypto/modes/asm/ghash-x86.pl6
-rw-r--r--src/lib/libcrypto/modes/ctr128.c6
-rw-r--r--src/lib/libcrypto/objects/obj_dat.c6
-rw-r--r--src/lib/libcrypto/objects/objects.txt2
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_cl.c4
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_ext.c4
-rw-r--r--src/lib/libcrypto/ossl_typ.h4
-rw-r--r--src/lib/libcrypto/perlasm/readme2
-rwxr-xr-xsrc/lib/libcrypto/perlasm/x86_64-xlate.pl6
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_doit.c4
-rw-r--r--src/lib/libcrypto/rc2/version2
-rw-r--r--src/lib/libcrypto/rc4/asm/rc4-586.pl4
-rwxr-xr-xsrc/lib/libcrypto/rc4/asm/rc4-x86_64.pl4
-rw-r--r--src/lib/libcrypto/ripemd/README2
-rw-r--r--src/lib/libcrypto/rsa/rsa_eay.c4
-rw-r--r--src/lib/libcrypto/sha/asm/sha1-586.pl8
-rw-r--r--src/lib/libcrypto/sha/asm/sha1-sparcv9a.pl2
-rw-r--r--src/lib/libcrypto/sha/asm/sha1-thumb.pl2
-rwxr-xr-xsrc/lib/libcrypto/sha/asm/sha1-x86_64.pl4
-rwxr-xr-xsrc/lib/libcrypto/sha/asm/sha512-x86_64.pl2
-rw-r--r--src/lib/libcrypto/sparccpuid.S2
-rw-r--r--src/lib/libcrypto/ui/ui.h4
-rw-r--r--src/lib/libcrypto/whrlpool/asm/wp-mmx.pl6
-rw-r--r--src/lib/libcrypto/x509/pcy_tree.c4
-rw-r--r--src/lib/libcrypto/x509/x509.h4
-rw-r--r--src/lib/libcrypto/x509/x509_constraints.c14
-rw-r--r--src/lib/libcrypto/x509/x509_issuer_cache.c4
-rw-r--r--src/lib/libcrypto/x509/x509_ncons.c6
-rw-r--r--src/lib/libcrypto/x509/x509_utl.c4
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.c4
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.h4
-rw-r--r--src/lib/libcrypto/x509/x509name.c4
-rw-r--r--src/lib/libcrypto/x86cpuid.pl2
100 files changed, 265 insertions, 265 deletions
diff --git a/src/lib/libcrypto/aes/asm/aes-586.pl b/src/lib/libcrypto/aes/asm/aes-586.pl
index 3ba8a26eaa..c5ae3f6903 100644
--- a/src/lib/libcrypto/aes/asm/aes-586.pl
+++ b/src/lib/libcrypto/aes/asm/aes-586.pl
@@ -48,8 +48,8 @@
48# better performance on most recent µ-archs... 48# better performance on most recent µ-archs...
49# 49#
50# Third version adds AES_cbc_encrypt implementation, which resulted in 50# Third version adds AES_cbc_encrypt implementation, which resulted in
51# up to 40% performance imrovement of CBC benchmark results. 40% was 51# up to 40% performance improvement of CBC benchmark results. 40% was
52# observed on P4 core, where "overall" imrovement coefficient, i.e. if 52# observed on P4 core, where "overall" improvement coefficient, i.e. if
53# compared to PIC generated by GCC and in CBC mode, was observed to be 53# compared to PIC generated by GCC and in CBC mode, was observed to be
54# as large as 4x:-) CBC performance is virtually identical to ECB now 54# as large as 4x:-) CBC performance is virtually identical to ECB now
55# and on some platforms even better, e.g. 17.6 "small" cycles/byte on 55# and on some platforms even better, e.g. 17.6 "small" cycles/byte on
@@ -228,7 +228,7 @@ $small_footprint=1; # $small_footprint=1 code is ~5% slower [on
228 # contention and in hope to "collect" 5% back 228 # contention and in hope to "collect" 5% back
229 # in real-life applications... 229 # in real-life applications...
230 230
231$vertical_spin=0; # shift "verticaly" defaults to 0, because of 231$vertical_spin=0; # shift "vertically" defaults to 0, because of
232 # its proof-of-concept status... 232 # its proof-of-concept status...
233# Note that there is no decvert(), as well as last encryption round is 233# Note that there is no decvert(), as well as last encryption round is
234# performed with "horizontal" shifts. This is because this "vertical" 234# performed with "horizontal" shifts. This is because this "vertical"
diff --git a/src/lib/libcrypto/aes/asm/aes-mips.pl b/src/lib/libcrypto/aes/asm/aes-mips.pl
index 2f6ff74ffe..b95d1afd5a 100644
--- a/src/lib/libcrypto/aes/asm/aes-mips.pl
+++ b/src/lib/libcrypto/aes/asm/aes-mips.pl
@@ -106,7 +106,7 @@ my ($i0,$i1,$i2,$i3)=($at,$t0,$t1,$t2);
106my ($t0,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$t10,$t11) = map("\$$_",(12..23)); 106my ($t0,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$t10,$t11) = map("\$$_",(12..23));
107my ($key0,$cnt)=($gp,$fp); 107my ($key0,$cnt)=($gp,$fp);
108 108
109# instuction ordering is "stolen" from output from MIPSpro assembler 109# instruction ordering is "stolen" from output from MIPSpro assembler
110# invoked with -mips3 -O3 arguments... 110# invoked with -mips3 -O3 arguments...
111$code.=<<___; 111$code.=<<___;
112.align 5 112.align 5
diff --git a/src/lib/libcrypto/aes/asm/aes-ppc.pl b/src/lib/libcrypto/aes/asm/aes-ppc.pl
index 7c52cbe5f9..91a46f60ed 100644
--- a/src/lib/libcrypto/aes/asm/aes-ppc.pl
+++ b/src/lib/libcrypto/aes/asm/aes-ppc.pl
@@ -19,7 +19,7 @@
19# February 2010 19# February 2010
20# 20#
21# Rescheduling instructions to favour Power6 pipeline gave 10% 21# Rescheduling instructions to favour Power6 pipeline gave 10%
22# performance improvement on the platfrom in question (and marginal 22# performance improvement on the platform in question (and marginal
23# improvement even on others). It should be noted that Power6 fails 23# improvement even on others). It should be noted that Power6 fails
24# to process byte in 18 cycles, only in 23, because it fails to issue 24# to process byte in 18 cycles, only in 23, because it fails to issue
25# 4 load instructions in two cycles, only in 3. As result non-compact 25# 4 load instructions in two cycles, only in 3. As result non-compact
diff --git a/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl b/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl
index bc6c8f3fc0..880bcc2d58 100644
--- a/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl
+++ b/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl
@@ -250,7 +250,7 @@ ___
250 $r++; unshift(@rndkey,pop(@rndkey)); 250 $r++; unshift(@rndkey,pop(@rndkey));
251}; 251};
252 252
253sub Xupdate_ssse3_16_31() # recall that $Xi starts wtih 4 253sub Xupdate_ssse3_16_31() # recall that $Xi starts with 4
254{ use integer; 254{ use integer;
255 my $body = shift; 255 my $body = shift;
256 my @insns = (&$body,&$body,&$body,&$body); # 40 instructions 256 my @insns = (&$body,&$body,&$body,&$body); # 40 instructions
@@ -767,7 +767,7 @@ ___
767 $r++; unshift(@rndkey,pop(@rndkey)); 767 $r++; unshift(@rndkey,pop(@rndkey));
768}; 768};
769 769
770sub Xupdate_avx_16_31() # recall that $Xi starts wtih 4 770sub Xupdate_avx_16_31() # recall that $Xi starts with 4
771{ use integer; 771{ use integer;
772 my $body = shift; 772 my $body = shift;
773 my @insns = (&$body,&$body,&$body,&$body); # 40 instructions 773 my @insns = (&$body,&$body,&$body,&$body); # 40 instructions
diff --git a/src/lib/libcrypto/aes/asm/aesni-x86_64.pl b/src/lib/libcrypto/aes/asm/aesni-x86_64.pl
index f0b30109ae..a849073728 100644
--- a/src/lib/libcrypto/aes/asm/aesni-x86_64.pl
+++ b/src/lib/libcrypto/aes/asm/aesni-x86_64.pl
@@ -52,7 +52,7 @@
52# nothing one can do and the result appears optimal. CCM result is 52# nothing one can do and the result appears optimal. CCM result is
53# identical to CBC, because CBC-MAC is essentially CBC encrypt without 53# identical to CBC, because CBC-MAC is essentially CBC encrypt without
54# saving output. CCM CTR "stays invisible," because it's neatly 54# saving output. CCM CTR "stays invisible," because it's neatly
55# interleaved wih CBC-MAC. This provides ~30% improvement over 55# interleaved with CBC-MAC. This provides ~30% improvement over
56# "straghtforward" CCM implementation with CTR and CBC-MAC performed 56# "straghtforward" CCM implementation with CTR and CBC-MAC performed
57# disjointly. Parallelizable modes practically achieve the theoretical 57# disjointly. Parallelizable modes practically achieve the theoretical
58# limit. 58# limit.
@@ -136,7 +136,7 @@
136# asymptotic, if it can be surpassed, isn't it? What happens there? 136# asymptotic, if it can be surpassed, isn't it? What happens there?
137# Rewind to CBC paragraph for the answer. Yes, out-of-order execution 137# Rewind to CBC paragraph for the answer. Yes, out-of-order execution
138# magic is responsible for this. Processor overlaps not only the 138# magic is responsible for this. Processor overlaps not only the
139# additional instructions with AES ones, but even AES instuctions 139# additional instructions with AES ones, but even AES instructions
140# processing adjacent triplets of independent blocks. In the 6x case 140# processing adjacent triplets of independent blocks. In the 6x case
141# additional instructions still claim disproportionally small amount 141# additional instructions still claim disproportionally small amount
142# of additional cycles, but in 8x case number of instructions must be 142# of additional cycles, but in 8x case number of instructions must be
@@ -1350,7 +1350,7 @@ ___
1350 movdqa @tweak[5],@tweak[$i] 1350 movdqa @tweak[5],@tweak[$i]
1351 paddq @tweak[5],@tweak[5] # psllq 1,$tweak 1351 paddq @tweak[5],@tweak[5] # psllq 1,$tweak
1352 pand $twmask,$twres # isolate carry and residue 1352 pand $twmask,$twres # isolate carry and residue
1353 pcmpgtd @tweak[5],$twtmp # broadcat upper bits 1353 pcmpgtd @tweak[5],$twtmp # broadcast upper bits
1354 pxor $twres,@tweak[5] 1354 pxor $twres,@tweak[5]
1355___ 1355___
1356 } 1356 }
@@ -1456,7 +1456,7 @@ $code.=<<___;
1456 aesenc $rndkey0,$inout0 1456 aesenc $rndkey0,$inout0
1457 pand $twmask,$twres # isolate carry and residue 1457 pand $twmask,$twres # isolate carry and residue
1458 aesenc $rndkey0,$inout1 1458 aesenc $rndkey0,$inout1
1459 pcmpgtd @tweak[5],$twtmp # broadcat upper bits 1459 pcmpgtd @tweak[5],$twtmp # broadcast upper bits
1460 aesenc $rndkey0,$inout2 1460 aesenc $rndkey0,$inout2
1461 pxor $twres,@tweak[5] 1461 pxor $twres,@tweak[5]
1462 aesenc $rndkey0,$inout3 1462 aesenc $rndkey0,$inout3
@@ -1471,7 +1471,7 @@ $code.=<<___;
1471 aesenc $rndkey1,$inout0 1471 aesenc $rndkey1,$inout0
1472 pand $twmask,$twres # isolate carry and residue 1472 pand $twmask,$twres # isolate carry and residue
1473 aesenc $rndkey1,$inout1 1473 aesenc $rndkey1,$inout1
1474 pcmpgtd @tweak[5],$twtmp # broadcat upper bits 1474 pcmpgtd @tweak[5],$twtmp # broadcast upper bits
1475 aesenc $rndkey1,$inout2 1475 aesenc $rndkey1,$inout2
1476 pxor $twres,@tweak[5] 1476 pxor $twres,@tweak[5]
1477 aesenc $rndkey1,$inout3 1477 aesenc $rndkey1,$inout3
@@ -1485,7 +1485,7 @@ $code.=<<___;
1485 aesenclast $rndkey0,$inout0 1485 aesenclast $rndkey0,$inout0
1486 pand $twmask,$twres # isolate carry and residue 1486 pand $twmask,$twres # isolate carry and residue
1487 aesenclast $rndkey0,$inout1 1487 aesenclast $rndkey0,$inout1
1488 pcmpgtd @tweak[5],$twtmp # broadcat upper bits 1488 pcmpgtd @tweak[5],$twtmp # broadcast upper bits
1489 aesenclast $rndkey0,$inout2 1489 aesenclast $rndkey0,$inout2
1490 pxor $twres,@tweak[5] 1490 pxor $twres,@tweak[5]
1491 aesenclast $rndkey0,$inout3 1491 aesenclast $rndkey0,$inout3
@@ -1499,7 +1499,7 @@ $code.=<<___;
1499 xorps `16*0`(%rsp),$inout0 # output^=tweak 1499 xorps `16*0`(%rsp),$inout0 # output^=tweak
1500 pand $twmask,$twres # isolate carry and residue 1500 pand $twmask,$twres # isolate carry and residue
1501 xorps `16*1`(%rsp),$inout1 1501 xorps `16*1`(%rsp),$inout1
1502 pcmpgtd @tweak[5],$twtmp # broadcat upper bits 1502 pcmpgtd @tweak[5],$twtmp # broadcast upper bits
1503 pxor $twres,@tweak[5] 1503 pxor $twres,@tweak[5]
1504 1504
1505 xorps `16*2`(%rsp),$inout2 1505 xorps `16*2`(%rsp),$inout2
@@ -1750,7 +1750,7 @@ ___
1750 movdqa @tweak[5],@tweak[$i] 1750 movdqa @tweak[5],@tweak[$i]
1751 paddq @tweak[5],@tweak[5] # psllq 1,$tweak 1751 paddq @tweak[5],@tweak[5] # psllq 1,$tweak
1752 pand $twmask,$twres # isolate carry and residue 1752 pand $twmask,$twres # isolate carry and residue
1753 pcmpgtd @tweak[5],$twtmp # broadcat upper bits 1753 pcmpgtd @tweak[5],$twtmp # broadcast upper bits
1754 pxor $twres,@tweak[5] 1754 pxor $twres,@tweak[5]
1755___ 1755___
1756 } 1756 }
@@ -1856,7 +1856,7 @@ $code.=<<___;
1856 aesdec $rndkey0,$inout0 1856 aesdec $rndkey0,$inout0
1857 pand $twmask,$twres # isolate carry and residue 1857 pand $twmask,$twres # isolate carry and residue
1858 aesdec $rndkey0,$inout1 1858 aesdec $rndkey0,$inout1
1859 pcmpgtd @tweak[5],$twtmp # broadcat upper bits 1859 pcmpgtd @tweak[5],$twtmp # broadcast upper bits
1860 aesdec $rndkey0,$inout2 1860 aesdec $rndkey0,$inout2
1861 pxor $twres,@tweak[5] 1861 pxor $twres,@tweak[5]
1862 aesdec $rndkey0,$inout3 1862 aesdec $rndkey0,$inout3
@@ -1871,7 +1871,7 @@ $code.=<<___;
1871 aesdec $rndkey1,$inout0 1871 aesdec $rndkey1,$inout0
1872 pand $twmask,$twres # isolate carry and residue 1872 pand $twmask,$twres # isolate carry and residue
1873 aesdec $rndkey1,$inout1 1873 aesdec $rndkey1,$inout1
1874 pcmpgtd @tweak[5],$twtmp # broadcat upper bits 1874 pcmpgtd @tweak[5],$twtmp # broadcast upper bits
1875 aesdec $rndkey1,$inout2 1875 aesdec $rndkey1,$inout2
1876 pxor $twres,@tweak[5] 1876 pxor $twres,@tweak[5]
1877 aesdec $rndkey1,$inout3 1877 aesdec $rndkey1,$inout3
@@ -1885,7 +1885,7 @@ $code.=<<___;
1885 aesdeclast $rndkey0,$inout0 1885 aesdeclast $rndkey0,$inout0
1886 pand $twmask,$twres # isolate carry and residue 1886 pand $twmask,$twres # isolate carry and residue
1887 aesdeclast $rndkey0,$inout1 1887 aesdeclast $rndkey0,$inout1
1888 pcmpgtd @tweak[5],$twtmp # broadcat upper bits 1888 pcmpgtd @tweak[5],$twtmp # broadcast upper bits
1889 aesdeclast $rndkey0,$inout2 1889 aesdeclast $rndkey0,$inout2
1890 pxor $twres,@tweak[5] 1890 pxor $twres,@tweak[5]
1891 aesdeclast $rndkey0,$inout3 1891 aesdeclast $rndkey0,$inout3
@@ -1899,7 +1899,7 @@ $code.=<<___;
1899 xorps `16*0`(%rsp),$inout0 # output^=tweak 1899 xorps `16*0`(%rsp),$inout0 # output^=tweak
1900 pand $twmask,$twres # isolate carry and residue 1900 pand $twmask,$twres # isolate carry and residue
1901 xorps `16*1`(%rsp),$inout1 1901 xorps `16*1`(%rsp),$inout1
1902 pcmpgtd @tweak[5],$twtmp # broadcat upper bits 1902 pcmpgtd @tweak[5],$twtmp # broadcast upper bits
1903 pxor $twres,@tweak[5] 1903 pxor $twres,@tweak[5]
1904 1904
1905 xorps `16*2`(%rsp),$inout2 1905 xorps `16*2`(%rsp),$inout2
@@ -2520,7 +2520,7 @@ ___
2520# Vinodh Gopal <vinodh.gopal@intel.com> 2520# Vinodh Gopal <vinodh.gopal@intel.com>
2521# Kahraman Akdemir 2521# Kahraman Akdemir
2522# 2522#
2523# Agressively optimized in respect to aeskeygenassist's critical path 2523# Aggressively optimized in respect to aeskeygenassist's critical path
2524# and is contained in %xmm0-5 to meet Win64 ABI requirement. 2524# and is contained in %xmm0-5 to meet Win64 ABI requirement.
2525# 2525#
2526$code.=<<___; 2526$code.=<<___;
@@ -2602,7 +2602,7 @@ __aesni_set_encrypt_key:
2602 2602
2603.align 16 2603.align 16
2604.L14rounds: 2604.L14rounds:
2605 movups 16($inp),%xmm2 # remaning half of *userKey 2605 movups 16($inp),%xmm2 # remaining half of *userKey
2606 mov \$13,$bits # 14 rounds for 256 2606 mov \$13,$bits # 14 rounds for 256
2607 lea 16(%rax),%rax 2607 lea 16(%rax),%rax
2608 $movkey %xmm0,($key) # round 0 2608 $movkey %xmm0,($key) # round 0
@@ -2862,7 +2862,7 @@ xts_se_handler:
2862 mov 56($disp),%r11 # disp->HandlerData 2862 mov 56($disp),%r11 # disp->HandlerData
2863 2863
2864 mov 0(%r11),%r10d # HandlerData[0] 2864 mov 0(%r11),%r10d # HandlerData[0]
2865 lea (%rsi,%r10),%r10 # prologue lable 2865 lea (%rsi,%r10),%r10 # prologue label
2866 cmp %r10,%rbx # context->Rip<prologue label 2866 cmp %r10,%rbx # context->Rip<prologue label
2867 jb .Lcommon_seh_tail 2867 jb .Lcommon_seh_tail
2868 2868
diff --git a/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl b/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl
index 41b90f0844..14dc2c02e7 100644
--- a/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl
+++ b/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl
@@ -20,7 +20,7 @@
20# - code was made position-independent; 20# - code was made position-independent;
21# - rounds were folded into a loop resulting in >5x size reduction 21# - rounds were folded into a loop resulting in >5x size reduction
22# from 12.5KB to 2.2KB; 22# from 12.5KB to 2.2KB;
23# - above was possibile thanks to mixcolumns() modification that 23# - above was possible thanks to mixcolumns() modification that
24# allowed to feed its output back to aesenc[last], this was 24# allowed to feed its output back to aesenc[last], this was
25# achieved at cost of two additional inter-registers moves; 25# achieved at cost of two additional inter-registers moves;
26# - some instruction reordering and interleaving; 26# - some instruction reordering and interleaving;
diff --git a/src/lib/libcrypto/arc4random/getentropy_aix.c b/src/lib/libcrypto/arc4random/getentropy_aix.c
index 7fb857e6d2..9d085cf503 100644
--- a/src/lib/libcrypto/arc4random/getentropy_aix.c
+++ b/src/lib/libcrypto/arc4random/getentropy_aix.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_aix.c,v 1.8 2021/10/24 21:24:20 deraadt Exp $ */ 1/* $OpenBSD: getentropy_aix.c,v 1.9 2022/12/26 07:18:50 jmc Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2015 Michael Felt <aixtools@gmail.com> 4 * Copyright (c) 2015 Michael Felt <aixtools@gmail.com>
@@ -21,7 +21,7 @@
21 * http://man.openbsd.org/getentropy.2 21 * http://man.openbsd.org/getentropy.2
22 */ 22 */
23/* 23/*
24 * -lperfstat is needed for the psuedo entropy data 24 * -lperfstat is needed for the pseudo entropy data
25 */ 25 */
26 26
27#include <sys/mman.h> 27#include <sys/mman.h>
diff --git a/src/lib/libcrypto/arch/aarch64/opensslconf.h b/src/lib/libcrypto/arch/aarch64/opensslconf.h
index ab3e2d89b0..748ed8f8b4 100644
--- a/src/lib/libcrypto/arch/aarch64/opensslconf.h
+++ b/src/lib/libcrypto/arch/aarch64/opensslconf.h
@@ -60,7 +60,7 @@
60/* Only one for the following should be defined */ 60/* Only one for the following should be defined */
61/* The prime number generation stuff may not work when 61/* The prime number generation stuff may not work when
62 * EIGHT_BIT but I don't care since I've only used this mode 62 * EIGHT_BIT but I don't care since I've only used this mode
63 * for debuging the bignum libraries */ 63 * for debugging the bignum libraries */
64#define SIXTY_FOUR_BIT_LONG 64#define SIXTY_FOUR_BIT_LONG
65#undef SIXTY_FOUR_BIT 65#undef SIXTY_FOUR_BIT
66#undef THIRTY_TWO_BIT 66#undef THIRTY_TWO_BIT
@@ -90,7 +90,7 @@
90#endif 90#endif
91 91
92/* This helps C compiler generate the correct code for multiple functional 92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependancies at the expense of 2 more 93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */ 94 * registers */
95#ifndef DES_RISC1 95#ifndef DES_RISC1
96#undef DES_RISC1 96#undef DES_RISC1
@@ -105,7 +105,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif 105#endif
106 106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders. 107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very mucy CPU dependant */ 108 * Very much CPU dependent */
109#ifndef DES_UNROLL 109#ifndef DES_UNROLL
110#define DES_UNROLL 110#define DES_UNROLL
111#endif 111#endif
diff --git a/src/lib/libcrypto/arch/alpha/opensslconf.h b/src/lib/libcrypto/arch/alpha/opensslconf.h
index a1331118f4..47f2aa8f21 100644
--- a/src/lib/libcrypto/arch/alpha/opensslconf.h
+++ b/src/lib/libcrypto/arch/alpha/opensslconf.h
@@ -60,7 +60,7 @@
60/* Only one for the following should be defined */ 60/* Only one for the following should be defined */
61/* The prime number generation stuff may not work when 61/* The prime number generation stuff may not work when
62 * EIGHT_BIT but I don't care since I've only used this mode 62 * EIGHT_BIT but I don't care since I've only used this mode
63 * for debuging the bignum libraries */ 63 * for debugging the bignum libraries */
64#define SIXTY_FOUR_BIT_LONG 64#define SIXTY_FOUR_BIT_LONG
65#undef SIXTY_FOUR_BIT 65#undef SIXTY_FOUR_BIT
66#undef THIRTY_TWO_BIT 66#undef THIRTY_TWO_BIT
@@ -88,7 +88,7 @@
88#endif 88#endif
89 89
90/* This helps C compiler generate the correct code for multiple functional 90/* This helps C compiler generate the correct code for multiple functional
91 * units. It reduces register dependancies at the expense of 2 more 91 * units. It reduces register dependencies at the expense of 2 more
92 * registers */ 92 * registers */
93#ifndef DES_RISC1 93#ifndef DES_RISC1
94#undef DES_RISC1 94#undef DES_RISC1
@@ -103,7 +103,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
103#endif 103#endif
104 104
105/* Unroll the inner loop, this sometimes helps, sometimes hinders. 105/* Unroll the inner loop, this sometimes helps, sometimes hinders.
106 * Very mucy CPU dependant */ 106 * Very much CPU dependent */
107#ifndef DES_UNROLL 107#ifndef DES_UNROLL
108#undef DES_UNROLL 108#undef DES_UNROLL
109#endif 109#endif
diff --git a/src/lib/libcrypto/arch/amd64/opensslconf.h b/src/lib/libcrypto/arch/amd64/opensslconf.h
index f8cbb5d652..5cad089a8b 100644
--- a/src/lib/libcrypto/arch/amd64/opensslconf.h
+++ b/src/lib/libcrypto/arch/amd64/opensslconf.h
@@ -85,7 +85,7 @@
85#endif 85#endif
86 86
87/* This helps C compiler generate the correct code for multiple functional 87/* This helps C compiler generate the correct code for multiple functional
88 * units. It reduces register dependancies at the expense of 2 more 88 * units. It reduces register dependencies at the expense of 2 more
89 * registers */ 89 * registers */
90#ifndef DES_RISC1 90#ifndef DES_RISC1
91#undef DES_RISC1 91#undef DES_RISC1
@@ -100,7 +100,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
100#endif 100#endif
101 101
102/* Unroll the inner loop, this sometimes helps, sometimes hinders. 102/* Unroll the inner loop, this sometimes helps, sometimes hinders.
103 * Very mucy CPU dependant */ 103 * Very much CPU dependent */
104#ifndef DES_UNROLL 104#ifndef DES_UNROLL
105#define DES_UNROLL 105#define DES_UNROLL
106#endif 106#endif
diff --git a/src/lib/libcrypto/arch/arm/opensslconf.h b/src/lib/libcrypto/arch/arm/opensslconf.h
index 78cd6d856f..f17d3d2803 100644
--- a/src/lib/libcrypto/arch/arm/opensslconf.h
+++ b/src/lib/libcrypto/arch/arm/opensslconf.h
@@ -60,7 +60,7 @@
60/* Only one for the following should be defined */ 60/* Only one for the following should be defined */
61/* The prime number generation stuff may not work when 61/* The prime number generation stuff may not work when
62 * EIGHT_BIT but I don't care since I've only used this mode 62 * EIGHT_BIT but I don't care since I've only used this mode
63 * for debuging the bignum libraries */ 63 * for debugging the bignum libraries */
64#undef SIXTY_FOUR_BIT_LONG 64#undef SIXTY_FOUR_BIT_LONG
65#undef SIXTY_FOUR_BIT 65#undef SIXTY_FOUR_BIT
66#define THIRTY_TWO_BIT 66#define THIRTY_TWO_BIT
@@ -90,7 +90,7 @@
90#endif 90#endif
91 91
92/* This helps C compiler generate the correct code for multiple functional 92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependancies at the expense of 2 more 93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */ 94 * registers */
95#ifndef DES_RISC1 95#ifndef DES_RISC1
96#undef DES_RISC1 96#undef DES_RISC1
@@ -105,7 +105,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif 105#endif
106 106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders. 107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very mucy CPU dependant */ 108 * Very much CPU dependent */
109#ifndef DES_UNROLL 109#ifndef DES_UNROLL
110#define DES_UNROLL 110#define DES_UNROLL
111#endif 111#endif
diff --git a/src/lib/libcrypto/arch/hppa/opensslconf.h b/src/lib/libcrypto/arch/hppa/opensslconf.h
index 78cd6d856f..f17d3d2803 100644
--- a/src/lib/libcrypto/arch/hppa/opensslconf.h
+++ b/src/lib/libcrypto/arch/hppa/opensslconf.h
@@ -60,7 +60,7 @@
60/* Only one for the following should be defined */ 60/* Only one for the following should be defined */
61/* The prime number generation stuff may not work when 61/* The prime number generation stuff may not work when
62 * EIGHT_BIT but I don't care since I've only used this mode 62 * EIGHT_BIT but I don't care since I've only used this mode
63 * for debuging the bignum libraries */ 63 * for debugging the bignum libraries */
64#undef SIXTY_FOUR_BIT_LONG 64#undef SIXTY_FOUR_BIT_LONG
65#undef SIXTY_FOUR_BIT 65#undef SIXTY_FOUR_BIT
66#define THIRTY_TWO_BIT 66#define THIRTY_TWO_BIT
@@ -90,7 +90,7 @@
90#endif 90#endif
91 91
92/* This helps C compiler generate the correct code for multiple functional 92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependancies at the expense of 2 more 93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */ 94 * registers */
95#ifndef DES_RISC1 95#ifndef DES_RISC1
96#undef DES_RISC1 96#undef DES_RISC1
@@ -105,7 +105,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif 105#endif
106 106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders. 107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very mucy CPU dependant */ 108 * Very much CPU dependent */
109#ifndef DES_UNROLL 109#ifndef DES_UNROLL
110#define DES_UNROLL 110#define DES_UNROLL
111#endif 111#endif
diff --git a/src/lib/libcrypto/arch/i386/opensslconf.h b/src/lib/libcrypto/arch/i386/opensslconf.h
index bf439696d8..3b3827cdb1 100644
--- a/src/lib/libcrypto/arch/i386/opensslconf.h
+++ b/src/lib/libcrypto/arch/i386/opensslconf.h
@@ -60,7 +60,7 @@
60/* Only one for the following should be defined */ 60/* Only one for the following should be defined */
61/* The prime number generation stuff may not work when 61/* The prime number generation stuff may not work when
62 * EIGHT_BIT but I don't care since I've only used this mode 62 * EIGHT_BIT but I don't care since I've only used this mode
63 * for debuging the bignum libraries */ 63 * for debugging the bignum libraries */
64#undef SIXTY_FOUR_BIT_LONG 64#undef SIXTY_FOUR_BIT_LONG
65#undef SIXTY_FOUR_BIT 65#undef SIXTY_FOUR_BIT
66#define THIRTY_TWO_BIT 66#define THIRTY_TWO_BIT
@@ -90,7 +90,7 @@
90#endif 90#endif
91 91
92/* This helps C compiler generate the correct code for multiple functional 92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependancies at the expense of 2 more 93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */ 94 * registers */
95#ifndef DES_RISC1 95#ifndef DES_RISC1
96#define DES_RISC1 96#define DES_RISC1
@@ -105,7 +105,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif 105#endif
106 106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders. 107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very mucy CPU dependant */ 108 * Very much CPU dependent */
109#ifndef DES_UNROLL 109#ifndef DES_UNROLL
110#define DES_UNROLL 110#define DES_UNROLL
111#endif 111#endif
diff --git a/src/lib/libcrypto/arch/m88k/opensslconf.h b/src/lib/libcrypto/arch/m88k/opensslconf.h
index 78cd6d856f..f17d3d2803 100644
--- a/src/lib/libcrypto/arch/m88k/opensslconf.h
+++ b/src/lib/libcrypto/arch/m88k/opensslconf.h
@@ -60,7 +60,7 @@
60/* Only one for the following should be defined */ 60/* Only one for the following should be defined */
61/* The prime number generation stuff may not work when 61/* The prime number generation stuff may not work when
62 * EIGHT_BIT but I don't care since I've only used this mode 62 * EIGHT_BIT but I don't care since I've only used this mode
63 * for debuging the bignum libraries */ 63 * for debugging the bignum libraries */
64#undef SIXTY_FOUR_BIT_LONG 64#undef SIXTY_FOUR_BIT_LONG
65#undef SIXTY_FOUR_BIT 65#undef SIXTY_FOUR_BIT
66#define THIRTY_TWO_BIT 66#define THIRTY_TWO_BIT
@@ -90,7 +90,7 @@
90#endif 90#endif
91 91
92/* This helps C compiler generate the correct code for multiple functional 92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependancies at the expense of 2 more 93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */ 94 * registers */
95#ifndef DES_RISC1 95#ifndef DES_RISC1
96#undef DES_RISC1 96#undef DES_RISC1
@@ -105,7 +105,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif 105#endif
106 106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders. 107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very mucy CPU dependant */ 108 * Very much CPU dependent */
109#ifndef DES_UNROLL 109#ifndef DES_UNROLL
110#define DES_UNROLL 110#define DES_UNROLL
111#endif 111#endif
diff --git a/src/lib/libcrypto/arch/mips64/opensslconf.h b/src/lib/libcrypto/arch/mips64/opensslconf.h
index 226951eded..ed1204c8c1 100644
--- a/src/lib/libcrypto/arch/mips64/opensslconf.h
+++ b/src/lib/libcrypto/arch/mips64/opensslconf.h
@@ -60,7 +60,7 @@
60/* Only one for the following should be defined */ 60/* Only one for the following should be defined */
61/* The prime number generation stuff may not work when 61/* The prime number generation stuff may not work when
62 * EIGHT_BIT but I don't care since I've only used this mode 62 * EIGHT_BIT but I don't care since I've only used this mode
63 * for debuging the bignum libraries */ 63 * for debugging the bignum libraries */
64#define SIXTY_FOUR_BIT_LONG 64#define SIXTY_FOUR_BIT_LONG
65#undef SIXTY_FOUR_BIT 65#undef SIXTY_FOUR_BIT
66#undef THIRTY_TWO_BIT 66#undef THIRTY_TWO_BIT
@@ -90,7 +90,7 @@
90#endif 90#endif
91 91
92/* This helps C compiler generate the correct code for multiple functional 92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependancies at the expense of 2 more 93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */ 94 * registers */
95#ifndef DES_RISC1 95#ifndef DES_RISC1
96#undef DES_RISC1 96#undef DES_RISC1
@@ -105,7 +105,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif 105#endif
106 106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders. 107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very mucy CPU dependant */ 108 * Very much CPU dependent */
109#ifndef DES_UNROLL 109#ifndef DES_UNROLL
110#undef DES_UNROLL 110#undef DES_UNROLL
111#endif 111#endif
diff --git a/src/lib/libcrypto/arch/powerpc/opensslconf.h b/src/lib/libcrypto/arch/powerpc/opensslconf.h
index 78cd6d856f..f17d3d2803 100644
--- a/src/lib/libcrypto/arch/powerpc/opensslconf.h
+++ b/src/lib/libcrypto/arch/powerpc/opensslconf.h
@@ -60,7 +60,7 @@
60/* Only one for the following should be defined */ 60/* Only one for the following should be defined */
61/* The prime number generation stuff may not work when 61/* The prime number generation stuff may not work when
62 * EIGHT_BIT but I don't care since I've only used this mode 62 * EIGHT_BIT but I don't care since I've only used this mode
63 * for debuging the bignum libraries */ 63 * for debugging the bignum libraries */
64#undef SIXTY_FOUR_BIT_LONG 64#undef SIXTY_FOUR_BIT_LONG
65#undef SIXTY_FOUR_BIT 65#undef SIXTY_FOUR_BIT
66#define THIRTY_TWO_BIT 66#define THIRTY_TWO_BIT
@@ -90,7 +90,7 @@
90#endif 90#endif
91 91
92/* This helps C compiler generate the correct code for multiple functional 92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependancies at the expense of 2 more 93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */ 94 * registers */
95#ifndef DES_RISC1 95#ifndef DES_RISC1
96#undef DES_RISC1 96#undef DES_RISC1
@@ -105,7 +105,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif 105#endif
106 106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders. 107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very mucy CPU dependant */ 108 * Very much CPU dependent */
109#ifndef DES_UNROLL 109#ifndef DES_UNROLL
110#define DES_UNROLL 110#define DES_UNROLL
111#endif 111#endif
diff --git a/src/lib/libcrypto/arch/powerpc64/opensslconf.h b/src/lib/libcrypto/arch/powerpc64/opensslconf.h
index f8cbb5d652..5cad089a8b 100644
--- a/src/lib/libcrypto/arch/powerpc64/opensslconf.h
+++ b/src/lib/libcrypto/arch/powerpc64/opensslconf.h
@@ -85,7 +85,7 @@
85#endif 85#endif
86 86
87/* This helps C compiler generate the correct code for multiple functional 87/* This helps C compiler generate the correct code for multiple functional
88 * units. It reduces register dependancies at the expense of 2 more 88 * units. It reduces register dependencies at the expense of 2 more
89 * registers */ 89 * registers */
90#ifndef DES_RISC1 90#ifndef DES_RISC1
91#undef DES_RISC1 91#undef DES_RISC1
@@ -100,7 +100,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
100#endif 100#endif
101 101
102/* Unroll the inner loop, this sometimes helps, sometimes hinders. 102/* Unroll the inner loop, this sometimes helps, sometimes hinders.
103 * Very mucy CPU dependant */ 103 * Very much CPU dependent */
104#ifndef DES_UNROLL 104#ifndef DES_UNROLL
105#define DES_UNROLL 105#define DES_UNROLL
106#endif 106#endif
diff --git a/src/lib/libcrypto/arch/riscv64/opensslconf.h b/src/lib/libcrypto/arch/riscv64/opensslconf.h
index ab3e2d89b0..748ed8f8b4 100644
--- a/src/lib/libcrypto/arch/riscv64/opensslconf.h
+++ b/src/lib/libcrypto/arch/riscv64/opensslconf.h
@@ -60,7 +60,7 @@
60/* Only one for the following should be defined */ 60/* Only one for the following should be defined */
61/* The prime number generation stuff may not work when 61/* The prime number generation stuff may not work when
62 * EIGHT_BIT but I don't care since I've only used this mode 62 * EIGHT_BIT but I don't care since I've only used this mode
63 * for debuging the bignum libraries */ 63 * for debugging the bignum libraries */
64#define SIXTY_FOUR_BIT_LONG 64#define SIXTY_FOUR_BIT_LONG
65#undef SIXTY_FOUR_BIT 65#undef SIXTY_FOUR_BIT
66#undef THIRTY_TWO_BIT 66#undef THIRTY_TWO_BIT
@@ -90,7 +90,7 @@
90#endif 90#endif
91 91
92/* This helps C compiler generate the correct code for multiple functional 92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependancies at the expense of 2 more 93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */ 94 * registers */
95#ifndef DES_RISC1 95#ifndef DES_RISC1
96#undef DES_RISC1 96#undef DES_RISC1
@@ -105,7 +105,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif 105#endif
106 106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders. 107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very mucy CPU dependant */ 108 * Very much CPU dependent */
109#ifndef DES_UNROLL 109#ifndef DES_UNROLL
110#define DES_UNROLL 110#define DES_UNROLL
111#endif 111#endif
diff --git a/src/lib/libcrypto/arch/sh/opensslconf.h b/src/lib/libcrypto/arch/sh/opensslconf.h
index 78cd6d856f..f17d3d2803 100644
--- a/src/lib/libcrypto/arch/sh/opensslconf.h
+++ b/src/lib/libcrypto/arch/sh/opensslconf.h
@@ -60,7 +60,7 @@
60/* Only one for the following should be defined */ 60/* Only one for the following should be defined */
61/* The prime number generation stuff may not work when 61/* The prime number generation stuff may not work when
62 * EIGHT_BIT but I don't care since I've only used this mode 62 * EIGHT_BIT but I don't care since I've only used this mode
63 * for debuging the bignum libraries */ 63 * for debugging the bignum libraries */
64#undef SIXTY_FOUR_BIT_LONG 64#undef SIXTY_FOUR_BIT_LONG
65#undef SIXTY_FOUR_BIT 65#undef SIXTY_FOUR_BIT
66#define THIRTY_TWO_BIT 66#define THIRTY_TWO_BIT
@@ -90,7 +90,7 @@
90#endif 90#endif
91 91
92/* This helps C compiler generate the correct code for multiple functional 92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependancies at the expense of 2 more 93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */ 94 * registers */
95#ifndef DES_RISC1 95#ifndef DES_RISC1
96#undef DES_RISC1 96#undef DES_RISC1
@@ -105,7 +105,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif 105#endif
106 106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders. 107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very mucy CPU dependant */ 108 * Very much CPU dependent */
109#ifndef DES_UNROLL 109#ifndef DES_UNROLL
110#define DES_UNROLL 110#define DES_UNROLL
111#endif 111#endif
diff --git a/src/lib/libcrypto/arch/sparc/opensslconf.h b/src/lib/libcrypto/arch/sparc/opensslconf.h
index 78cd6d856f..f17d3d2803 100644
--- a/src/lib/libcrypto/arch/sparc/opensslconf.h
+++ b/src/lib/libcrypto/arch/sparc/opensslconf.h
@@ -60,7 +60,7 @@
60/* Only one for the following should be defined */ 60/* Only one for the following should be defined */
61/* The prime number generation stuff may not work when 61/* The prime number generation stuff may not work when
62 * EIGHT_BIT but I don't care since I've only used this mode 62 * EIGHT_BIT but I don't care since I've only used this mode
63 * for debuging the bignum libraries */ 63 * for debugging the bignum libraries */
64#undef SIXTY_FOUR_BIT_LONG 64#undef SIXTY_FOUR_BIT_LONG
65#undef SIXTY_FOUR_BIT 65#undef SIXTY_FOUR_BIT
66#define THIRTY_TWO_BIT 66#define THIRTY_TWO_BIT
@@ -90,7 +90,7 @@
90#endif 90#endif
91 91
92/* This helps C compiler generate the correct code for multiple functional 92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependancies at the expense of 2 more 93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */ 94 * registers */
95#ifndef DES_RISC1 95#ifndef DES_RISC1
96#undef DES_RISC1 96#undef DES_RISC1
@@ -105,7 +105,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif 105#endif
106 106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders. 107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very mucy CPU dependant */ 108 * Very much CPU dependent */
109#ifndef DES_UNROLL 109#ifndef DES_UNROLL
110#define DES_UNROLL 110#define DES_UNROLL
111#endif 111#endif
diff --git a/src/lib/libcrypto/arch/sparc64/opensslconf.h b/src/lib/libcrypto/arch/sparc64/opensslconf.h
index 226951eded..ed1204c8c1 100644
--- a/src/lib/libcrypto/arch/sparc64/opensslconf.h
+++ b/src/lib/libcrypto/arch/sparc64/opensslconf.h
@@ -60,7 +60,7 @@
60/* Only one for the following should be defined */ 60/* Only one for the following should be defined */
61/* The prime number generation stuff may not work when 61/* The prime number generation stuff may not work when
62 * EIGHT_BIT but I don't care since I've only used this mode 62 * EIGHT_BIT but I don't care since I've only used this mode
63 * for debuging the bignum libraries */ 63 * for debugging the bignum libraries */
64#define SIXTY_FOUR_BIT_LONG 64#define SIXTY_FOUR_BIT_LONG
65#undef SIXTY_FOUR_BIT 65#undef SIXTY_FOUR_BIT
66#undef THIRTY_TWO_BIT 66#undef THIRTY_TWO_BIT
@@ -90,7 +90,7 @@
90#endif 90#endif
91 91
92/* This helps C compiler generate the correct code for multiple functional 92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependancies at the expense of 2 more 93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */ 94 * registers */
95#ifndef DES_RISC1 95#ifndef DES_RISC1
96#undef DES_RISC1 96#undef DES_RISC1
@@ -105,7 +105,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif 105#endif
106 106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders. 107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very mucy CPU dependant */ 108 * Very much CPU dependent */
109#ifndef DES_UNROLL 109#ifndef DES_UNROLL
110#undef DES_UNROLL 110#undef DES_UNROLL
111#endif 111#endif
diff --git a/src/lib/libcrypto/asn1/a_mbstr.c b/src/lib/libcrypto/asn1/a_mbstr.c
index 06b674ef41..32b39ad5db 100644
--- a/src/lib/libcrypto/asn1/a_mbstr.c
+++ b/src/lib/libcrypto/asn1/a_mbstr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_mbstr.c,v 1.25 2022/11/26 16:08:50 tb Exp $ */ 1/* $OpenBSD: a_mbstr.c,v 1.26 2022/12/26 07:18:51 jmc Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -276,7 +276,7 @@ traverse_string(const unsigned char *p, int len, int inform,
276 case MBSTRING_BMP: 276 case MBSTRING_BMP:
277 value = *p++ << 8; 277 value = *p++ << 8;
278 value |= *p++; 278 value |= *p++;
279 /* BMP is explictly defined to not support surrogates */ 279 /* BMP is explicitly defined to not support surrogates */
280 if (UNICODE_IS_SURROGATE(value)) 280 if (UNICODE_IS_SURROGATE(value))
281 return -1; 281 return -1;
282 len -= 2; 282 len -= 2;
diff --git a/src/lib/libcrypto/asn1/tasn_utl.c b/src/lib/libcrypto/asn1/tasn_utl.c
index 86cd42eec7..ae546edd4b 100644
--- a/src/lib/libcrypto/asn1/tasn_utl.c
+++ b/src/lib/libcrypto/asn1/tasn_utl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_utl.c,v 1.17 2022/05/12 19:55:58 jsing Exp $ */ 1/* $OpenBSD: tasn_utl.c,v 1.18 2022/12/26 07:18:51 jmc Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -100,7 +100,7 @@ asn1_set_choice_selector(ASN1_VALUE **pval, int value, const ASN1_ITEM *it)
100/* Do reference counting. The value 'op' decides what to do. 100/* Do reference counting. The value 'op' decides what to do.
101 * if it is +1 then the count is incremented. If op is 0 count is 101 * if it is +1 then the count is incremented. If op is 0 count is
102 * set to 1. If op is -1 count is decremented and the return value 102 * set to 1. If op is -1 count is decremented and the return value
103 * is the current refrence count or 0 if no reference count exists. 103 * is the current reference count or 0 if no reference count exists.
104 */ 104 */
105 105
106int 106int
diff --git a/src/lib/libcrypto/bio/bss_dgram.c b/src/lib/libcrypto/bio/bss_dgram.c
index fa6e2db917..0d70daa20e 100644
--- a/src/lib/libcrypto/bio/bss_dgram.c
+++ b/src/lib/libcrypto/bio/bss_dgram.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_dgram.c,v 1.43 2022/01/07 09:02:17 tb Exp $ */ 1/* $OpenBSD: bss_dgram.c,v 1.44 2022/12/26 07:18:51 jmc Exp $ */
2/* 2/*
3 * DTLS implementation written by Nagendra Modadugu 3 * DTLS implementation written by Nagendra Modadugu
4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 4 * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -214,7 +214,7 @@ dgram_adjust_rcv_timeout(BIO *b)
214 timeleft.tv_usec = 1; 214 timeleft.tv_usec = 1;
215 } 215 }
216 216
217 /* Adjust socket timeout if next handhake message timer 217 /* Adjust socket timeout if next handshake message timer
218 * will expire earlier. 218 * will expire earlier.
219 */ 219 */
220 if ((data->socket_timeout.tv_sec == 0 && 220 if ((data->socket_timeout.tv_sec == 0 &&
diff --git a/src/lib/libcrypto/bn/asm/co-586.pl b/src/lib/libcrypto/bn/asm/co-586.pl
index 57101a6bd7..37d79cc0c1 100644
--- a/src/lib/libcrypto/bn/asm/co-586.pl
+++ b/src/lib/libcrypto/bn/asm/co-586.pl
@@ -28,17 +28,17 @@ sub mul_add_c
28 28
29 &mul("edx"); 29 &mul("edx");
30 &add($c0,"eax"); 30 &add($c0,"eax");
31 &mov("eax",&DWP(($na)*4,$a,"",0)) if $pos == 0; # laod next a 31 &mov("eax",&DWP(($na)*4,$a,"",0)) if $pos == 0; # load next a
32 &mov("eax",&wparam(0)) if $pos > 0; # load r[] 32 &mov("eax",&wparam(0)) if $pos > 0; # load r[]
33 ### 33 ###
34 &adc($c1,"edx"); 34 &adc($c1,"edx");
35 &mov("edx",&DWP(($nb)*4,$b,"",0)) if $pos == 0; # laod next b 35 &mov("edx",&DWP(($nb)*4,$b,"",0)) if $pos == 0; # load next b
36 &mov("edx",&DWP(($nb)*4,$b,"",0)) if $pos == 1; # laod next b 36 &mov("edx",&DWP(($nb)*4,$b,"",0)) if $pos == 1; # load next b
37 ### 37 ###
38 &adc($c2,0); 38 &adc($c2,0);
39 # is pos > 1, it means it is the last loop 39 # is pos > 1, it means it is the last loop
40 &mov(&DWP($i*4,"eax","",0),$c0) if $pos > 0; # save r[]; 40 &mov(&DWP($i*4,"eax","",0),$c0) if $pos > 0; # save r[];
41 &mov("eax",&DWP(($na)*4,$a,"",0)) if $pos == 1; # laod next a 41 &mov("eax",&DWP(($na)*4,$a,"",0)) if $pos == 1; # load next a
42 } 42 }
43 43
44sub sqr_add_c 44sub sqr_add_c
diff --git a/src/lib/libcrypto/bn/asm/mips.pl b/src/lib/libcrypto/bn/asm/mips.pl
index 215c9a7483..02d43e15b0 100644
--- a/src/lib/libcrypto/bn/asm/mips.pl
+++ b/src/lib/libcrypto/bn/asm/mips.pl
@@ -15,7 +15,7 @@
15# This is drop-in MIPS III/IV ISA replacement for crypto/bn/bn_asm.c. 15# This is drop-in MIPS III/IV ISA replacement for crypto/bn/bn_asm.c.
16# 16#
17# The module is designed to work with either of the "new" MIPS ABI(5), 17# The module is designed to work with either of the "new" MIPS ABI(5),
18# namely N32 or N64, offered by IRIX 6.x. It's not ment to work under 18# namely N32 or N64, offered by IRIX 6.x. It's not meant to work under
19# IRIX 5.x not only because it doesn't support new ABIs but also 19# IRIX 5.x not only because it doesn't support new ABIs but also
20# because 5.x kernels put R4x00 CPU into 32-bit mode and all those 20# because 5.x kernels put R4x00 CPU into 32-bit mode and all those
21# 64-bit instructions (daddu, dmultu, etc.) found below gonna only 21# 64-bit instructions (daddu, dmultu, etc.) found below gonna only
diff --git a/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl b/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl
index 4317282835..2e71a7f03d 100644
--- a/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl
+++ b/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl
@@ -1307,7 +1307,7 @@ end_main_loop_a3b:
1307 movdqa %xmm3, (+$tmp16_offset+16*3)(%rsp) 1307 movdqa %xmm3, (+$tmp16_offset+16*3)(%rsp)
1308 call mont_reduce 1308 call mont_reduce
1309 1309
1310 # If result > m, subract m 1310 # If result > m, subtract m
1311 # load result into r15:r8 1311 # load result into r15:r8
1312 mov (+$pResult_offset)(%rsp), %rax 1312 mov (+$pResult_offset)(%rsp), %rax
1313 mov (+8*0)(%rax), %r8 1313 mov (+8*0)(%rax), %r8
diff --git a/src/lib/libcrypto/bn/asm/pa-risc2W.s b/src/lib/libcrypto/bn/asm/pa-risc2W.s
index a99545754d..a91f3ea5af 100644
--- a/src/lib/libcrypto/bn/asm/pa-risc2W.s
+++ b/src/lib/libcrypto/bn/asm/pa-risc2W.s
@@ -783,7 +783,7 @@ $00000012
783 COPY %r0,%r10 ; ret = 0 783 COPY %r0,%r10 ; ret = 0
784 MTSARCM %r31 ; i to shift 784 MTSARCM %r31 ; i to shift
785 DEPD,Z %r3,%sar,64,%r3 ; d <<= i; 785 DEPD,Z %r3,%sar,64,%r3 ; d <<= i;
786 SUBI 64,%r31,%r19 ; 64 - i; redundent 786 SUBI 64,%r31,%r19 ; 64 - i; redundant
787 MTSAR %r19 ; (64 -i) to shift 787 MTSAR %r19 ; (64 -i) to shift
788 SHRPD %r4,%r5,%sar,%r4 ; l>> (64-i) 788 SHRPD %r4,%r5,%sar,%r4 ; l>> (64-i)
789 MTSARCM %r31 ; i to shift 789 MTSARCM %r31 ; i to shift
diff --git a/src/lib/libcrypto/bn/asm/parisc-mont.pl b/src/lib/libcrypto/bn/asm/parisc-mont.pl
index fcfdee1f1f..6da9574adf 100644
--- a/src/lib/libcrypto/bn/asm/parisc-mont.pl
+++ b/src/lib/libcrypto/bn/asm/parisc-mont.pl
@@ -116,7 +116,7 @@ $fp="%r3";
116$hi1="%r2"; 116$hi1="%r2";
117$hi0="%r1"; 117$hi0="%r1";
118 118
119$xfer=$n0; # accomodates [-16..15] offset in fld[dw]s 119$xfer=$n0; # accommodates [-16..15] offset in fld[dw]s
120 120
121$fm0="%fr4"; $fti=$fm0; 121$fm0="%fr4"; $fti=$fm0;
122$fbi="%fr5L"; 122$fbi="%fr5L";
diff --git a/src/lib/libcrypto/bn/asm/ppc.pl b/src/lib/libcrypto/bn/asm/ppc.pl
index 1249ce2299..34e38d8f6a 100644
--- a/src/lib/libcrypto/bn/asm/ppc.pl
+++ b/src/lib/libcrypto/bn/asm/ppc.pl
@@ -34,7 +34,7 @@
34#dsa 512 bits 0.0087s 0.0106s 114.3 94.5 34#dsa 512 bits 0.0087s 0.0106s 114.3 94.5
35#dsa 1024 bits 0.0256s 0.0313s 39.0 32.0 35#dsa 1024 bits 0.0256s 0.0313s 39.0 32.0
36# 36#
37# Same bechmark with this assembler code: 37# Same benchmark with this assembler code:
38# 38#
39#rsa 512 bits 0.0056s 0.0005s 178.6 2049.2 39#rsa 512 bits 0.0056s 0.0005s 178.6 2049.2
40#rsa 1024 bits 0.0283s 0.0015s 35.3 674.1 40#rsa 1024 bits 0.0283s 0.0015s 35.3 674.1
diff --git a/src/lib/libcrypto/bn/asm/ppc64-mont.pl b/src/lib/libcrypto/bn/asm/ppc64-mont.pl
index a14e769ad0..a9291f4bf7 100644
--- a/src/lib/libcrypto/bn/asm/ppc64-mont.pl
+++ b/src/lib/libcrypto/bn/asm/ppc64-mont.pl
@@ -919,7 +919,7 @@ $code.=<<___;
919 std $t3,-16($tp) ; tp[j-1] 919 std $t3,-16($tp) ; tp[j-1]
920 std $t5,-8($tp) ; tp[j] 920 std $t5,-8($tp) ; tp[j]
921 921
922 add $carry,$carry,$ovf ; comsume upmost overflow 922 add $carry,$carry,$ovf ; consume upmost overflow
923 add $t6,$t6,$carry ; can not overflow 923 add $t6,$t6,$carry ; can not overflow
924 srdi $carry,$t6,16 924 srdi $carry,$t6,16
925 add $t7,$t7,$carry 925 add $t7,$t7,$carry
diff --git a/src/lib/libcrypto/bn/asm/sparcv9-mont.pl b/src/lib/libcrypto/bn/asm/sparcv9-mont.pl
index b8fb1e8a25..fb44c01443 100644
--- a/src/lib/libcrypto/bn/asm/sparcv9-mont.pl
+++ b/src/lib/libcrypto/bn/asm/sparcv9-mont.pl
@@ -13,7 +13,7 @@
13# for undertaken effort are multiple. First of all, UltraSPARC is not 13# for undertaken effort are multiple. First of all, UltraSPARC is not
14# the whole SPARCv9 universe and other VIS-free implementations deserve 14# the whole SPARCv9 universe and other VIS-free implementations deserve
15# optimized code as much. Secondly, newly introduced UltraSPARC T1, 15# optimized code as much. Secondly, newly introduced UltraSPARC T1,
16# a.k.a. Niagara, has shared FPU and concurrent FPU-intensive pathes, 16# a.k.a. Niagara, has shared FPU and concurrent FPU-intensive paths,
17# such as sparcv9a-mont, will simply sink it. Yes, T1 is equipped with 17# such as sparcv9a-mont, will simply sink it. Yes, T1 is equipped with
18# several integrated RSA/DSA accelerator circuits accessible through 18# several integrated RSA/DSA accelerator circuits accessible through
19# kernel driver [only(*)], but having decent user-land software 19# kernel driver [only(*)], but having decent user-land software
diff --git a/src/lib/libcrypto/bn/asm/sparcv9a-mont.pl b/src/lib/libcrypto/bn/asm/sparcv9a-mont.pl
index a14205f2f0..4ebe15c5c0 100755
--- a/src/lib/libcrypto/bn/asm/sparcv9a-mont.pl
+++ b/src/lib/libcrypto/bn/asm/sparcv9a-mont.pl
@@ -51,7 +51,7 @@
51# 51#
52# Modulo-scheduled inner loops allow to interleave floating point and 52# Modulo-scheduled inner loops allow to interleave floating point and
53# integer instructions and minimize Read-After-Write penalties. This 53# integer instructions and minimize Read-After-Write penalties. This
54# results in *further* 20-50% perfromance improvement [depending on 54# results in *further* 20-50% performance improvement [depending on
55# key length, more for longer keys] on USI&II cores and 30-80% - on 55# key length, more for longer keys] on USI&II cores and 30-80% - on
56# USIII&IV. 56# USIII&IV.
57 57
@@ -867,7 +867,7 @@ ___
867$code =~ s/\`([^\`]*)\`/eval($1)/gem; 867$code =~ s/\`([^\`]*)\`/eval($1)/gem;
868 868
869# Below substitution makes it possible to compile without demanding 869# Below substitution makes it possible to compile without demanding
870# VIS extentions on command line, e.g. -xarch=v9 vs. -xarch=v9a. I 870# VIS extensions on command line, e.g. -xarch=v9 vs. -xarch=v9a. I
871# dare to do this, because VIS capability is detected at run-time now 871# dare to do this, because VIS capability is detected at run-time now
872# and this routine is not called on CPU not capable to execute it. Do 872# and this routine is not called on CPU not capable to execute it. Do
873# note that fzeros is not the only VIS dependency! Another dependency 873# note that fzeros is not the only VIS dependency! Another dependency
diff --git a/src/lib/libcrypto/bn/asm/x86-gf2m.pl b/src/lib/libcrypto/bn/asm/x86-gf2m.pl
index 97d9136260..9715b2158f 100644
--- a/src/lib/libcrypto/bn/asm/x86-gf2m.pl
+++ b/src/lib/libcrypto/bn/asm/x86-gf2m.pl
@@ -142,7 +142,7 @@ $R="mm0";
142 &xor ($a4,$a2); # a2=a4^a2^a4 142 &xor ($a4,$a2); # a2=a4^a2^a4
143 &mov (&DWP(5*4,"esp"),$a1); # a1^a4 143 &mov (&DWP(5*4,"esp"),$a1); # a1^a4
144 &xor ($a4,$a1); # a1^a2^a4 144 &xor ($a4,$a1); # a1^a2^a4
145 &sar (@i[1],31); # broardcast 30th bit 145 &sar (@i[1],31); # broadcast 30th bit
146 &and ($lo,$b); 146 &and ($lo,$b);
147 &mov (&DWP(6*4,"esp"),$a2); # a2^a4 147 &mov (&DWP(6*4,"esp"),$a2); # a2^a4
148 &and (@i[1],$b); 148 &and (@i[1],$b);
diff --git a/src/lib/libcrypto/bn/asm/x86-mont.pl b/src/lib/libcrypto/bn/asm/x86-mont.pl
index a0bdd5787e..e6c04739b1 100755
--- a/src/lib/libcrypto/bn/asm/x86-mont.pl
+++ b/src/lib/libcrypto/bn/asm/x86-mont.pl
@@ -69,7 +69,7 @@ $frame=32; # size of above frame rounded up to 16n
69 &lea ("esp",&DWP(-$frame,"esp","edi",4)); # alloca($frame+4*(num+2)) 69 &lea ("esp",&DWP(-$frame,"esp","edi",4)); # alloca($frame+4*(num+2))
70 &neg ("edi"); 70 &neg ("edi");
71 71
72 # minimize cache contention by arraning 2K window between stack 72 # minimize cache contention by arranging 2K window between stack
73 # pointer and ap argument [np is also position sensitive vector, 73 # pointer and ap argument [np is also position sensitive vector,
74 # but it's assumed to be near ap, as it's allocated at ~same 74 # but it's assumed to be near ap, as it's allocated at ~same
75 # time]. 75 # time].
@@ -267,7 +267,7 @@ if (0) {
267 &xor ("eax","eax"); # signal "not fast enough [yet]" 267 &xor ("eax","eax"); # signal "not fast enough [yet]"
268 &jmp (&label("just_leave")); 268 &jmp (&label("just_leave"));
269 # While the below code provides competitive performance for 269 # While the below code provides competitive performance for
270 # all key lengthes on modern Intel cores, it's still more 270 # all key lengths on modern Intel cores, it's still more
271 # than 10% slower for 4096-bit key elsewhere:-( "Competitive" 271 # than 10% slower for 4096-bit key elsewhere:-( "Competitive"
272 # means compared to the original integer-only assembler. 272 # means compared to the original integer-only assembler.
273 # 512-bit RSA sign is better by ~40%, but that's about all 273 # 512-bit RSA sign is better by ~40%, but that's about all
diff --git a/src/lib/libcrypto/bn/asm/x86/comba.pl b/src/lib/libcrypto/bn/asm/x86/comba.pl
index dc4ec97ff5..762412974a 100644
--- a/src/lib/libcrypto/bn/asm/x86/comba.pl
+++ b/src/lib/libcrypto/bn/asm/x86/comba.pl
@@ -16,17 +16,17 @@ sub mul_add_c
16 16
17 &mul("edx"); 17 &mul("edx");
18 &add($c0,"eax"); 18 &add($c0,"eax");
19 &mov("eax",&DWP(($na)*4,$a,"",0)) if $pos == 0; # laod next a 19 &mov("eax",&DWP(($na)*4,$a,"",0)) if $pos == 0; # load next a
20 &mov("eax",&wparam(0)) if $pos > 0; # load r[] 20 &mov("eax",&wparam(0)) if $pos > 0; # load r[]
21 ### 21 ###
22 &adc($c1,"edx"); 22 &adc($c1,"edx");
23 &mov("edx",&DWP(($nb)*4,$b,"",0)) if $pos == 0; # laod next b 23 &mov("edx",&DWP(($nb)*4,$b,"",0)) if $pos == 0; # load next b
24 &mov("edx",&DWP(($nb)*4,$b,"",0)) if $pos == 1; # laod next b 24 &mov("edx",&DWP(($nb)*4,$b,"",0)) if $pos == 1; # load next b
25 ### 25 ###
26 &adc($c2,0); 26 &adc($c2,0);
27 # is pos > 1, it means it is the last loop 27 # is pos > 1, it means it is the last loop
28 &mov(&DWP($i*4,"eax","",0),$c0) if $pos > 0; # save r[]; 28 &mov(&DWP($i*4,"eax","",0),$c0) if $pos > 0; # save r[];
29 &mov("eax",&DWP(($na)*4,$a,"",0)) if $pos == 1; # laod next a 29 &mov("eax",&DWP(($na)*4,$a,"",0)) if $pos == 1; # load next a
30 } 30 }
31 31
32sub sqr_add_c 32sub sqr_add_c
diff --git a/src/lib/libcrypto/bn/asm/x86_64-gf2m.pl b/src/lib/libcrypto/bn/asm/x86_64-gf2m.pl
index 3ecb425dad..24dacb1e9c 100644
--- a/src/lib/libcrypto/bn/asm/x86_64-gf2m.pl
+++ b/src/lib/libcrypto/bn/asm/x86_64-gf2m.pl
@@ -59,7 +59,7 @@ _mul_1x1:
59 sar \$63,$i0 # broadcast 62nd bit 59 sar \$63,$i0 # broadcast 62nd bit
60 lea (,$a1,4),$a4 60 lea (,$a1,4),$a4
61 and $b,$a 61 and $b,$a
62 sar \$63,$i1 # boardcast 61st bit 62 sar \$63,$i1 # broadcast 61st bit
63 mov $a,$hi # $a is $lo 63 mov $a,$hi # $a is $lo
64 shl \$63,$lo 64 shl \$63,$lo
65 and $b,$i0 65 and $b,$i0
diff --git a/src/lib/libcrypto/bn/bn_div.c b/src/lib/libcrypto/bn/bn_div.c
index a62e74da5d..d0adc4688f 100644
--- a/src/lib/libcrypto/bn/bn_div.c
+++ b/src/lib/libcrypto/bn/bn_div.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_div.c,v 1.28 2022/11/26 16:08:51 tb Exp $ */ 1/* $OpenBSD: bn_div.c,v 1.29 2022/12/26 07:18:51 jmc Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -327,7 +327,7 @@ BN_div_internal(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor
327 l0 = bn_mul_words(tmp->d, sdiv->d, div_n, q); 327 l0 = bn_mul_words(tmp->d, sdiv->d, div_n, q);
328 tmp->d[div_n] = l0; 328 tmp->d[div_n] = l0;
329 wnum.d--; 329 wnum.d--;
330 /* ingore top values of the bignums just sub the two 330 /* ignore top values of the bignums just sub the two
331 * BN_ULONG arrays with bn_sub_words */ 331 * BN_ULONG arrays with bn_sub_words */
332 if (bn_sub_words(wnum.d, wnum.d, tmp->d, div_n + 1)) { 332 if (bn_sub_words(wnum.d, wnum.d, tmp->d, div_n + 1)) {
333 /* Note: As we have considered only the leading 333 /* Note: As we have considered only the leading
diff --git a/src/lib/libcrypto/bn/bn_gcd.c b/src/lib/libcrypto/bn/bn_gcd.c
index f3a23701b1..0d8bdf07eb 100644
--- a/src/lib/libcrypto/bn/bn_gcd.c
+++ b/src/lib/libcrypto/bn/bn_gcd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_gcd.c,v 1.19 2022/12/01 02:58:31 jsing Exp $ */ 1/* $OpenBSD: bn_gcd.c,v 1.20 2022/12/26 07:18:51 jmc Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -301,7 +301,7 @@ BN_mod_inverse_internal(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, BN_CTX *ct
301 /* Binary inversion algorithm; requires odd modulus. 301 /* Binary inversion algorithm; requires odd modulus.
302 * This is faster than the general algorithm if the modulus 302 * This is faster than the general algorithm if the modulus
303 * is sufficiently small (about 400 .. 500 bits on 32-bit 303 * is sufficiently small (about 400 .. 500 bits on 32-bit
304 * sytems, but much more on 64-bit systems) */ 304 * systems, but much more on 64-bit systems) */
305 int shift; 305 int shift;
306 306
307 while (!BN_is_zero(B)) { 307 while (!BN_is_zero(B)) {
diff --git a/src/lib/libcrypto/bn/bn_x931p.c b/src/lib/libcrypto/bn/bn_x931p.c
index b14e9810dd..e73c416e3f 100644
--- a/src/lib/libcrypto/bn/bn_x931p.c
+++ b/src/lib/libcrypto/bn/bn_x931p.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_x931p.c,v 1.14 2022/11/26 16:08:51 tb Exp $ */ 1/* $OpenBSD: bn_x931p.c,v 1.15 2022/12/26 07:18:51 jmc Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2005. 3 * project 2005.
4 */ 4 */
@@ -80,7 +80,7 @@ bn_x931_derive_pi(BIGNUM *pi, const BIGNUM *Xpi, BN_CTX *ctx, BN_GENCB *cb)
80 for (;;) { 80 for (;;) {
81 i++; 81 i++;
82 BN_GENCB_call(cb, 0, i); 82 BN_GENCB_call(cb, 0, i);
83 /* NB 27 MR is specificed in X9.31 */ 83 /* NB 27 MR is specified in X9.31 */
84 is_prime = BN_is_prime_fasttest_ex(pi, 27, ctx, 1, cb); 84 is_prime = BN_is_prime_fasttest_ex(pi, 27, ctx, 1, cb);
85 if (is_prime < 0) 85 if (is_prime < 0)
86 return 0; 86 return 0;
@@ -205,8 +205,8 @@ err:
205 return ret; 205 return ret;
206} 206}
207 207
208/* Generate pair of paramters Xp, Xq for X9.31 prime generation. 208/* Generate pair of parameters Xp, Xq for X9.31 prime generation.
209 * Note: nbits paramter is sum of number of bits in both. 209 * Note: nbits parameter is sum of number of bits in both.
210 */ 210 */
211 211
212int 212int
diff --git a/src/lib/libcrypto/cmac/cmac.c b/src/lib/libcrypto/cmac/cmac.c
index e7b343e216..7135f5306e 100644
--- a/src/lib/libcrypto/cmac/cmac.c
+++ b/src/lib/libcrypto/cmac/cmac.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cmac.c,v 1.12 2022/11/26 16:08:51 tb Exp $ */ 1/* $OpenBSD: cmac.c,v 1.13 2022/12/26 07:18:51 jmc Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project. 3 * project.
4 */ 4 */
@@ -167,7 +167,7 @@ CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
167 ctx->nlast_block = 0; 167 ctx->nlast_block = 0;
168 return 1; 168 return 1;
169 } 169 }
170 /* Initialiase context */ 170 /* Initialise context */
171 if (cipher && !EVP_EncryptInit_ex(&ctx->cctx, cipher, impl, NULL, NULL)) 171 if (cipher && !EVP_EncryptInit_ex(&ctx->cctx, cipher, impl, NULL, NULL))
172 return 0; 172 return 0;
173 /* Non-NULL key means initialisation complete */ 173 /* Non-NULL key means initialisation complete */
diff --git a/src/lib/libcrypto/comp/c_zlib.c b/src/lib/libcrypto/comp/c_zlib.c
index 6aac97e451..9db0ae26bc 100644
--- a/src/lib/libcrypto/comp/c_zlib.c
+++ b/src/lib/libcrypto/comp/c_zlib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: c_zlib.c,v 1.24 2022/12/24 07:12:09 tb Exp $ */ 1/* $OpenBSD: c_zlib.c,v 1.25 2022/12/26 07:18:51 jmc Exp $ */
2/* 2/*
3 * --------------------------------------------------------------------------- 3 * ---------------------------------------------------------------------------
4 * Major patches to this file were contributed by 4 * Major patches to this file were contributed by
@@ -143,7 +143,7 @@ static int zlib_stateful_expand_block(COMP_CTX *ctx, unsigned char *out,
143 unsigned int olen, unsigned char *in, unsigned int ilen); 143 unsigned int olen, unsigned char *in, unsigned int ilen);
144 144
145 145
146/* memory allocations functions for zlib intialization */ 146/* memory allocations functions for zlib initialization */
147static void* 147static void*
148zlib_zalloc(void* opaque, unsigned int no, unsigned int size) 148zlib_zalloc(void* opaque, unsigned int no, unsigned int size)
149{ 149{
@@ -297,7 +297,7 @@ COMP_zlib(void)
297#ifdef ZLIB 297#ifdef ZLIB
298 { 298 {
299 /* init zlib_stateful_ex_idx here so that in a multi-process 299 /* init zlib_stateful_ex_idx here so that in a multi-process
300 * application it's enough to intialize openssl before forking 300 * application it's enough to initialize openssl before forking
301 * (idx will be inherited in all the children) */ 301 * (idx will be inherited in all the children) */
302 if (zlib_stateful_ex_idx == -1) { 302 if (zlib_stateful_ex_idx == -1) {
303 CRYPTO_w_lock(CRYPTO_LOCK_COMP); 303 CRYPTO_w_lock(CRYPTO_LOCK_COMP);
diff --git a/src/lib/libcrypto/crypto.h b/src/lib/libcrypto/crypto.h
index 3b00f039fa..066f6246f6 100644
--- a/src/lib/libcrypto/crypto.h
+++ b/src/lib/libcrypto/crypto.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: crypto.h,v 1.57 2022/09/11 17:26:51 tb Exp $ */ 1/* $OpenBSD: crypto.h,v 1.58 2022/12/26 07:18:50 jmc Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -248,8 +248,8 @@ DECLARE_STACK_OF(void)
248 * The current classes are SSL_CTX, SSL, SSL_SESSION, and a few more */ 248 * The current classes are SSL_CTX, SSL, SSL_SESSION, and a few more */
249 249
250typedef struct crypto_ex_data_func_st { 250typedef struct crypto_ex_data_func_st {
251 long argl; /* Arbitary long */ 251 long argl; /* Arbitrary long */
252 void *argp; /* Arbitary void * */ 252 void *argp; /* Arbitrary void * */
253 CRYPTO_EX_new *new_func; 253 CRYPTO_EX_new *new_func;
254 CRYPTO_EX_free *free_func; 254 CRYPTO_EX_free *free_func;
255 CRYPTO_EX_dup *dup_func; 255 CRYPTO_EX_dup *dup_func;
@@ -540,7 +540,7 @@ void ERR_load_CRYPTO_strings(void);
540#define _OPENSSL_INIT_FLAG_NOOP 0x80000000L 540#define _OPENSSL_INIT_FLAG_NOOP 0x80000000L
541 541
542/* 542/*
543 * These are provided for compatibiliy, but have no effect 543 * These are provided for compatibility, but have no effect
544 * on how LibreSSL is initialized. 544 * on how LibreSSL is initialized.
545 */ 545 */
546#define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS _OPENSSL_INIT_FLAG_NOOP 546#define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS _OPENSSL_INIT_FLAG_NOOP
diff --git a/src/lib/libcrypto/des/asm/des_enc.m4 b/src/lib/libcrypto/des/asm/des_enc.m4
index 7303d40052..3fbb026dd3 100644
--- a/src/lib/libcrypto/des/asm/des_enc.m4
+++ b/src/lib/libcrypto/des/asm/des_enc.m4
@@ -124,7 +124,7 @@ changequote({,})
124! technique. 124! technique.
125! 125!
126! The macro also loads address sbox 1 to 5 to global 1 to 5, address 126! The macro also loads address sbox 1 to 5 to global 1 to 5, address
127! sbox 6 to local6, and addres sbox 8 to out3. 127! sbox 6 to local6, and address sbox 8 to out3.
128! 128!
129! Rotates the halfs 3 left to bring the sbox bits in convenient positions. 129! Rotates the halfs 3 left to bring the sbox bits in convenient positions.
130! 130!
@@ -266,7 +266,7 @@ define(ip_macro, {
266! other half (use). 266! other half (use).
267! 267!
268! In this version we do two rounds in a loop repeated 7 times 268! In this version we do two rounds in a loop repeated 7 times
269! and two rounds seperately. 269! and two rounds separately.
270! 270!
271! One half has the bits for the sboxes in the following positions: 271! One half has the bits for the sboxes in the following positions:
272! 272!
diff --git a/src/lib/libcrypto/dh/dh_ameth.c b/src/lib/libcrypto/dh/dh_ameth.c
index d21a8ddd07..a0bcf8a761 100644
--- a/src/lib/libcrypto/dh/dh_ameth.c
+++ b/src/lib/libcrypto/dh/dh_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_ameth.c,v 1.25 2022/11/26 16:08:51 tb Exp $ */ 1/* $OpenBSD: dh_ameth.c,v 1.26 2022/12/26 07:18:51 jmc Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -177,7 +177,7 @@ err:
177 177
178/* 178/*
179 * PKCS#8 DH is defined in PKCS#11 of all places. It is similar to DH in 179 * PKCS#8 DH is defined in PKCS#11 of all places. It is similar to DH in
180 * that the AlgorithmIdentifier contains the paramaters, the private key 180 * that the AlgorithmIdentifier contains the parameters, the private key
181 * is explcitly included and the pubkey must be recalculated. 181 * is explcitly included and the pubkey must be recalculated.
182 */ 182 */
183 183
diff --git a/src/lib/libcrypto/dso/dso.h b/src/lib/libcrypto/dso/dso.h
index ae07b0a5f7..c3963a8e01 100644
--- a/src/lib/libcrypto/dso/dso.h
+++ b/src/lib/libcrypto/dso/dso.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: dso.h,v 1.13 2022/07/12 14:42:49 kn Exp $ */ 1/* $OpenBSD: dso.h,v 1.14 2022/12/26 07:18:51 jmc Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -109,14 +109,14 @@ typedef struct dso_st DSO;
109 109
110/* The function prototype used for method functions (or caller-provided 110/* The function prototype used for method functions (or caller-provided
111 * callbacks) that transform filenames. They are passed a DSO structure pointer 111 * callbacks) that transform filenames. They are passed a DSO structure pointer
112 * (or NULL if they are to be used independantly of a DSO object) and a 112 * (or NULL if they are to be used independently of a DSO object) and a
113 * filename to transform. They should either return NULL (if there is an error 113 * filename to transform. They should either return NULL (if there is an error
114 * condition) or a newly allocated string containing the transformed form that 114 * condition) or a newly allocated string containing the transformed form that
115 * the caller will need to free with free() when done. */ 115 * the caller will need to free with free() when done. */
116typedef char* (*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *); 116typedef char* (*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *);
117/* The function prototype used for method functions (or caller-provided 117/* The function prototype used for method functions (or caller-provided
118 * callbacks) that merge two file specifications. They are passed a 118 * callbacks) that merge two file specifications. They are passed a
119 * DSO structure pointer (or NULL if they are to be used independantly of 119 * DSO structure pointer (or NULL if they are to be used independently of
120 * a DSO object) and two file specifications to merge. They should 120 * a DSO object) and two file specifications to merge. They should
121 * either return NULL (if there is an error condition) or a newly allocated 121 * either return NULL (if there is an error condition) or a newly allocated
122 * string containing the result of merging that the caller will need 122 * string containing the result of merging that the caller will need
@@ -285,7 +285,7 @@ DSO_METHOD *DSO_METHOD_dlfcn(void);
285 * containing 'addr' into 'sz' large caller-provided 'path' and 285 * containing 'addr' into 'sz' large caller-provided 'path' and
286 * returns the number of characters [including trailing zero] 286 * returns the number of characters [including trailing zero]
287 * written to it. If 'sz' is 0 or negative, 'path' is ignored and 287 * written to it. If 'sz' is 0 or negative, 'path' is ignored and
288 * required amount of charachers [including trailing zero] to 288 * required amount of characters [including trailing zero] to
289 * accommodate pathname is returned. If 'addr' is NULL, then 289 * accommodate pathname is returned. If 'addr' is NULL, then
290 * pathname of cryptolib itself is returned. Negative or zero 290 * pathname of cryptolib itself is returned. Negative or zero
291 * return value denotes error. 291 * return value denotes error.
diff --git a/src/lib/libcrypto/ec/asm/ecp_nistz256-armv4.pl b/src/lib/libcrypto/ec/asm/ecp_nistz256-armv4.pl
index f3205d673a..9e6c65905f 100644
--- a/src/lib/libcrypto/ec/asm/ecp_nistz256-armv4.pl
+++ b/src/lib/libcrypto/ec/asm/ecp_nistz256-armv4.pl
@@ -1,5 +1,5 @@
1#! /usr/bin/env perl 1#! /usr/bin/env perl
2# $OpenBSD: ecp_nistz256-armv4.pl,v 1.1 2016/11/04 17:33:19 miod Exp $ 2# $OpenBSD: ecp_nistz256-armv4.pl,v 1.2 2022/12/26 07:18:51 jmc Exp $
3# 3#
4# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. 4# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
5# 5#
@@ -179,7 +179,7 @@ __ecp_nistz256_add:
179 @ if a+b >= modulus, subtract modulus. 179 @ if a+b >= modulus, subtract modulus.
180 @ 180 @
181 @ But since comparison implies subtraction, we subtract 181 @ But since comparison implies subtraction, we subtract
182 @ modulus and then add it back if subraction borrowed. 182 @ modulus and then add it back if subtraction borrowed.
183 183
184 subs $a0,$a0,#-1 184 subs $a0,$a0,#-1
185 sbcs $a1,$a1,#-1 185 sbcs $a1,$a1,#-1
@@ -1090,7 +1090,7 @@ __ecp_nistz256_add_self:
1090 @ if a+b >= modulus, subtract modulus. 1090 @ if a+b >= modulus, subtract modulus.
1091 @ 1091 @
1092 @ But since comparison implies subtraction, we subtract 1092 @ But since comparison implies subtraction, we subtract
1093 @ modulus and then add it back if subraction borrowed. 1093 @ modulus and then add it back if subtraction borrowed.
1094 1094
1095 subs $a0,$a0,#-1 1095 subs $a0,$a0,#-1
1096 sbcs $a1,$a1,#-1 1096 sbcs $a1,$a1,#-1
diff --git a/src/lib/libcrypto/ec/asm/ecp_nistz256-sparcv9.pl b/src/lib/libcrypto/ec/asm/ecp_nistz256-sparcv9.pl
index 044eb457b6..49460fefdc 100644
--- a/src/lib/libcrypto/ec/asm/ecp_nistz256-sparcv9.pl
+++ b/src/lib/libcrypto/ec/asm/ecp_nistz256-sparcv9.pl
@@ -1,5 +1,5 @@
1#! /usr/bin/env perl 1#! /usr/bin/env perl
2# $OpenBSD: ecp_nistz256-sparcv9.pl,v 1.1 2016/11/04 17:33:20 miod Exp $ 2# $OpenBSD: ecp_nistz256-sparcv9.pl,v 1.2 2022/12/26 07:18:51 jmc Exp $
3# 3#
4# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. 4# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
5# 5#
@@ -350,7 +350,7 @@ __ecp_nistz256_add:
350 ! if a+b >= modulus, subtract modulus. 350 ! if a+b >= modulus, subtract modulus.
351 ! 351 !
352 ! But since comparison implies subtraction, we subtract 352 ! But since comparison implies subtraction, we subtract
353 ! modulus and then add it back if subraction borrowed. 353 ! modulus and then add it back if subtraction borrowed.
354 354
355 subcc @acc[0],-1,@acc[0] 355 subcc @acc[0],-1,@acc[0]
356 subccc @acc[1],-1,@acc[1] 356 subccc @acc[1],-1,@acc[1]
@@ -1805,7 +1805,7 @@ $code.=<<___;
1805 srlx $acc0,32,$t1 1805 srlx $acc0,32,$t1
1806 addxccc $acc3,$t2,$acc2 ! +=acc[0]*0xFFFFFFFF00000001 1806 addxccc $acc3,$t2,$acc2 ! +=acc[0]*0xFFFFFFFF00000001
1807 sub $acc0,$t0,$t2 ! acc0*0xFFFFFFFF00000001, low part 1807 sub $acc0,$t0,$t2 ! acc0*0xFFFFFFFF00000001, low part
1808 addxc %g0,$t3,$acc3 ! cant't overflow 1808 addxc %g0,$t3,$acc3 ! can't overflow
1809___ 1809___
1810} 1810}
1811$code.=<<___; 1811$code.=<<___;
diff --git a/src/lib/libcrypto/ec/ec.h b/src/lib/libcrypto/ec/ec.h
index 9a7c5de8a5..8cafc5522f 100644
--- a/src/lib/libcrypto/ec/ec.h
+++ b/src/lib/libcrypto/ec/ec.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec.h,v 1.29 2022/11/10 16:37:51 jsing Exp $ */ 1/* $OpenBSD: ec.h,v 1.30 2022/12/26 07:18:51 jmc Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller for the OpenSSL project. 3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */ 4 */
@@ -232,7 +232,7 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth);
232 * \param order the order of the group generated by the generator. 232 * \param order the order of the group generated by the generator.
233 * \param cofactor the index of the sub-group generated by the generator 233 * \param cofactor the index of the sub-group generated by the generator
234 * in the group of all points on the elliptic curve. 234 * in the group of all points on the elliptic curve.
235 * \return 1 on success and 0 if an error occured 235 * \return 1 on success and 0 if an error occurred
236 */ 236 */
237int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor); 237int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor);
238 238
@@ -246,7 +246,7 @@ const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
246 * \param group EC_GROUP object 246 * \param group EC_GROUP object
247 * \param order BIGNUM to which the order is copied 247 * \param order BIGNUM to which the order is copied
248 * \param ctx BN_CTX object (optional) 248 * \param ctx BN_CTX object (optional)
249 * \return 1 on success and 0 if an error occured 249 * \return 1 on success and 0 if an error occurred
250 */ 250 */
251int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx); 251int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx);
252 252
@@ -256,7 +256,7 @@ int EC_GROUP_order_bits(const EC_GROUP *group);
256 * \param group EC_GROUP object 256 * \param group EC_GROUP object
257 * \param cofactor BIGNUM to which the cofactor is copied 257 * \param cofactor BIGNUM to which the cofactor is copied
258 * \param ctx BN_CTX object (optional) 258 * \param ctx BN_CTX object (optional)
259 * \return 1 on success and 0 if an error occured 259 * \return 1 on success and 0 if an error occurred
260 */ 260 */
261int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx); 261int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx);
262 262
@@ -293,7 +293,7 @@ int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b,
293 * \param a BIGNUM with parameter a of the equation 293 * \param a BIGNUM with parameter a of the equation
294 * \param b BIGNUM with parameter b of the equation 294 * \param b BIGNUM with parameter b of the equation
295 * \param ctx BN_CTX object (optional) 295 * \param ctx BN_CTX object (optional)
296 * \return 1 on success and 0 if an error occured 296 * \return 1 on success and 0 if an error occurred
297 */ 297 */
298int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); 298int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
299 299
@@ -303,7 +303,7 @@ int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, co
303 * \param a BIGNUM for parameter a of the equation 303 * \param a BIGNUM for parameter a of the equation
304 * \param b BIGNUM for parameter b of the equation 304 * \param b BIGNUM for parameter b of the equation
305 * \param ctx BN_CTX object (optional) 305 * \param ctx BN_CTX object (optional)
306 * \return 1 on success and 0 if an error occured 306 * \return 1 on success and 0 if an error occurred
307 */ 307 */
308int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); 308int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
309 309
@@ -314,7 +314,7 @@ int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *
314 * \param a BIGNUM with parameter a of the equation 314 * \param a BIGNUM with parameter a of the equation
315 * \param b BIGNUM with parameter b of the equation 315 * \param b BIGNUM with parameter b of the equation
316 * \param ctx BN_CTX object (optional) 316 * \param ctx BN_CTX object (optional)
317 * \return 1 on success and 0 if an error occured 317 * \return 1 on success and 0 if an error occurred
318 */ 318 */
319int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); 319int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
320 320
@@ -324,7 +324,7 @@ int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, c
324 * \param a BIGNUM for parameter a of the equation 324 * \param a BIGNUM for parameter a of the equation
325 * \param b BIGNUM for parameter b of the equation 325 * \param b BIGNUM for parameter b of the equation
326 * \param ctx BN_CTX object (optional) 326 * \param ctx BN_CTX object (optional)
327 * \return 1 on success and 0 if an error occured 327 * \return 1 on success and 0 if an error occurred
328 */ 328 */
329int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); 329int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
330#endif 330#endif
@@ -430,7 +430,7 @@ void EC_POINT_clear_free(EC_POINT *point);
430/** Copies EC_POINT object 430/** Copies EC_POINT object
431 * \param dst destination EC_POINT object 431 * \param dst destination EC_POINT object
432 * \param src source EC_POINT object 432 * \param src source EC_POINT object
433 * \return 1 on success and 0 if an error occured 433 * \return 1 on success and 0 if an error occurred
434 */ 434 */
435int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src); 435int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
436 436
@@ -451,7 +451,7 @@ const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
451/** Sets a point to infinity (neutral element) 451/** Sets a point to infinity (neutral element)
452 * \param group underlying EC_GROUP object 452 * \param group underlying EC_GROUP object
453 * \param point EC_POINT to set to infinity 453 * \param point EC_POINT to set to infinity
454 * \return 1 on success and 0 if an error occured 454 * \return 1 on success and 0 if an error occurred
455 */ 455 */
456int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point); 456int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
457 457
@@ -478,7 +478,7 @@ int EC_POINT_get_Jprojective_coordinates(const EC_GROUP *group,
478 * \param y BIGNUM with the y-coordinate 478 * \param y BIGNUM with the y-coordinate
479 * \param z BIGNUM with the z-coordinate 479 * \param z BIGNUM with the z-coordinate
480 * \param ctx BN_CTX object (optional) 480 * \param ctx BN_CTX object (optional)
481 * \return 1 on success and 0 if an error occured 481 * \return 1 on success and 0 if an error occurred
482 */ 482 */
483int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, 483int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
484 const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx); 484 const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx);
@@ -490,7 +490,7 @@ int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
490 * \param y BIGNUM for the y-coordinate 490 * \param y BIGNUM for the y-coordinate
491 * \param z BIGNUM for the z-coordinate 491 * \param z BIGNUM for the z-coordinate
492 * \param ctx BN_CTX object (optional) 492 * \param ctx BN_CTX object (optional)
493 * \return 1 on success and 0 if an error occured 493 * \return 1 on success and 0 if an error occurred
494 */ 494 */
495int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, 495int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
496 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx); 496 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
@@ -501,7 +501,7 @@ int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
501 * \param x BIGNUM with the x-coordinate 501 * \param x BIGNUM with the x-coordinate
502 * \param y BIGNUM with the y-coordinate 502 * \param y BIGNUM with the y-coordinate
503 * \param ctx BN_CTX object (optional) 503 * \param ctx BN_CTX object (optional)
504 * \return 1 on success and 0 if an error occured 504 * \return 1 on success and 0 if an error occurred
505 */ 505 */
506int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, 506int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
507 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx); 507 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
@@ -512,7 +512,7 @@ int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
512 * \param x BIGNUM for the x-coordinate 512 * \param x BIGNUM for the x-coordinate
513 * \param y BIGNUM for the y-coordinate 513 * \param y BIGNUM for the y-coordinate
514 * \param ctx BN_CTX object (optional) 514 * \param ctx BN_CTX object (optional)
515 * \return 1 on success and 0 if an error occured 515 * \return 1 on success and 0 if an error occurred
516 */ 516 */
517int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, 517int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
518 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); 518 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
@@ -523,7 +523,7 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
523 * \param x BIGNUM with x-coordinate 523 * \param x BIGNUM with x-coordinate
524 * \param y_bit integer with the y-Bit (either 0 or 1) 524 * \param y_bit integer with the y-Bit (either 0 or 1)
525 * \param ctx BN_CTX object (optional) 525 * \param ctx BN_CTX object (optional)
526 * \return 1 on success and 0 if an error occured 526 * \return 1 on success and 0 if an error occurred
527 */ 527 */
528int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, 528int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
529 const BIGNUM *x, int y_bit, BN_CTX *ctx); 529 const BIGNUM *x, int y_bit, BN_CTX *ctx);
@@ -535,7 +535,7 @@ int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
535 * \param x BIGNUM with the x-coordinate 535 * \param x BIGNUM with the x-coordinate
536 * \param y BIGNUM with the y-coordinate 536 * \param y BIGNUM with the y-coordinate
537 * \param ctx BN_CTX object (optional) 537 * \param ctx BN_CTX object (optional)
538 * \return 1 on success and 0 if an error occured 538 * \return 1 on success and 0 if an error occurred
539 */ 539 */
540int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, 540int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
541 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx); 541 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
@@ -546,7 +546,7 @@ int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
546 * \param x BIGNUM for the x-coordinate 546 * \param x BIGNUM for the x-coordinate
547 * \param y BIGNUM for the y-coordinate 547 * \param y BIGNUM for the y-coordinate
548 * \param ctx BN_CTX object (optional) 548 * \param ctx BN_CTX object (optional)
549 * \return 1 on success and 0 if an error occured 549 * \return 1 on success and 0 if an error occurred
550 */ 550 */
551int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, 551int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
552 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); 552 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
@@ -557,7 +557,7 @@ int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
557 * \param x BIGNUM with x-coordinate 557 * \param x BIGNUM with x-coordinate
558 * \param y_bit integer with the y-Bit (either 0 or 1) 558 * \param y_bit integer with the y-Bit (either 0 or 1)
559 * \param ctx BN_CTX object (optional) 559 * \param ctx BN_CTX object (optional)
560 * \return 1 on success and 0 if an error occured 560 * \return 1 on success and 0 if an error occurred
561 */ 561 */
562int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, 562int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
563 const BIGNUM *x, int y_bit, BN_CTX *ctx); 563 const BIGNUM *x, int y_bit, BN_CTX *ctx);
@@ -584,7 +584,7 @@ size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,
584 * \param buf memory buffer with the encoded ec point 584 * \param buf memory buffer with the encoded ec point
585 * \param len length of the encoded ec point 585 * \param len length of the encoded ec point
586 * \param ctx BN_CTX object (optional) 586 * \param ctx BN_CTX object (optional)
587 * \return 1 on success and 0 if an error occured 587 * \return 1 on success and 0 if an error occurred
588 */ 588 */
589int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, 589int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p,
590 const unsigned char *buf, size_t len, BN_CTX *ctx); 590 const unsigned char *buf, size_t len, BN_CTX *ctx);
@@ -610,7 +610,7 @@ EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
610 * \param a EC_POINT object with the first summand 610 * \param a EC_POINT object with the first summand
611 * \param b EC_POINT object with the second summand 611 * \param b EC_POINT object with the second summand
612 * \param ctx BN_CTX object (optional) 612 * \param ctx BN_CTX object (optional)
613 * \return 1 on success and 0 if an error occured 613 * \return 1 on success and 0 if an error occurred
614 */ 614 */
615int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx); 615int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx);
616 616
@@ -619,7 +619,7 @@ int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC
619 * \param r EC_POINT object for the result (r = 2 * a) 619 * \param r EC_POINT object for the result (r = 2 * a)
620 * \param a EC_POINT object 620 * \param a EC_POINT object
621 * \param ctx BN_CTX object (optional) 621 * \param ctx BN_CTX object (optional)
622 * \return 1 on success and 0 if an error occured 622 * \return 1 on success and 0 if an error occurred
623 */ 623 */
624int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx); 624int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx);
625 625
@@ -627,7 +627,7 @@ int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *
627 * \param group underlying EC_GROUP object 627 * \param group underlying EC_GROUP object
628 * \param a EC_POINT object to be inverted (it's used for the result as well) 628 * \param a EC_POINT object to be inverted (it's used for the result as well)
629 * \param ctx BN_CTX object (optional) 629 * \param ctx BN_CTX object (optional)
630 * \return 1 on success and 0 if an error occured 630 * \return 1 on success and 0 if an error occurred
631 */ 631 */
632int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx); 632int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx);
633 633
@@ -662,11 +662,11 @@ int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[],
662 * \param group underlying EC_GROUP object 662 * \param group underlying EC_GROUP object
663 * \param r EC_POINT object for the result 663 * \param r EC_POINT object for the result
664 * \param n BIGNUM with the multiplier for the group generator (optional) 664 * \param n BIGNUM with the multiplier for the group generator (optional)
665 * \param num number futher summands 665 * \param num number further summands
666 * \param p array of size num of EC_POINT objects 666 * \param p array of size num of EC_POINT objects
667 * \param m array of size num of BIGNUM objects 667 * \param m array of size num of BIGNUM objects
668 * \param ctx BN_CTX object (optional) 668 * \param ctx BN_CTX object (optional)
669 * \return 1 on success and 0 if an error occured 669 * \return 1 on success and 0 if an error occurred
670 */ 670 */
671int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t num, const EC_POINT *p[], const BIGNUM *m[], BN_CTX *ctx); 671int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t num, const EC_POINT *p[], const BIGNUM *m[], BN_CTX *ctx);
672 672
@@ -677,14 +677,14 @@ int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t nu
677 * \param q EC_POINT object with the first factor of the second summand 677 * \param q EC_POINT object with the first factor of the second summand
678 * \param m BIGNUM with the second factor of the second summand 678 * \param m BIGNUM with the second factor of the second summand
679 * \param ctx BN_CTX object (optional) 679 * \param ctx BN_CTX object (optional)
680 * \return 1 on success and 0 if an error occured 680 * \return 1 on success and 0 if an error occurred
681 */ 681 */
682int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx); 682int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);
683 683
684/** Stores multiples of generator for faster point multiplication 684/** Stores multiples of generator for faster point multiplication
685 * \param group EC_GROUP object 685 * \param group EC_GROUP object
686 * \param ctx BN_CTX object (optional) 686 * \param ctx BN_CTX object (optional)
687 * \return 1 on success and 0 if an error occured 687 * \return 1 on success and 0 if an error occurred
688 */ 688 */
689int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx); 689int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
690 690
@@ -869,8 +869,8 @@ int EC_KEY_generate_key(EC_KEY *key);
869 */ 869 */
870int EC_KEY_check_key(const EC_KEY *key); 870int EC_KEY_check_key(const EC_KEY *key);
871 871
872/** Sets a public key from affine coordindates performing 872/** Sets a public key from affine coordinates performing
873 * neccessary NIST PKV tests. 873 * necessary NIST PKV tests.
874 * \param key the EC_KEY object 874 * \param key the EC_KEY object
875 * \param x public key x coordinate 875 * \param x public key x coordinate
876 * \param y public key y coordinate 876 * \param y public key y coordinate
@@ -914,7 +914,7 @@ int i2d_ECPrivateKey(EC_KEY *key, unsigned char **out);
914EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len); 914EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len);
915 915
916/** Encodes ec parameter and stores the result in a buffer. 916/** Encodes ec parameter and stores the result in a buffer.
917 * \param key the EC_KEY object with ec paramters to encode 917 * \param key the EC_KEY object with ec parameters to encode
918 * \param out the buffer for the result (if NULL the function returns number 918 * \param out the buffer for the result (if NULL the function returns number
919 * of bytes needed). 919 * of bytes needed).
920 * \return 1 on success and 0 if an error occurred. 920 * \return 1 on success and 0 if an error occurred.
diff --git a/src/lib/libcrypto/ec/ecp_nistp224.c b/src/lib/libcrypto/ec/ecp_nistp224.c
index 59781b75c3..caa4c3facf 100644
--- a/src/lib/libcrypto/ec/ecp_nistp224.c
+++ b/src/lib/libcrypto/ec/ecp_nistp224.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_nistp224.c,v 1.29 2022/11/26 16:08:52 tb Exp $ */ 1/* $OpenBSD: ecp_nistp224.c,v 1.30 2022/12/26 07:18:51 jmc Exp $ */
2/* 2/*
3 * Written by Emilia Kasper (Google) for the OpenSSL project. 3 * Written by Emilia Kasper (Google) for the OpenSSL project.
4 */ 4 */
@@ -72,7 +72,7 @@ typedef uint128_t widelimb;
72typedef limb felem[4]; 72typedef limb felem[4];
73typedef widelimb widefelem[7]; 73typedef widelimb widefelem[7];
74 74
75/* Field element represented as a byte arrary. 75/* Field element represented as a byte array.
76 * 28*8 = 224 bits is also the group order size for the elliptic curve, 76 * 28*8 = 224 bits is also the group order size for the elliptic curve,
77 * and we also use this type for scalars for point multiplication. 77 * and we also use this type for scalars for point multiplication.
78 */ 78 */
diff --git a/src/lib/libcrypto/ec/ecp_nistp256.c b/src/lib/libcrypto/ec/ecp_nistp256.c
index 275015b98d..e218b0c68c 100644
--- a/src/lib/libcrypto/ec/ecp_nistp256.c
+++ b/src/lib/libcrypto/ec/ecp_nistp256.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_nistp256.c,v 1.28 2022/11/26 16:08:52 tb Exp $ */ 1/* $OpenBSD: ecp_nistp256.c,v 1.29 2022/12/26 07:18:51 jmc Exp $ */
2/* 2/*
3 * Written by Adam Langley (Google) for the OpenSSL project 3 * Written by Adam Langley (Google) for the OpenSSL project
4 */ 4 */
@@ -1223,7 +1223,7 @@ copy_small_conditional(felem out, const smallfelem in, limb mask)
1223 } 1223 }
1224} 1224}
1225 1225
1226/* point_add calcuates (x1, y1, z1) + (x2, y2, z2) 1226/* point_add calculates (x1, y1, z1) + (x2, y2, z2)
1227 * 1227 *
1228 * The method is taken from: 1228 * The method is taken from:
1229 * http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl, 1229 * http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl,
diff --git a/src/lib/libcrypto/ec/ecp_nistp521.c b/src/lib/libcrypto/ec/ecp_nistp521.c
index 20b5885ab7..caeea14911 100644
--- a/src/lib/libcrypto/ec/ecp_nistp521.c
+++ b/src/lib/libcrypto/ec/ecp_nistp521.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_nistp521.c,v 1.29 2022/11/26 16:08:52 tb Exp $ */ 1/* $OpenBSD: ecp_nistp521.c,v 1.30 2022/12/26 07:18:51 jmc Exp $ */
2/* 2/*
3 * Written by Adam Langley (Google) for the OpenSSL project 3 * Written by Adam Langley (Google) for the OpenSSL project
4 */ 4 */
@@ -1034,7 +1034,7 @@ felem_contract(felem out, const felem in)
1034 * elliptic curve group itself. Points on the curve are represented in Jacobian 1034 * elliptic curve group itself. Points on the curve are represented in Jacobian
1035 * coordinates */ 1035 * coordinates */
1036 1036
1037/* point_double calcuates 2*(x_in, y_in, z_in) 1037/* point_double calculates 2*(x_in, y_in, z_in)
1038 * 1038 *
1039 * The method is taken from: 1039 * The method is taken from:
1040 * http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b 1040 * http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b
@@ -1143,7 +1143,7 @@ copy_conditional(felem out, const felem in, limb mask)
1143 } 1143 }
1144} 1144}
1145 1145
1146/* point_add calcuates (x1, y1, z1) + (x2, y2, z2) 1146/* point_add calculates (x1, y1, z1) + (x2, y2, z2)
1147 * 1147 *
1148 * The method is taken from 1148 * The method is taken from
1149 * http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl, 1149 * http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl,
diff --git a/src/lib/libcrypto/ecdsa/ecdsa.h b/src/lib/libcrypto/ecdsa/ecdsa.h
index 29ee8729ed..3f0eb3b66f 100644
--- a/src/lib/libcrypto/ecdsa/ecdsa.h
+++ b/src/lib/libcrypto/ecdsa/ecdsa.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecdsa.h,v 1.12 2022/07/12 14:42:49 kn Exp $ */ 1/* $OpenBSD: ecdsa.h,v 1.13 2022/12/26 07:18:51 jmc Exp $ */
2/** 2/**
3 * \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions 3 * \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions
4 * \author Written by Nils Larsch for the OpenSSL project 4 * \author Written by Nils Larsch for the OpenSSL project
@@ -156,7 +156,7 @@ ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dgst_len,
156 * \param dgst pointer to the hash value to sign 156 * \param dgst pointer to the hash value to sign
157 * \param dgstlen length of the hash value 157 * \param dgstlen length of the hash value
158 * \param kinv BIGNUM with a pre-computed inverse k (optional) 158 * \param kinv BIGNUM with a pre-computed inverse k (optional)
159 * \param rp BIGNUM with a pre-computed rp value (optioanl), 159 * \param rp BIGNUM with a pre-computed rp value (optional),
160 * see ECDSA_sign_setup 160 * see ECDSA_sign_setup
161 * \param eckey EC_KEY object containing a private EC key 161 * \param eckey EC_KEY object containing a private EC key
162 * \return pointer to a ECDSA_SIG structure or NULL if an error occurred 162 * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
@@ -233,7 +233,7 @@ int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen,
233 * \param sig buffer to hold the DER encoded signature 233 * \param sig buffer to hold the DER encoded signature
234 * \param siglen pointer to the length of the returned signature 234 * \param siglen pointer to the length of the returned signature
235 * \param kinv BIGNUM with a pre-computed inverse k (optional) 235 * \param kinv BIGNUM with a pre-computed inverse k (optional)
236 * \param rp BIGNUM with a pre-computed rp value (optioanl), 236 * \param rp BIGNUM with a pre-computed rp value (optional),
237 * see ECDSA_sign_setup 237 * see ECDSA_sign_setup
238 * \param eckey EC_KEY object containing a private EC key 238 * \param eckey EC_KEY object containing a private EC key
239 * \return 1 on success and 0 otherwise 239 * \return 1 on success and 0 otherwise
diff --git a/src/lib/libcrypto/engine/README b/src/lib/libcrypto/engine/README
index 6b69b70f57..bc4a9041ff 100644
--- a/src/lib/libcrypto/engine/README
+++ b/src/lib/libcrypto/engine/README
@@ -122,7 +122,7 @@ use by EVP_MD code. Ditto for tb_rsa.c, tb_dsa.c, etc. These instantiations of
122ENGINE_TABLE essentially provide linker-separation of the classes so that even 122ENGINE_TABLE essentially provide linker-separation of the classes so that even
123if ENGINEs implement *all* possible algorithms, an application using only 123if ENGINEs implement *all* possible algorithms, an application using only
124EVP_CIPHER code will link at most code relating to EVP_CIPHER, tb_cipher.c, core 124EVP_CIPHER code will link at most code relating to EVP_CIPHER, tb_cipher.c, core
125ENGINE code that is independant of class, and of course the ENGINE 125ENGINE code that is independent of class, and of course the ENGINE
126implementation that the application loaded. It will *not* however link any 126implementation that the application loaded. It will *not* however link any
127class-specific ENGINE code for digests, RSA, etc nor will it bleed over into 127class-specific ENGINE code for digests, RSA, etc nor will it bleed over into
128other APIs, such as the RSA/DSA/etc library code. 128other APIs, such as the RSA/DSA/etc library code.
@@ -188,7 +188,7 @@ state will be unchanged. Thus, no cleanup is required unless registration takes
188place. ENGINE_cleanup() will simply iterate across a list of registered cleanup 188place. ENGINE_cleanup() will simply iterate across a list of registered cleanup
189callbacks calling each in turn, and will then internally delete its own storage 189callbacks calling each in turn, and will then internally delete its own storage
190(a STACK). When a cleanup callback is next registered (eg. if the cleanup() is 190(a STACK). When a cleanup callback is next registered (eg. if the cleanup() is
191part of a gracefull restart and the application wants to cleanup all state then 191part of a graceful restart and the application wants to cleanup all state then
192start again), the internal STACK storage will be freshly allocated. This is much 192start again), the internal STACK storage will be freshly allocated. This is much
193the same as the situation in the ENGINE_TABLE instantiations ... NULL is the 193the same as the situation in the ENGINE_TABLE instantiations ... NULL is the
194initialised state, so only modification operations (not queries) will cause that 194initialised state, so only modification operations (not queries) will cause that
diff --git a/src/lib/libcrypto/engine/eng_aesni.c b/src/lib/libcrypto/engine/eng_aesni.c
index 586f74792a..cce4203bc4 100644
--- a/src/lib/libcrypto/engine/eng_aesni.c
+++ b/src/lib/libcrypto/engine/eng_aesni.c
@@ -1,6 +1,6 @@
1/* $OpenBSD: eng_aesni.c,v 1.11 2018/04/14 07:18:37 tb Exp $ */ 1/* $OpenBSD: eng_aesni.c,v 1.12 2022/12/26 07:18:51 jmc Exp $ */
2/* 2/*
3 * Support for Intel AES-NI intruction set 3 * Support for Intel AES-NI instruction set
4 * Author: Huang Ying <ying.huang@intel.com> 4 * Author: Huang Ying <ying.huang@intel.com>
5 * 5 *
6 * Intel AES-NI is a new set of Single Instruction Multiple Data 6 * Intel AES-NI is a new set of Single Instruction Multiple Data
diff --git a/src/lib/libcrypto/engine/eng_list.c b/src/lib/libcrypto/engine/eng_list.c
index b29b4102e4..451c8616ef 100644
--- a/src/lib/libcrypto/engine/eng_list.c
+++ b/src/lib/libcrypto/engine/eng_list.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_list.c,v 1.24 2019/01/19 01:07:00 tb Exp $ */ 1/* $OpenBSD: eng_list.c,v 1.25 2022/12/26 07:18:51 jmc Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -223,7 +223,7 @@ ENGINE_get_next(ENGINE *e)
223 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); 223 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
224 ret = e->next; 224 ret = e->next;
225 if (ret) { 225 if (ret) {
226 /* Return a valid structural refernce to the next ENGINE */ 226 /* Return a valid structural reference to the next ENGINE */
227 ret->struct_ref++; 227 ret->struct_ref++;
228 engine_ref_debug(ret, 0, 1) 228 engine_ref_debug(ret, 0, 1)
229 } 229 }
diff --git a/src/lib/libcrypto/engine/eng_padlock.c b/src/lib/libcrypto/engine/eng_padlock.c
index 0281ab810c..50b5fb780d 100644
--- a/src/lib/libcrypto/engine/eng_padlock.c
+++ b/src/lib/libcrypto/engine/eng_padlock.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_padlock.c,v 1.16 2018/04/14 07:18:37 tb Exp $ */ 1/* $OpenBSD: eng_padlock.c,v 1.17 2022/12/26 07:18:51 jmc Exp $ */
2/* 2/*
3 * Support for VIA PadLock Advanced Cryptography Engine (ACE) 3 * Support for VIA PadLock Advanced Cryptography Engine (ACE)
4 * Written by Michal Ludvig <michal@logix.cz> 4 * Written by Michal Ludvig <michal@logix.cz>
@@ -285,7 +285,7 @@ struct padlock_cipher_data {
285 * Essentially this variable belongs in thread local storage. 285 * Essentially this variable belongs in thread local storage.
286 * Having this variable global on the other hand can only cause 286 * Having this variable global on the other hand can only cause
287 * few bogus key reloads [if any at all on single-CPU system], 287 * few bogus key reloads [if any at all on single-CPU system],
288 * so we accept the penatly... 288 * so we accept the penalty...
289 */ 289 */
290static volatile struct padlock_cipher_data *padlock_saved_context; 290static volatile struct padlock_cipher_data *padlock_saved_context;
291#endif 291#endif
@@ -872,7 +872,7 @@ padlock_aes_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out_arg,
872 chunk = PADLOCK_CHUNK; 872 chunk = PADLOCK_CHUNK;
873 873
874 if (out_misaligned) { 874 if (out_misaligned) {
875 /* optmize for small input */ 875 /* optimize for small input */
876 allocated = (chunk < nbytes ? PADLOCK_CHUNK : nbytes); 876 allocated = (chunk < nbytes ? PADLOCK_CHUNK : nbytes);
877 out = alloca(0x10 + allocated); 877 out = alloca(0x10 + allocated);
878 out = NEAREST_ALIGNED(out); 878 out = NEAREST_ALIGNED(out);
diff --git a/src/lib/libcrypto/engine/eng_table.c b/src/lib/libcrypto/engine/eng_table.c
index a8aded5aaf..0e7ea3b698 100644
--- a/src/lib/libcrypto/engine/eng_table.c
+++ b/src/lib/libcrypto/engine/eng_table.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_table.c,v 1.9 2017/01/29 17:49:23 beck Exp $ */ 1/* $OpenBSD: eng_table.c,v 1.10 2022/12/26 07:18:52 jmc Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2001 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2001 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -163,7 +163,7 @@ engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
163 fnd->funct = NULL; 163 fnd->funct = NULL;
164 (void)lh_ENGINE_PILE_insert(&(*table)->piles, fnd); 164 (void)lh_ENGINE_PILE_insert(&(*table)->piles, fnd);
165 } 165 }
166 /* A registration shouldn't add duplciate entries */ 166 /* A registration shouldn't add duplicate entries */
167 (void)sk_ENGINE_delete_ptr(fnd->sk, e); 167 (void)sk_ENGINE_delete_ptr(fnd->sk, e);
168 /* if 'setdefault', this ENGINE goes to the head of the list */ 168 /* if 'setdefault', this ENGINE goes to the head of the list */
169 if (!sk_ENGINE_push(fnd->sk, e)) 169 if (!sk_ENGINE_push(fnd->sk, e))
@@ -193,7 +193,7 @@ int_unregister_cb_doall_arg(ENGINE_PILE *pile, ENGINE *e)
193{ 193{
194 int n; 194 int n;
195 195
196 /* Iterate the 'c->sk' stack removing any occurance of 'e' */ 196 /* Iterate the 'c->sk' stack removing any occurrence of 'e' */
197 while ((n = sk_ENGINE_find(pile->sk, e)) >= 0) { 197 while ((n = sk_ENGINE_find(pile->sk, e)) >= 0) {
198 (void)sk_ENGINE_delete(pile->sk, n); 198 (void)sk_ENGINE_delete(pile->sk, n);
199 pile->uptodate = 0; 199 pile->uptodate = 0;
diff --git a/src/lib/libcrypto/engine/engine.h b/src/lib/libcrypto/engine/engine.h
index 5c21647fe3..41f05d48af 100644
--- a/src/lib/libcrypto/engine/engine.h
+++ b/src/lib/libcrypto/engine/engine.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: engine.h,v 1.34 2022/07/12 14:42:49 kn Exp $ */ 1/* $OpenBSD: engine.h,v 1.35 2022/12/26 07:18:52 jmc Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -631,7 +631,7 @@ typedef struct st_dynamic_MEM_fns {
631 dyn_MEM_free_cb free_cb; 631 dyn_MEM_free_cb free_cb;
632} dynamic_MEM_fns; 632} dynamic_MEM_fns;
633/* FIXME: Perhaps the memory and locking code (crypto.h) should declare and use 633/* FIXME: Perhaps the memory and locking code (crypto.h) should declare and use
634 * these types so we (and any other dependant code) can simplify a bit?? */ 634 * these types so we (and any other dependent code) can simplify a bit?? */
635typedef void (*dyn_lock_locking_cb)(int, int, const char *, int); 635typedef void (*dyn_lock_locking_cb)(int, int, const char *, int);
636typedef int (*dyn_lock_add_lock_cb)(int*, int, int, const char *, int); 636typedef int (*dyn_lock_add_lock_cb)(int*, int, int, const char *, int);
637typedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb)( 637typedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb)(
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c
index 349140543b..403fcd4607 100644
--- a/src/lib/libcrypto/err/err.c
+++ b/src/lib/libcrypto/err/err.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: err.c,v 1.49 2022/08/29 06:49:24 jsing Exp $ */ 1/* $OpenBSD: err.c,v 1.50 2022/12/26 07:18:52 jmc Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1075,7 +1075,7 @@ ERR_get_state(void)
1075 ERR_STATE_free(ret); /* could not insert it */ 1075 ERR_STATE_free(ret); /* could not insert it */
1076 return (&fallback); 1076 return (&fallback);
1077 } 1077 }
1078 /* If a race occured in this function and we came second, tmpp 1078 /* If a race occurred in this function and we came second, tmpp
1079 * is the first one that we just replaced. */ 1079 * is the first one that we just replaced. */
1080 if (tmpp) 1080 if (tmpp)
1081 ERR_STATE_free(tmpp); 1081 ERR_STATE_free(tmpp);
diff --git a/src/lib/libcrypto/evp/digest.c b/src/lib/libcrypto/evp/digest.c
index 1fa25cd4fb..7c129f025d 100644
--- a/src/lib/libcrypto/evp/digest.c
+++ b/src/lib/libcrypto/evp/digest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: digest.c,v 1.35 2022/11/26 16:08:52 tb Exp $ */ 1/* $OpenBSD: digest.c,v 1.36 2022/12/26 07:18:52 jmc Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -140,7 +140,7 @@ EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
140 /* Whether it's nice or not, "Inits" can be used on "Final"'d contexts 140 /* Whether it's nice or not, "Inits" can be used on "Final"'d contexts
141 * so this context may already have an ENGINE! Try to avoid releasing 141 * so this context may already have an ENGINE! Try to avoid releasing
142 * the previous handle, re-querying for an ENGINE, and having a 142 * the previous handle, re-querying for an ENGINE, and having a
143 * reinitialisation, when it may all be unecessary. */ 143 * reinitialisation, when it may all be unnecessary. */
144 if (ctx->engine && ctx->digest && (!type || 144 if (ctx->engine && ctx->digest && (!type ||
145 (type && (type->type == ctx->digest->type)))) 145 (type && (type->type == ctx->digest->type))))
146 goto skip_to_init; 146 goto skip_to_init;
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c
index d1defc4643..c64390d599 100644
--- a/src/lib/libcrypto/evp/evp_enc.c
+++ b/src/lib/libcrypto/evp/evp_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_enc.c,v 1.48 2022/11/26 16:08:52 tb Exp $ */ 1/* $OpenBSD: evp_enc.c,v 1.49 2022/12/26 07:18:52 jmc Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -98,7 +98,7 @@ EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl,
98 /* Whether it's nice or not, "Inits" can be used on "Final"'d contexts 98 /* Whether it's nice or not, "Inits" can be used on "Final"'d contexts
99 * so this context may already have an ENGINE! Try to avoid releasing 99 * so this context may already have an ENGINE! Try to avoid releasing
100 * the previous handle, re-querying for an ENGINE, and having a 100 * the previous handle, re-querying for an ENGINE, and having a
101 * reinitialisation, when it may all be unecessary. */ 101 * reinitialisation, when it may all be unnecessary. */
102 if (ctx->engine && ctx->cipher && 102 if (ctx->engine && ctx->cipher &&
103 (!cipher || (cipher && (cipher->nid == ctx->cipher->nid)))) 103 (!cipher || (cipher && (cipher->nid == ctx->cipher->nid))))
104 goto skip_to_init; 104 goto skip_to_init;
diff --git a/src/lib/libcrypto/evp/pmeth_lib.c b/src/lib/libcrypto/evp/pmeth_lib.c
index e4abdc4aec..bec899cef1 100644
--- a/src/lib/libcrypto/evp/pmeth_lib.c
+++ b/src/lib/libcrypto/evp/pmeth_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pmeth_lib.c,v 1.26 2022/11/26 16:08:53 tb Exp $ */ 1/* $OpenBSD: pmeth_lib.c,v 1.27 2022/12/26 07:18:52 jmc Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -173,7 +173,7 @@ int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id)
173 } else 173 } else
174 e = ENGINE_get_pkey_meth_engine(id); 174 e = ENGINE_get_pkey_meth_engine(id);
175 175
176 /* If an ENGINE handled this method look it up. Othewise 176 /* If an ENGINE handled this method look it up. Otherwise
177 * use internal tables. 177 * use internal tables.
178 */ 178 */
179 179
diff --git a/src/lib/libcrypto/man/PKCS7_dataFinal.3 b/src/lib/libcrypto/man/PKCS7_dataFinal.3
index e2e088d9d9..1a01b2ff61 100644
--- a/src/lib/libcrypto/man/PKCS7_dataFinal.3
+++ b/src/lib/libcrypto/man/PKCS7_dataFinal.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: PKCS7_dataFinal.3,v 1.2 2020/06/03 13:41:27 schwarze Exp $ 1.\" $OpenBSD: PKCS7_dataFinal.3,v 1.3 2022/12/26 07:18:52 jmc Exp $
2.\" 2.\"
3.\" Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: June 3 2020 $ 17.Dd $Mdocdate: December 26 2022 $
18.Dt PKCS7_DATAFINAL 3 18.Dt PKCS7_DATAFINAL 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -122,7 +122,7 @@ Signing or digesting is requested and
122is not configured to store a detached signature, 122is not configured to store a detached signature,
123but does not contain the required field to store the content either. 123but does not contain the required field to store the content either.
124.It 124.It
125At least one signer lacks a useable digest algorithm. 125At least one signer lacks a usable digest algorithm.
126.It 126.It
127Signing or digesting fails. 127Signing or digesting fails.
128.It 128.It
diff --git a/src/lib/libcrypto/man/PKCS7_final.3 b/src/lib/libcrypto/man/PKCS7_final.3
index 7c9e51521a..775b84d984 100644
--- a/src/lib/libcrypto/man/PKCS7_final.3
+++ b/src/lib/libcrypto/man/PKCS7_final.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: PKCS7_final.3,v 1.2 2020/06/04 10:24:27 schwarze Exp $ 1.\" $OpenBSD: PKCS7_final.3,v 1.3 2022/12/26 07:18:52 jmc Exp $
2.\" 2.\"
3.\" Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: June 4 2020 $ 17.Dd $Mdocdate: December 26 2022 $
18.Dt PKCS7_FINAL 3 18.Dt PKCS7_FINAL 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -172,7 +172,7 @@ Signing or digesting is requested and
172is not configured to store a detached signature, but does not contain 172is not configured to store a detached signature, but does not contain
173the required field to store the content either. 173the required field to store the content either.
174.It 174.It
175At least one signer lacks a useable digest algorithm. 175At least one signer lacks a usable digest algorithm.
176.It 176.It
177A cipher is required but none is configured. 177A cipher is required but none is configured.
178.It 178.It
diff --git a/src/lib/libcrypto/man/X509_check_trust.3 b/src/lib/libcrypto/man/X509_check_trust.3
index 286dcdd5b9..be4489e946 100644
--- a/src/lib/libcrypto/man/X509_check_trust.3
+++ b/src/lib/libcrypto/man/X509_check_trust.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_check_trust.3,v 1.6 2022/09/10 10:22:46 jsg Exp $ 1.\" $OpenBSD: X509_check_trust.3,v 1.7 2022/12/26 07:18:52 jmc Exp $
2.\" 2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: September 10 2022 $ 17.Dd $Mdocdate: December 26 2022 $
18.Dt X509_CHECK_TRUST 3 18.Dt X509_CHECK_TRUST 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -140,7 +140,7 @@ identifiers, the standard algorithm is modified:
140and 140and
141.Xr X509_add1_trust_object 3 141.Xr X509_add1_trust_object 3
142settings are completely ignored 142settings are completely ignored
143and all steps before the compatibility step are skippped. 143and all steps before the compatibility step are skipped.
144The 144The
145.Fa certificate 145.Fa certificate
146is trusted if and only if it is self-signed. 146is trusted if and only if it is self-signed.
diff --git a/src/lib/libcrypto/md32_common.h b/src/lib/libcrypto/md32_common.h
index 0dca61710f..a8b0d9ab74 100644
--- a/src/lib/libcrypto/md32_common.h
+++ b/src/lib/libcrypto/md32_common.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: md32_common.h,v 1.22 2016/11/04 13:56:04 miod Exp $ */ 1/* $OpenBSD: md32_common.h,v 1.23 2022/12/26 07:18:50 jmc Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -316,7 +316,7 @@ int HASH_FINAL (unsigned char *md, HASH_CTX *c)
316#if defined(__alpha) || defined(__sparcv9) || defined(__mips) 316#if defined(__alpha) || defined(__sparcv9) || defined(__mips)
317#define MD32_REG_T long 317#define MD32_REG_T long
318/* 318/*
319 * This comment was originaly written for MD5, which is why it 319 * This comment was originally written for MD5, which is why it
320 * discusses A-D. But it basically applies to all 32-bit digests, 320 * discusses A-D. But it basically applies to all 32-bit digests,
321 * which is why it was moved to common header file. 321 * which is why it was moved to common header file.
322 * 322 *
diff --git a/src/lib/libcrypto/modes/asm/ghash-x86.pl b/src/lib/libcrypto/modes/asm/ghash-x86.pl
index 83c727e07f..27492597ad 100644
--- a/src/lib/libcrypto/modes/asm/ghash-x86.pl
+++ b/src/lib/libcrypto/modes/asm/ghash-x86.pl
@@ -86,7 +86,7 @@
86# where Tproc is time required for Karatsuba pre- and post-processing, 86# where Tproc is time required for Karatsuba pre- and post-processing,
87# is more realistic estimate. In this case it gives ... 1.91 cycles. 87# is more realistic estimate. In this case it gives ... 1.91 cycles.
88# Or in other words, depending on how well we can interleave reduction 88# Or in other words, depending on how well we can interleave reduction
89# and one of the two multiplications the performance should be betwen 89# and one of the two multiplications the performance should be between
90# 1.91 and 2.16. As already mentioned, this implementation processes 90# 1.91 and 2.16. As already mentioned, this implementation processes
91# one byte out of 8KB buffer in 2.10 cycles, while x86_64 counterpart 91# one byte out of 8KB buffer in 2.10 cycles, while x86_64 counterpart
92# - in 2.02. x86_64 performance is better, because larger register 92# - in 2.02. x86_64 performance is better, because larger register
@@ -700,7 +700,7 @@ sub mmx_loop() {
700 &pxor ($red[1],$red[1]); 700 &pxor ($red[1],$red[1]);
701 &pxor ($red[2],$red[2]); 701 &pxor ($red[2],$red[2]);
702 702
703 # Just like in "May" verson modulo-schedule for critical path in 703 # Just like in "May" version modulo-schedule for critical path in
704 # 'Z.hi ^= rem_8bit[Z.lo&0xff^((u8)H[nhi]<<4)]<<48'. Final 'pxor' 704 # 'Z.hi ^= rem_8bit[Z.lo&0xff^((u8)H[nhi]<<4)]<<48'. Final 'pxor'
705 # is scheduled so late that rem_8bit[] has to be shifted *right* 705 # is scheduled so late that rem_8bit[] has to be shifted *right*
706 # by 16, which is why last argument to pinsrw is 2, which 706 # by 16, which is why last argument to pinsrw is 2, which
@@ -1087,7 +1087,7 @@ my ($Xhi,$Xi) = @_;
1087 &movdqu (&QWP(0,$Xip),$Xi); 1087 &movdqu (&QWP(0,$Xip),$Xi);
1088&function_end("gcm_ghash_clmul"); 1088&function_end("gcm_ghash_clmul");
1089 1089
1090} else { # Algorith 5. Kept for reference purposes. 1090} else { # Algorithm 5. Kept for reference purposes.
1091 1091
1092sub reduction_alg5 { # 19/16 times faster than Intel version 1092sub reduction_alg5 { # 19/16 times faster than Intel version
1093my ($Xhi,$Xi)=@_; 1093my ($Xhi,$Xi)=@_;
diff --git a/src/lib/libcrypto/modes/ctr128.c b/src/lib/libcrypto/modes/ctr128.c
index 9dd8c0c55e..eadb80449c 100644
--- a/src/lib/libcrypto/modes/ctr128.c
+++ b/src/lib/libcrypto/modes/ctr128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ctr128.c,v 1.8 2022/11/26 16:08:53 tb Exp $ */ 1/* $OpenBSD: ctr128.c,v 1.9 2022/12/26 07:18:52 jmc Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -109,7 +109,7 @@ ctr128_inc_aligned(unsigned char *counter)
109 * This algorithm assumes that the counter is in the x lower bits 109 * This algorithm assumes that the counter is in the x lower bits
110 * of the IV (ivec), and that the application has full control over 110 * of the IV (ivec), and that the application has full control over
111 * overflow and the rest of the IV. This implementation takes NO 111 * overflow and the rest of the IV. This implementation takes NO
112 * responsability for checking that the counter doesn't overflow 112 * responsibility for checking that the counter doesn't overflow
113 * into the rest of the IV when incremented. 113 * into the rest of the IV when incremented.
114 */ 114 */
115void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out, 115void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
@@ -228,7 +228,7 @@ void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
228 (*func)(in,out,blocks,key,ivec); 228 (*func)(in,out,blocks,key,ivec);
229 /* (*ctr) does not update ivec, caller does: */ 229 /* (*ctr) does not update ivec, caller does: */
230 PUTU32(ivec+12,ctr32); 230 PUTU32(ivec+12,ctr32);
231 /* ... overflow was detected, propogate carry. */ 231 /* ... overflow was detected, propagate carry. */
232 if (ctr32 == 0) ctr96_inc(ivec); 232 if (ctr32 == 0) ctr96_inc(ivec);
233 blocks *= 16; 233 blocks *= 16;
234 len -= blocks; 234 len -= blocks;
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c
index b42d0e5e9c..6adc4068a3 100644
--- a/src/lib/libcrypto/objects/obj_dat.c
+++ b/src/lib/libcrypto/objects/obj_dat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: obj_dat.c,v 1.50 2022/11/26 16:08:53 tb Exp $ */ 1/* $OpenBSD: obj_dat.c,v 1.51 2022/12/26 07:18:52 jmc Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -251,7 +251,7 @@ static IMPLEMENT_LHASH_DOALL_FN(cleanup2, ADDED_OBJ)
251static IMPLEMENT_LHASH_DOALL_FN(cleanup3, ADDED_OBJ) 251static IMPLEMENT_LHASH_DOALL_FN(cleanup3, ADDED_OBJ)
252 252
253/* The purpose of obj_cleanup_defer is to avoid EVP_cleanup() attempting 253/* The purpose of obj_cleanup_defer is to avoid EVP_cleanup() attempting
254 * to use freed up OIDs. If neccessary the actual freeing up of OIDs is 254 * to use freed up OIDs. If necessary the actual freeing up of OIDs is
255 * delayed. 255 * delayed.
256 */ 256 */
257 257
@@ -320,7 +320,7 @@ OBJ_add_object(const ASN1_OBJECT *obj)
320 ao[i]->type = i; 320 ao[i]->type = i;
321 ao[i]->obj = o; 321 ao[i]->obj = o;
322 aop = lh_ADDED_OBJ_insert(added, ao[i]); 322 aop = lh_ADDED_OBJ_insert(added, ao[i]);
323 /* memory leak, buit should not normally matter */ 323 /* memory leak, but should not normally matter */
324 free(aop); 324 free(aop);
325 } 325 }
326 } 326 }
diff --git a/src/lib/libcrypto/objects/objects.txt b/src/lib/libcrypto/objects/objects.txt
index 283686f9ff..4ce86ac88e 100644
--- a/src/lib/libcrypto/objects/objects.txt
+++ b/src/lib/libcrypto/objects/objects.txt
@@ -842,7 +842,7 @@ internet 6 : snmpv2 : SNMPv2
842# Documents refer to "internet 7" as "mail". This however leads to ambiguities 842# Documents refer to "internet 7" as "mail". This however leads to ambiguities
843# with RFC2798, Section 9.1.3, where "mail" is defined as the short name for 843# with RFC2798, Section 9.1.3, where "mail" is defined as the short name for
844# rfc822Mailbox. The short name is therefore here left out for a reason. 844# rfc822Mailbox. The short name is therefore here left out for a reason.
845# Subclasses of "mail", e.g. "MIME MHS" don't consitute a problem, as 845# Subclasses of "mail", e.g. "MIME MHS" don't constitute a problem, as
846# references are realized via long name "Mail" (with capital M). 846# references are realized via long name "Mail" (with capital M).
847internet 7 : : Mail 847internet 7 : : Mail
848 848
diff --git a/src/lib/libcrypto/ocsp/ocsp_cl.c b/src/lib/libcrypto/ocsp/ocsp_cl.c
index bcc484c3c5..7747020221 100644
--- a/src/lib/libcrypto/ocsp/ocsp_cl.c
+++ b/src/lib/libcrypto/ocsp/ocsp_cl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_cl.c,v 1.21 2022/01/07 09:45:52 tb Exp $ */ 1/* $OpenBSD: ocsp_cl.c,v 1.22 2022/12/26 07:18:52 jmc Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -215,7 +215,7 @@ OCSP_response_get1_basic(OCSP_RESPONSE *resp)
215 return ASN1_item_unpack(rb->response, &OCSP_BASICRESP_it); 215 return ASN1_item_unpack(rb->response, &OCSP_BASICRESP_it);
216} 216}
217 217
218/* Return number of OCSP_SINGLERESP reponses present in 218/* Return number of OCSP_SINGLERESP responses present in
219 * a basic response. 219 * a basic response.
220 */ 220 */
221int 221int
diff --git a/src/lib/libcrypto/ocsp/ocsp_ext.c b/src/lib/libcrypto/ocsp/ocsp_ext.c
index 829495bcf3..9605d859b4 100644
--- a/src/lib/libcrypto/ocsp/ocsp_ext.c
+++ b/src/lib/libcrypto/ocsp/ocsp_ext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_ext.c,v 1.21 2022/11/26 16:08:53 tb Exp $ */ 1/* $OpenBSD: ocsp_ext.c,v 1.22 2022/12/26 07:18:52 jmc Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -321,7 +321,7 @@ OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc)
321 321
322/* Nonce handling functions */ 322/* Nonce handling functions */
323 323
324/* Add a nonce to an extension stack. A nonce can be specificed or if NULL 324/* Add a nonce to an extension stack. A nonce can be specified or if NULL
325 * a random nonce will be generated. 325 * a random nonce will be generated.
326 * Note: OpenSSL 0.9.7d and later create an OCTET STRING containing the 326 * Note: OpenSSL 0.9.7d and later create an OCTET STRING containing the
327 * nonce, previous versions used the raw nonce. 327 * nonce, previous versions used the raw nonce.
diff --git a/src/lib/libcrypto/ossl_typ.h b/src/lib/libcrypto/ossl_typ.h
index d8e2d92ae4..78eb7e92ba 100644
--- a/src/lib/libcrypto/ossl_typ.h
+++ b/src/lib/libcrypto/ossl_typ.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ossl_typ.h,v 1.21 2022/01/14 08:59:30 tb Exp $ */ 1/* $OpenBSD: ossl_typ.h,v 1.22 2022/12/26 07:18:50 jmc Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -170,7 +170,7 @@ typedef struct DIST_POINT_st DIST_POINT;
170typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT; 170typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
171typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS; 171typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
172 172
173/* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */ 173/* If placed in pkcs12.h, we end up with a circular dependency with pkcs7.h */
174#define DECLARE_PKCS12_STACK_OF(type) /* Nothing */ 174#define DECLARE_PKCS12_STACK_OF(type) /* Nothing */
175#define IMPLEMENT_PKCS12_STACK_OF(type) /* Nothing */ 175#define IMPLEMENT_PKCS12_STACK_OF(type) /* Nothing */
176 176
diff --git a/src/lib/libcrypto/perlasm/readme b/src/lib/libcrypto/perlasm/readme
index 57d61fda1e..a7876bcc95 100644
--- a/src/lib/libcrypto/perlasm/readme
+++ b/src/lib/libcrypto/perlasm/readme
@@ -1,5 +1,5 @@
1The perl scripts in this directory are my 'hack' to generate 1The perl scripts in this directory are my 'hack' to generate
2multiple different assembler formats via the one origional script. 2multiple different assembler formats via the one original script.
3 3
4The way to use this library is to start with adding the path to this directory 4The way to use this library is to start with adding the path to this directory
5and then include it. 5and then include it.
diff --git a/src/lib/libcrypto/perlasm/x86_64-xlate.pl b/src/lib/libcrypto/perlasm/x86_64-xlate.pl
index 5f7f585549..bc9d78eb02 100755
--- a/src/lib/libcrypto/perlasm/x86_64-xlate.pl
+++ b/src/lib/libcrypto/perlasm/x86_64-xlate.pl
@@ -291,7 +291,7 @@ my %globals;
291} 291}
292{ package register; # pick up registers, which start with %. 292{ package register; # pick up registers, which start with %.
293 sub re { 293 sub re {
294 my $class = shift; # muliple instances... 294 my $class = shift; # multiple instances...
295 my $self = {}; 295 my $self = {};
296 local *line = shift; 296 local *line = shift;
297 undef $ret; 297 undef $ret;
@@ -879,7 +879,7 @@ close STDOUT;
879# (#) Nth argument, volatile 879# (#) Nth argument, volatile
880# 880#
881# In Unix terms top of stack is argument transfer area for arguments 881# In Unix terms top of stack is argument transfer area for arguments
882# which could not be accomodated in registers. Or in other words 7th 882# which could not be accommodated in registers. Or in other words 7th
883# [integer] argument resides at 8(%rsp) upon function entry point. 883# [integer] argument resides at 8(%rsp) upon function entry point.
884# 128 bytes above %rsp constitute a "red zone" which is not touched 884# 128 bytes above %rsp constitute a "red zone" which is not touched
885# by signal handlers and can be used as temporal storage without 885# by signal handlers and can be used as temporal storage without
@@ -896,7 +896,7 @@ close STDOUT;
896# the area above user stack pointer in true asynchronous manner... 896# the area above user stack pointer in true asynchronous manner...
897# 897#
898# All the above means that if assembler programmer adheres to Unix 898# All the above means that if assembler programmer adheres to Unix
899# register and stack layout, but disregards the "red zone" existense, 899# register and stack layout, but disregards the "red zone" existence,
900# it's possible to use following prologue and epilogue to "gear" from 900# it's possible to use following prologue and epilogue to "gear" from
901# Unix to Win64 ABI in leaf functions with not more than 6 arguments. 901# Unix to Win64 ABI in leaf functions with not more than 6 arguments.
902# 902#
diff --git a/src/lib/libcrypto/pkcs7/pk7_doit.c b/src/lib/libcrypto/pkcs7/pk7_doit.c
index 5cd95cdf91..3e2d4c2119 100644
--- a/src/lib/libcrypto/pkcs7/pk7_doit.c
+++ b/src/lib/libcrypto/pkcs7/pk7_doit.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_doit.c,v 1.49 2022/11/26 16:08:53 tb Exp $ */ 1/* $OpenBSD: pk7_doit.c,v 1.50 2022/12/26 07:18:52 jmc Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -534,7 +534,7 @@ PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
534 /* If we haven't got a certificate try each ri in turn */ 534 /* If we haven't got a certificate try each ri in turn */
535 if (pcert == NULL) { 535 if (pcert == NULL) {
536 /* Always attempt to decrypt all rinfo even 536 /* Always attempt to decrypt all rinfo even
537 * after sucess as a defence against MMA timing 537 * after success as a defence against MMA timing
538 * attacks. 538 * attacks.
539 */ 539 */
540 for (i = 0; i < sk_PKCS7_RECIP_INFO_num(rsk); i++) { 540 for (i = 0; i < sk_PKCS7_RECIP_INFO_num(rsk); i++) {
diff --git a/src/lib/libcrypto/rc2/version b/src/lib/libcrypto/rc2/version
index a69ff35a43..8ca161a613 100644
--- a/src/lib/libcrypto/rc2/version
+++ b/src/lib/libcrypto/rc2/version
@@ -1,7 +1,7 @@
11.1 23/08/96 - eay 11.1 23/08/96 - eay
2 Changed RC2_set_key() so it now takes another argument. Many 2 Changed RC2_set_key() so it now takes another argument. Many
3 thanks to Peter Gutmann <pgut01@cs.auckland.ac.nz> for the 3 thanks to Peter Gutmann <pgut01@cs.auckland.ac.nz> for the
4 clarification and origional specification of RC2. BSAFE uses 4 clarification and original specification of RC2. BSAFE uses
5 this last parameter, 'bits'. It the key is 128 bits, BSAFE 5 this last parameter, 'bits'. It the key is 128 bits, BSAFE
6 also sets this parameter to 128. The old behaviour can be 6 also sets this parameter to 128. The old behaviour can be
7 duplicated by setting this parameter to 1024. 7 duplicated by setting this parameter to 1024.
diff --git a/src/lib/libcrypto/rc4/asm/rc4-586.pl b/src/lib/libcrypto/rc4/asm/rc4-586.pl
index 03f0cff467..f3c3e117bc 100644
--- a/src/lib/libcrypto/rc4/asm/rc4-586.pl
+++ b/src/lib/libcrypto/rc4/asm/rc4-586.pl
@@ -123,7 +123,7 @@ if ($alt=0) {
123 push (@XX,shift(@XX)) if ($i>=0); 123 push (@XX,shift(@XX)) if ($i>=0);
124 } 124 }
125} else { 125} else {
126 # Using pinsrw here improves performane on Intel CPUs by 2-3%, but 126 # Using pinsrw here improves performance on Intel CPUs by 2-3%, but
127 # brings down AMD by 7%... 127 # brings down AMD by 7%...
128 $RC4_loop_mmx = sub { 128 $RC4_loop_mmx = sub {
129 my $i=shift; 129 my $i=shift;
@@ -144,7 +144,7 @@ if ($alt=0) {
144 &movd ($i>0?"mm1":"mm2",&DWP(0,$dat,$ty,4)); 144 &movd ($i>0?"mm1":"mm2",&DWP(0,$dat,$ty,4));
145 145
146 # (*) This is the key to Core2 and Westmere performance. 146 # (*) This is the key to Core2 and Westmere performance.
147 # Whithout movz out-of-order execution logic confuses 147 # Without movz out-of-order execution logic confuses
148 # itself and fails to reorder loads and stores. Problem 148 # itself and fails to reorder loads and stores. Problem
149 # appears to be fixed in Sandy Bridge... 149 # appears to be fixed in Sandy Bridge...
150 } 150 }
diff --git a/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl b/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl
index 2135b38ef8..18a967e546 100755
--- a/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl
+++ b/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl
@@ -50,7 +50,7 @@
50# As was shown by Zou Nanhai loop unrolling can improve Intel EM64T 50# As was shown by Zou Nanhai loop unrolling can improve Intel EM64T
51# performance by >30% [unlike P4 32-bit case that is]. But this is 51# performance by >30% [unlike P4 32-bit case that is]. But this is
52# provided that loads are reordered even more aggressively! Both code 52# provided that loads are reordered even more aggressively! Both code
53# pathes, AMD64 and EM64T, reorder loads in essentially same manner 53# paths, AMD64 and EM64T, reorder loads in essentially same manner
54# as my IA-64 implementation. On Opteron this resulted in modest 5% 54# as my IA-64 implementation. On Opteron this resulted in modest 5%
55# improvement [I had to test it], while final Intel P4 performance 55# improvement [I had to test it], while final Intel P4 performance
56# achieves respectful 432MBps on 2.8GHz processor now. For reference. 56# achieves respectful 432MBps on 2.8GHz processor now. For reference.
@@ -81,7 +81,7 @@
81# The only code path that was not modified is P4-specific one. Non-P4 81# The only code path that was not modified is P4-specific one. Non-P4
82# Intel code path optimization is heavily based on submission by Maxim 82# Intel code path optimization is heavily based on submission by Maxim
83# Perminov, Maxim Locktyukhin and Jim Guilford of Intel. I've used 83# Perminov, Maxim Locktyukhin and Jim Guilford of Intel. I've used
84# some of the ideas even in attempt to optmize the original RC4_INT 84# some of the ideas even in attempt to optimize the original RC4_INT
85# code path... Current performance in cycles per processed byte (less 85# code path... Current performance in cycles per processed byte (less
86# is better) and improvement coefficients relative to previous 86# is better) and improvement coefficients relative to previous
87# version of this module are: 87# version of this module are:
diff --git a/src/lib/libcrypto/ripemd/README b/src/lib/libcrypto/ripemd/README
index 5e18d45866..ab1d7a4c0c 100644
--- a/src/lib/libcrypto/ripemd/README
+++ b/src/lib/libcrypto/ripemd/README
@@ -8,7 +8,7 @@ this point I will not bother right now. I believe the trick will be
8to remove my 'copy X array onto stack' until inside the RIP1() finctions the 8to remove my 'copy X array onto stack' until inside the RIP1() finctions the
9first time round. To do this I need another register and will only have one 9first time round. To do this I need another register and will only have one
10temporary one. A bit tricky.... I can also cleanup the saving of the 5 words 10temporary one. A bit tricky.... I can also cleanup the saving of the 5 words
11after the first half of the calculation. I should read the origional 11after the first half of the calculation. I should read the original
12value, add then write. Currently I just save the new and read the origioal. 12value, add then write. Currently I just save the new and read the origioal.
13I then read both at the end. Bad. 13I then read both at the end. Bad.
14 14
diff --git a/src/lib/libcrypto/rsa/rsa_eay.c b/src/lib/libcrypto/rsa/rsa_eay.c
index f6c3092dc4..a19201727e 100644
--- a/src/lib/libcrypto/rsa/rsa_eay.c
+++ b/src/lib/libcrypto/rsa/rsa_eay.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_eay.c,v 1.55 2022/11/26 16:08:54 tb Exp $ */ 1/* $OpenBSD: rsa_eay.c,v 1.56 2022/12/26 07:18:52 jmc Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -716,7 +716,7 @@ RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
716 BIGNUM p, q; 716 BIGNUM p, q;
717 717
718 /* 718 /*
719 * Make sure BN_mod_inverse in Montgomery intialization uses the 719 * Make sure BN_mod_inverse in Montgomery initialization uses the
720 * BN_FLG_CONSTTIME flag 720 * BN_FLG_CONSTTIME flag
721 */ 721 */
722 BN_init(&p); 722 BN_init(&p);
diff --git a/src/lib/libcrypto/sha/asm/sha1-586.pl b/src/lib/libcrypto/sha/asm/sha1-586.pl
index d29ed84706..1de5e2650e 100644
--- a/src/lib/libcrypto/sha/asm/sha1-586.pl
+++ b/src/lib/libcrypto/sha/asm/sha1-586.pl
@@ -28,7 +28,7 @@
28# P4 +85%(!) +45% 28# P4 +85%(!) +45%
29# 29#
30# As you can see Pentium came out as looser:-( Yet I reckoned that 30# As you can see Pentium came out as looser:-( Yet I reckoned that
31# improvement on P4 outweights the loss and incorporate this 31# improvement on P4 outweighs the loss and incorporate this
32# re-tuned code to 0.9.7 and later. 32# re-tuned code to 0.9.7 and later.
33# ---------------------------------------------------------------- 33# ----------------------------------------------------------------
34# <appro@fy.chalmers.se> 34# <appro@fy.chalmers.se>
@@ -511,14 +511,14 @@ my $_ror=sub { &ror(@_) };
511# 511#
512# Temporary registers usage. X[2] is volatile at the entry and at the 512# Temporary registers usage. X[2] is volatile at the entry and at the
513# end is restored from backtrace ring buffer. X[3] is expected to 513# end is restored from backtrace ring buffer. X[3] is expected to
514# contain current K_XX_XX constant and is used to caclulate X[-1]+K 514# contain current K_XX_XX constant and is used to calculate X[-1]+K
515# from previous round, it becomes volatile the moment the value is 515# from previous round, it becomes volatile the moment the value is
516# saved to stack for transfer to IALU. X[4] becomes volatile whenever 516# saved to stack for transfer to IALU. X[4] becomes volatile whenever
517# X[-4] is accumulated and offloaded to backtrace ring buffer, at the 517# X[-4] is accumulated and offloaded to backtrace ring buffer, at the
518# end it is loaded with next K_XX_XX [which becomes X[3] in next 518# end it is loaded with next K_XX_XX [which becomes X[3] in next
519# round]... 519# round]...
520# 520#
521sub Xupdate_ssse3_16_31() # recall that $Xi starts wtih 4 521sub Xupdate_ssse3_16_31() # recall that $Xi starts with 4
522{ use integer; 522{ use integer;
523 my $body = shift; 523 my $body = shift;
524 my @insns = (&$body,&$body,&$body,&$body); # 40 instructions 524 my @insns = (&$body,&$body,&$body,&$body); # 40 instructions
@@ -940,7 +940,7 @@ my $_ror=sub { &shrd(@_[0],@_) };
940 &vmovdqa(&QWP(0+32,"esp"),@X[2]); 940 &vmovdqa(&QWP(0+32,"esp"),@X[2]);
941 &jmp (&label("loop")); 941 &jmp (&label("loop"));
942 942
943sub Xupdate_avx_16_31() # recall that $Xi starts wtih 4 943sub Xupdate_avx_16_31() # recall that $Xi starts with 4
944{ use integer; 944{ use integer;
945 my $body = shift; 945 my $body = shift;
946 my @insns = (&$body,&$body,&$body,&$body); # 40 instructions 946 my @insns = (&$body,&$body,&$body,&$body); # 40 instructions
diff --git a/src/lib/libcrypto/sha/asm/sha1-sparcv9a.pl b/src/lib/libcrypto/sha/asm/sha1-sparcv9a.pl
index e65291bbd9..e81a4dcb05 100644
--- a/src/lib/libcrypto/sha/asm/sha1-sparcv9a.pl
+++ b/src/lib/libcrypto/sha/asm/sha1-sparcv9a.pl
@@ -544,7 +544,7 @@ ___
544 544
545# Purpose of these subroutines is to explicitly encode VIS instructions, 545# Purpose of these subroutines is to explicitly encode VIS instructions,
546# so that one can compile the module without having to specify VIS 546# so that one can compile the module without having to specify VIS
547# extentions on compiler command line, e.g. -xarch=v9 vs. -xarch=v9a. 547# extensions on compiler command line, e.g. -xarch=v9 vs. -xarch=v9a.
548# Idea is to reserve for option to produce "universal" binary and let 548# Idea is to reserve for option to produce "universal" binary and let
549# programmer detect if current CPU is VIS capable at run-time. 549# programmer detect if current CPU is VIS capable at run-time.
550sub unvis { 550sub unvis {
diff --git a/src/lib/libcrypto/sha/asm/sha1-thumb.pl b/src/lib/libcrypto/sha/asm/sha1-thumb.pl
index 7c9ea9b029..553e9cedb5 100644
--- a/src/lib/libcrypto/sha/asm/sha1-thumb.pl
+++ b/src/lib/libcrypto/sha/asm/sha1-thumb.pl
@@ -14,7 +14,7 @@
14# The code does not present direct interest to OpenSSL, because of low 14# The code does not present direct interest to OpenSSL, because of low
15# performance. Its purpose is to establish _size_ benchmark. Pretty 15# performance. Its purpose is to establish _size_ benchmark. Pretty
16# useless one I must say, because 30% or 88 bytes larger ARMv4 code 16# useless one I must say, because 30% or 88 bytes larger ARMv4 code
17# [avialable on demand] is almost _twice_ as fast. It should also be 17# [available on demand] is almost _twice_ as fast. It should also be
18# noted that in-lining of .Lcommon and .Lrotate improves performance 18# noted that in-lining of .Lcommon and .Lrotate improves performance
19# by over 40%, while code increases by only 10% or 32 bytes. But once 19# by over 40%, while code increases by only 10% or 32 bytes. But once
20# again, the goal was to establish _size_ benchmark, not performance. 20# again, the goal was to establish _size_ benchmark, not performance.
diff --git a/src/lib/libcrypto/sha/asm/sha1-x86_64.pl b/src/lib/libcrypto/sha/asm/sha1-x86_64.pl
index 147d21570b..cc8ef5337d 100755
--- a/src/lib/libcrypto/sha/asm/sha1-x86_64.pl
+++ b/src/lib/libcrypto/sha/asm/sha1-x86_64.pl
@@ -368,7 +368,7 @@ sub AUTOLOAD() # thunk [simplified] 32-bit style perlasm
368 $code .= "\t$opcode\t".join(',',$arg,reverse @_)."\n"; 368 $code .= "\t$opcode\t".join(',',$arg,reverse @_)."\n";
369} 369}
370 370
371sub Xupdate_ssse3_16_31() # recall that $Xi starts wtih 4 371sub Xupdate_ssse3_16_31() # recall that $Xi starts with 4
372{ use integer; 372{ use integer;
373 my $body = shift; 373 my $body = shift;
374 my @insns = (&$body,&$body,&$body,&$body); # 40 instructions 374 my @insns = (&$body,&$body,&$body,&$body); # 40 instructions
@@ -779,7 +779,7 @@ $code.=<<___;
779 jmp .Loop_avx 779 jmp .Loop_avx
780___ 780___
781 781
782sub Xupdate_avx_16_31() # recall that $Xi starts wtih 4 782sub Xupdate_avx_16_31() # recall that $Xi starts with 4
783{ use integer; 783{ use integer;
784 my $body = shift; 784 my $body = shift;
785 my @insns = (&$body,&$body,&$body,&$body); # 40 instructions 785 my @insns = (&$body,&$body,&$body,&$body); # 40 instructions
diff --git a/src/lib/libcrypto/sha/asm/sha512-x86_64.pl b/src/lib/libcrypto/sha/asm/sha512-x86_64.pl
index feb0f9e776..bc4b2e7487 100755
--- a/src/lib/libcrypto/sha/asm/sha512-x86_64.pl
+++ b/src/lib/libcrypto/sha/asm/sha512-x86_64.pl
@@ -34,7 +34,7 @@
34# level parallelism, on a given CPU implementation in this case. 34# level parallelism, on a given CPU implementation in this case.
35# 35#
36# Special note on Intel EM64T. While Opteron CPU exhibits perfect 36# Special note on Intel EM64T. While Opteron CPU exhibits perfect
37# perfromance ratio of 1.5 between 64- and 32-bit flavors [see above], 37# performance ratio of 1.5 between 64- and 32-bit flavors [see above],
38# [currently available] EM64T CPUs apparently are far from it. On the 38# [currently available] EM64T CPUs apparently are far from it. On the
39# contrary, 64-bit version, sha512_block, is ~30% *slower* than 32-bit 39# contrary, 64-bit version, sha512_block, is ~30% *slower* than 32-bit
40# sha256_block:-( This is presumably because 64-bit shifts/rotates 40# sha256_block:-( This is presumably because 64-bit shifts/rotates
diff --git a/src/lib/libcrypto/sparccpuid.S b/src/lib/libcrypto/sparccpuid.S
index b913e3dddb..757e015704 100644
--- a/src/lib/libcrypto/sparccpuid.S
+++ b/src/lib/libcrypto/sparccpuid.S
@@ -263,7 +263,7 @@ _sparcv9_vis1_instrument:
263 sub %o3,%o2,%o2 263 sub %o3,%o2,%o2
264 sub %o4,%o3,%o3 264 sub %o4,%o3,%o3
265 265
266 ! find minumum value 266 ! find minimum value
267 cmp %o0,%o1 267 cmp %o0,%o1
268 .word 0x38680002 !bgu,a %xcc,.+8 268 .word 0x38680002 !bgu,a %xcc,.+8
269 mov %o1,%o0 269 mov %o1,%o0
diff --git a/src/lib/libcrypto/ui/ui.h b/src/lib/libcrypto/ui/ui.h
index ee27fd2a49..0f662455ed 100644
--- a/src/lib/libcrypto/ui/ui.h
+++ b/src/lib/libcrypto/ui/ui.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ui.h,v 1.15 2022/12/17 21:59:39 tb Exp $ */ 1/* $OpenBSD: ui.h,v 1.16 2022/12/26 07:18:52 jmc Exp $ */
2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL 2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -276,7 +276,7 @@ const UI_METHOD *UI_null(void);
276 * display a dialog box after it has been built. 276 * display a dialog box after it has been built.
277 * a reader This function is called to read a given prompt, 277 * a reader This function is called to read a given prompt,
278 * maybe from the tty, maybe from a field in a 278 * maybe from the tty, maybe from a field in a
279 * window. Note that it's called wth all string 279 * window. Note that it's called with all string
280 * structures, not only the prompt ones, so it must 280 * structures, not only the prompt ones, so it must
281 * check such things itself. 281 * check such things itself.
282 * a closer This function closes the session, maybe by closing 282 * a closer This function closes the session, maybe by closing
diff --git a/src/lib/libcrypto/whrlpool/asm/wp-mmx.pl b/src/lib/libcrypto/whrlpool/asm/wp-mmx.pl
index cb2381c22b..0ff8e5b612 100644
--- a/src/lib/libcrypto/whrlpool/asm/wp-mmx.pl
+++ b/src/lib/libcrypto/whrlpool/asm/wp-mmx.pl
@@ -59,19 +59,19 @@ sub LL()
59 unshift(@_,pop(@_)); 59 unshift(@_,pop(@_));
60 } 60 }
61 } 61 }
62 else { die "unvalid SCALE value"; } 62 else { die "invalid SCALE value"; }
63} 63}
64 64
65sub scale() 65sub scale()
66{ if ($SCALE==2) { &lea(@_[0],&DWP(0,@_[1],@_[1])); } 66{ if ($SCALE==2) { &lea(@_[0],&DWP(0,@_[1],@_[1])); }
67 elsif ($SCALE==8) { &lea(@_[0],&DWP(0,"",@_[1],8)); } 67 elsif ($SCALE==8) { &lea(@_[0],&DWP(0,"",@_[1],8)); }
68 else { die "unvalid SCALE value"; } 68 else { die "invalid SCALE value"; }
69} 69}
70 70
71sub row() 71sub row()
72{ if ($SCALE==2) { ((8-shift)&7); } 72{ if ($SCALE==2) { ((8-shift)&7); }
73 elsif ($SCALE==8) { (8*shift); } 73 elsif ($SCALE==8) { (8*shift); }
74 else { die "unvalid SCALE value"; } 74 else { die "invalid SCALE value"; }
75} 75}
76 76
77$tbl="ebp"; 77$tbl="ebp";
diff --git a/src/lib/libcrypto/x509/pcy_tree.c b/src/lib/libcrypto/x509/pcy_tree.c
index be563d2677..050503bdf3 100644
--- a/src/lib/libcrypto/x509/pcy_tree.c
+++ b/src/lib/libcrypto/x509/pcy_tree.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pcy_tree.c,v 1.4 2022/11/26 16:08:54 tb Exp $ */ 1/* $OpenBSD: pcy_tree.c,v 1.5 2022/12/26 07:18:53 jmc Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2004. 3 * project 2004.
4 */ 4 */
@@ -131,7 +131,7 @@ tree_print(char *str, X509_POLICY_TREE *tree, X509_POLICY_LEVEL *curr)
131#endif 131#endif
132 132
133/* Initialize policy tree. Return values: 133/* Initialize policy tree. Return values:
134 * 0 Some internal error occured. 134 * 0 Some internal error occurred.
135 * -1 Inconsistent or invalid extensions in certificates. 135 * -1 Inconsistent or invalid extensions in certificates.
136 * 1 Tree initialized OK. 136 * 1 Tree initialized OK.
137 * 2 Policy tree is empty. 137 * 2 Policy tree is empty.
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index 7795181efc..0ff66587b9 100644
--- a/src/lib/libcrypto/x509/x509.h
+++ b/src/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509.h,v 1.90 2022/07/12 14:42:50 kn Exp $ */ 1/* $OpenBSD: x509.h,v 1.91 2022/12/26 07:18:53 jmc Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -893,7 +893,7 @@ int X509_NAME_get_text_by_NID(X509_NAME *name, int nid,
893int X509_NAME_get_text_by_OBJ(X509_NAME *name, 893int X509_NAME_get_text_by_OBJ(X509_NAME *name,
894 const ASN1_OBJECT *obj, char *buf,int len); 894 const ASN1_OBJECT *obj, char *buf,int len);
895 895
896/* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use 896/* NOTE: you should be passing -1, not 0 as lastpos. The functions that use
897 * lastpos, search after that position on. */ 897 * lastpos, search after that position on. */
898int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, 898int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid,
899 int lastpos); 899 int lastpos);
diff --git a/src/lib/libcrypto/x509/x509_constraints.c b/src/lib/libcrypto/x509/x509_constraints.c
index 1b79383de0..346cab0a40 100644
--- a/src/lib/libcrypto/x509/x509_constraints.c
+++ b/src/lib/libcrypto/x509/x509_constraints.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_constraints.c,v 1.30 2022/11/28 07:22:15 tb Exp $ */ 1/* $OpenBSD: x509_constraints.c,v 1.31 2022/12/26 07:18:53 jmc Exp $ */
2/* 2/*
3 * Copyright (c) 2020 Bob Beck <beck@openbsd.org> 3 * Copyright (c) 2020 Bob Beck <beck@openbsd.org>
4 * 4 *
@@ -192,7 +192,7 @@ x509_constraints_names_dup(struct x509_constraints_names *names)
192 * 5890 compliant A-labels (see RFC 6066 section 3). This is more 192 * 5890 compliant A-labels (see RFC 6066 section 3). This is more
193 * permissive to allow for a leading '.' for a subdomain based 193 * permissive to allow for a leading '.' for a subdomain based
194 * constraint, as well as allowing for '_' which is commonly accepted 194 * constraint, as well as allowing for '_' which is commonly accepted
195 * by nonconformant DNS implementaitons. 195 * by nonconformant DNS implementations.
196 * 196 *
197 * if "wildcards" is set it allows '*' to occur in the string at the end of a 197 * if "wildcards" is set it allows '*' to occur in the string at the end of a
198 * component. 198 * component.
@@ -587,7 +587,7 @@ x509_constraints_sandns(char *sandns, size_t dlen, char *constraint, size_t len)
587 * returns 1 if the domain and constraint match. 587 * returns 1 if the domain and constraint match.
588 * returns 0 otherwise. 588 * returns 0 otherwise.
589 * 589 *
590 * an empty constraint matches everyting. 590 * an empty constraint matches everything.
591 * constraint will be matched against the domain as a suffix if it 591 * constraint will be matched against the domain as a suffix if it
592 * starts with a '.'. 592 * starts with a '.'.
593 * domain will be matched against the constraint as a suffix if it 593 * domain will be matched against the constraint as a suffix if it
@@ -651,10 +651,10 @@ x509_constraints_uri(uint8_t *uri, size_t ulen, uint8_t *constraint,
651} 651}
652 652
653/* 653/*
654 * Verify a validated address of size alen with a validated contraint 654 * Verify a validated address of size alen with a validated constraint
655 * of size constraint_len. returns 1 if matching, 0 if not. 655 * of size constraint_len. returns 1 if matching, 0 if not.
656 * Addresses are assumed to be pre-validated for a length of 4 and 8 656 * Addresses are assumed to be pre-validated for a length of 4 and 8
657 * respectively for ipv4 addreses and constraints, and a length of 657 * respectively for ipv4 addresses and constraints, and a length of
658 * 16 and 32 respectively for ipv6 address constraints by the caller. 658 * 16 and 32 respectively for ipv6 address constraints by the caller.
659 */ 659 */
660int 660int
@@ -909,7 +909,7 @@ x509_constraints_extract_names(struct x509_constraints_names *names,
909 vname = NULL; 909 vname = NULL;
910 } 910 }
911 /* 911 /*
912 * Include the CN as a hostname to be checked againt 912 * Include the CN as a hostname to be checked against
913 * name constraints if it looks like a hostname. 913 * name constraints if it looks like a hostname.
914 */ 914 */
915 while (include_cn && 915 while (include_cn &&
@@ -1210,7 +1210,7 @@ x509_constraints_check(struct x509_constraints_names *names,
1210/* 1210/*
1211 * Walk a validated chain of X509 certs, starting at the leaf, and 1211 * Walk a validated chain of X509 certs, starting at the leaf, and
1212 * validate the name constraints in the chain. Intended for use with 1212 * validate the name constraints in the chain. Intended for use with
1213 * the legacy X509 validtion code in x509_vfy.c 1213 * the legacy X509 validation code in x509_vfy.c
1214 * 1214 *
1215 * returns 1 if the constraints are ok, 0 otherwise, setting error and 1215 * returns 1 if the constraints are ok, 0 otherwise, setting error and
1216 * depth 1216 * depth
diff --git a/src/lib/libcrypto/x509/x509_issuer_cache.c b/src/lib/libcrypto/x509/x509_issuer_cache.c
index 4f78e1e69b..f7fbd54ca7 100644
--- a/src/lib/libcrypto/x509/x509_issuer_cache.c
+++ b/src/lib/libcrypto/x509/x509_issuer_cache.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_issuer_cache.c,v 1.3 2022/06/27 14:23:40 beck Exp $ */ 1/* $OpenBSD: x509_issuer_cache.c,v 1.4 2022/12/26 07:18:53 jmc Exp $ */
2/* 2/*
3 * Copyright (c) 2020 Bob Beck <beck@openbsd.org> 3 * Copyright (c) 2020 Bob Beck <beck@openbsd.org>
4 * 4 *
@@ -75,7 +75,7 @@ x509_issuer_cache_set_max(size_t max)
75 75
76/* 76/*
77 * Free the oldest entry in the issuer cache. Returns 1 77 * Free the oldest entry in the issuer cache. Returns 1
78 * if an entry was successfuly freed, 0 otherwise. Must 78 * if an entry was successfully freed, 0 otherwise. Must
79 * be called with x509_issuer_tree_mutex held. 79 * be called with x509_issuer_tree_mutex held.
80 */ 80 */
81void 81void
diff --git a/src/lib/libcrypto/x509/x509_ncons.c b/src/lib/libcrypto/x509/x509_ncons.c
index cc7f59cd0a..c7e4e6ed9f 100644
--- a/src/lib/libcrypto/x509/x509_ncons.c
+++ b/src/lib/libcrypto/x509/x509_ncons.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_ncons.c,v 1.7 2022/11/26 16:08:55 tb Exp $ */ 1/* $OpenBSD: x509_ncons.c,v 1.8 2022/12/26 07:18:53 jmc Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project. 3 * project.
4 */ 4 */
@@ -482,7 +482,7 @@ nc_email(ASN1_IA5STRING *eml, ASN1_IA5STRING *base)
482 482
483 if (!emlat) 483 if (!emlat)
484 return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX; 484 return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX;
485 /* Special case: inital '.' is RHS match */ 485 /* Special case: initial '.' is RHS match */
486 if (!baseat && (*baseptr == '.')) { 486 if (!baseat && (*baseptr == '.')) {
487 if (eml->length > base->length) { 487 if (eml->length > base->length) {
488 emlptr += eml->length - base->length; 488 emlptr += eml->length - base->length;
@@ -543,7 +543,7 @@ nc_uri(ASN1_IA5STRING *uri, ASN1_IA5STRING *base)
543 if (hostlen == 0) 543 if (hostlen == 0)
544 return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX; 544 return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX;
545 545
546 /* Special case: inital '.' is RHS match */ 546 /* Special case: initial '.' is RHS match */
547 if (*baseptr == '.') { 547 if (*baseptr == '.') {
548 if (hostlen > base->length) { 548 if (hostlen > base->length) {
549 p = hostptr + hostlen - base->length; 549 p = hostptr + hostlen - base->length;
diff --git a/src/lib/libcrypto/x509/x509_utl.c b/src/lib/libcrypto/x509/x509_utl.c
index 525939d4ca..aa18efe2c5 100644
--- a/src/lib/libcrypto/x509/x509_utl.c
+++ b/src/lib/libcrypto/x509/x509_utl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_utl.c,v 1.4 2022/11/14 17:48:50 beck Exp $ */ 1/* $OpenBSD: x509_utl.c,v 1.5 2022/12/26 07:18:53 jmc Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project. 3 * project.
4 */ 4 */
@@ -723,7 +723,7 @@ skip_prefix(const unsigned char **p, size_t *plen, const unsigned char *subject,
723 * "equal_nocase" function is a hand-rolled strncasecmp that does not 723 * "equal_nocase" function is a hand-rolled strncasecmp that does not
724 * allow \0 in the pattern. Since an embedded \0 is likely a sign of 724 * allow \0 in the pattern. Since an embedded \0 is likely a sign of
725 * problems, we simply don't allow it in either case, and then we use 725 * problems, we simply don't allow it in either case, and then we use
726 * standard libc funcitons. 726 * standard libc functions.
727 */ 727 */
728 728
729/* Compare using strncasecmp */ 729/* Compare using strncasecmp */
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c
index 9392b1f41e..f6c7c21f5f 100644
--- a/src/lib/libcrypto/x509/x509_vfy.c
+++ b/src/lib/libcrypto/x509/x509_vfy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vfy.c,v 1.109 2022/12/01 05:20:30 tb Exp $ */ 1/* $OpenBSD: x509_vfy.c,v 1.110 2022/12/26 07:18:53 jmc Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -312,7 +312,7 @@ X509_verify_cert_legacy_build_chain(X509_STORE_CTX *ctx, int *bad, int *out_ok)
312 if (ctx->untrusted != NULL) { 312 if (ctx->untrusted != NULL) {
313 /* 313 /*
314 * If we do not find a non-expired untrusted cert, peek 314 * If we do not find a non-expired untrusted cert, peek
315 * ahead and see if we can satisify this from the trusted 315 * ahead and see if we can satisfy this from the trusted
316 * store. If not, see if we have an expired untrusted cert. 316 * store. If not, see if we have an expired untrusted cert.
317 */ 317 */
318 xtmp = find_issuer(ctx, sktmp, x, 0); 318 xtmp = find_issuer(ctx, sktmp, x, 0);
diff --git a/src/lib/libcrypto/x509/x509_vfy.h b/src/lib/libcrypto/x509/x509_vfy.h
index 9a9d6c0a1c..27ed484291 100644
--- a/src/lib/libcrypto/x509/x509_vfy.h
+++ b/src/lib/libcrypto/x509/x509_vfy.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vfy.h,v 1.56 2022/12/01 05:27:04 tb Exp $ */ 1/* $OpenBSD: x509_vfy.h,v 1.57 2022/12/26 07:18:53 jmc Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -255,7 +255,7 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
255/* Do not check certificate or CRL validity against current time. */ 255/* Do not check certificate or CRL validity against current time. */
256#define X509_V_FLAG_NO_CHECK_TIME 0x200000 256#define X509_V_FLAG_NO_CHECK_TIME 0x200000
257 257
258/* Force the use of the legacy certificate verifcation */ 258/* Force the use of the legacy certificate verification */
259#define X509_V_FLAG_LEGACY_VERIFY 0x400000 259#define X509_V_FLAG_LEGACY_VERIFY 0x400000
260 260
261#define X509_VP_FLAG_DEFAULT 0x1 261#define X509_VP_FLAG_DEFAULT 0x1
diff --git a/src/lib/libcrypto/x509/x509name.c b/src/lib/libcrypto/x509/x509name.c
index 14e2deb84f..19a253da4d 100644
--- a/src/lib/libcrypto/x509/x509name.c
+++ b/src/lib/libcrypto/x509/x509name.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509name.c,v 1.29 2022/11/26 16:08:55 tb Exp $ */ 1/* $OpenBSD: x509name.c,v 1.30 2022/12/26 07:18:53 jmc Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -123,7 +123,7 @@ X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos)
123} 123}
124LCRYPTO_ALIAS(X509_NAME_get_index_by_NID) 124LCRYPTO_ALIAS(X509_NAME_get_index_by_NID)
125 125
126/* NOTE: you should be passsing -1, not 0 as lastpos */ 126/* NOTE: you should be passing -1, not 0 as lastpos */
127int 127int
128X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj, 128X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
129 int lastpos) 129 int lastpos)
diff --git a/src/lib/libcrypto/x86cpuid.pl b/src/lib/libcrypto/x86cpuid.pl
index 8b9570fc72..0fc906a3e9 100644
--- a/src/lib/libcrypto/x86cpuid.pl
+++ b/src/lib/libcrypto/x86cpuid.pl
@@ -190,7 +190,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
190&set_label("spin"); 190&set_label("spin");
191 &lea ("ebx",&DWP(0,"eax","ecx")); 191 &lea ("ebx",&DWP(0,"eax","ecx"));
192 &nop (); 192 &nop ();
193 &data_word(0x1ab10ff0); # lock; cmpxchg %ebx,(%edx) # %eax is envolved and is always reloaded 193 &data_word(0x1ab10ff0); # lock; cmpxchg %ebx,(%edx) # %eax is involved and is always reloaded
194 &jne (&label("spin")); 194 &jne (&label("spin"));
195 &mov ("eax","ebx"); # OpenSSL expects the new value 195 &mov ("eax","ebx"); # OpenSSL expects the new value
196 &pop ("ebx"); 196 &pop ("ebx");