Compare commits
114 Commits
OpenSSL_0_
...
OpenSSL_0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fcf8f4d453 | ||
|
|
13617646da | ||
|
|
7a3565009e | ||
|
|
9f3864fde3 | ||
|
|
db186beee4 | ||
|
|
1f1a32541f | ||
|
|
0465313e70 | ||
|
|
8d2563f136 | ||
|
|
21996c6d8e | ||
|
|
fcc5349156 | ||
|
|
1a07628209 | ||
|
|
814af7e175 | ||
|
|
bf683ec609 | ||
|
|
e851895f04 | ||
|
|
a2049ba394 | ||
|
|
a8239afc86 | ||
|
|
bb38cd49e4 | ||
|
|
1cbdbcd587 | ||
|
|
7e201e9f73 | ||
|
|
2f98abbcb6 | ||
|
|
270fa8aeda | ||
|
|
9fc866c5eb | ||
|
|
4329db3726 | ||
|
|
6f7ac8e1b0 | ||
|
|
b0e88fb11b | ||
|
|
04c71cd725 | ||
|
|
a1457874c6 | ||
|
|
d64b16ab25 | ||
|
|
18be6c4116 | ||
|
|
f30b793779 | ||
|
|
dad1535f7a | ||
|
|
f60e6604b8 | ||
|
|
94ea9c84c5 | ||
|
|
0d3f2ccb62 | ||
|
|
5c72869563 | ||
|
|
14676ffcd6 | ||
|
|
e5a08ce44d | ||
|
|
712419b73a | ||
|
|
b9b6e14b4a | ||
|
|
7627efc92f | ||
|
|
442d42300b | ||
|
|
cd7f458e28 | ||
|
|
75e1c74724 | ||
|
|
ea01493df0 | ||
|
|
5db2b5e573 | ||
|
|
323edf1908 | ||
|
|
005ef84c5d | ||
|
|
f92570f00a | ||
|
|
9314e366c8 | ||
|
|
ba9cf37d59 | ||
|
|
b22c7a1cfb | ||
|
|
99efc0f50f | ||
|
|
d979d09ccc | ||
|
|
2581aacd52 | ||
|
|
c17810b087 | ||
|
|
e0b2073fd4 | ||
|
|
123e5dfc3a | ||
|
|
533a0c4ce7 | ||
|
|
0edad88a31 | ||
|
|
4ccfe5f49b | ||
|
|
e189872486 | ||
|
|
fdaea9ed2e | ||
|
|
5daec7ea0e | ||
|
|
e9224c7177 | ||
|
|
e90e719739 | ||
|
|
7ba666fa0e | ||
|
|
86a62cf15c | ||
|
|
b11405723d | ||
|
|
4c3a2b4f8a | ||
|
|
93f3decc4f | ||
|
|
bbf8198feb | ||
|
|
1c799131ae | ||
|
|
b1d4b48d39 | ||
|
|
bed4559052 | ||
|
|
3dda0dd2a2 | ||
|
|
7f87c1c0fc | ||
|
|
fa63a98ad8 | ||
|
|
1fc73fef48 | ||
|
|
90543bd07a | ||
|
|
43ecece595 | ||
|
|
4ba8cabf62 | ||
|
|
f68bb3c51f | ||
|
|
6d4ac67ac1 | ||
|
|
b84d5b72f1 | ||
|
|
8cbccedf7c | ||
|
|
1c24347062 | ||
|
|
9ef888130d | ||
|
|
4387f47832 | ||
|
|
38d6e4bb50 | ||
|
|
ced621e3c2 | ||
|
|
85940ea8ea | ||
|
|
439ae4d398 | ||
|
|
4fbe40c54f | ||
|
|
578ca7e4cd | ||
|
|
7e8c30b589 | ||
|
|
2b32b28191 | ||
|
|
532215f2db | ||
|
|
5319be4438 | ||
|
|
f7a3e73ef6 | ||
|
|
ff3345cb72 | ||
|
|
716b2079dc | ||
|
|
e7b6228fd3 | ||
|
|
2053c43de2 | ||
|
|
1c3e4a3660 | ||
|
|
4707991520 | ||
|
|
7a1f92fdc3 | ||
|
|
e7a285694e | ||
|
|
6ab285bf4c | ||
|
|
1d3159bcca | ||
|
|
f60ceb54eb | ||
|
|
0f995b2f40 | ||
|
|
848f735ae4 | ||
|
|
a678430602 | ||
|
|
e9b553dac1 |
14
CHANGES
14
CHANGES
@@ -4,6 +4,20 @@
|
||||
|
||||
Changes between 0.9.6h and 0.9.7 [XX xxx 2002]
|
||||
|
||||
*) The hw_ncipher.c engine requires dynamic locks. Unfortunately, it
|
||||
seems that in spite of existing for more than a year, many application
|
||||
author have done nothing to provide the necessary callbacks, which
|
||||
means that this particular engine will not work properly anywhere.
|
||||
This is a very unfortunate situation which forces us, in the name
|
||||
of usability, to give the hw_ncipher.c a static lock, which is part
|
||||
of libcrypto.
|
||||
NOTE: This is for the 0.9.7 series ONLY. This hack will never
|
||||
appear in 0.9.8 or later. We EXPECT application authors to have
|
||||
dealt properly with this when 0.9.8 is released (unless we actually
|
||||
make such changes in the libcrypto locking code that changes will
|
||||
have to be made anyway).
|
||||
[Richard Levitte]
|
||||
|
||||
*) In asn1_d2i_read_bio() repeatedly call BIO_read() until all content
|
||||
octets have been read, EOF or an error occurs. Without this change
|
||||
some truncated ASN1 structures will not produce an error.
|
||||
|
||||
46
Configure
46
Configure
@@ -161,25 +161,25 @@ my %table=(
|
||||
# surrounds it with #APP #NO_APP comment pair which (at least Solaris
|
||||
# 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic"
|
||||
# error message.
|
||||
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_sol_asm}:dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_sol_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### Solaris x86 with Sun C setups
|
||||
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### SPARC Solaris with GNU C setups
|
||||
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc
|
||||
"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris64-sparcv9-gcc31","gcc:-mcpu=ultrasparc -m64 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris64-sparcv9-gcc31","gcc:-mcpu=ultrasparc -m64 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# gcc pre-2.8 doesn't understand -mcpu=ultrasparc, so fall down to -mv8
|
||||
# but keep the assembler modules.
|
||||
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:::asm/md5-sparcv8plus-gcc27.o::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris-sparcv9-gcc27","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus-gcc27.o:::asm/md5-sparcv8plus-gcc27.o::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
####
|
||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::::::::dlfcn:solaris-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### SPARC Solaris with Sun C setups
|
||||
# DO NOT use /xO[34] on sparc with SC3.0. It is broken, and will not pass the tests
|
||||
@@ -203,9 +203,8 @@ my %table=(
|
||||
# it's a real mess with -mcpu=ultrasparc option under Linux, but
|
||||
# -Wa,-Av8plus should do the trick no matter what.
|
||||
"linux-sparcv9","gcc:-mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8plus.o:::asm/md5-sparcv8plus.o::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
# !!!Folowing can't be even tested yet!!!
|
||||
# We have to wait till 64-bit glibc for SPARC is operational!!!
|
||||
#"linux64-sparcv9","sparc64-linux-gcc:-m64 -mcpu=v9 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT:ULTRASPARC::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::asm/md5-sparcv9.o:",
|
||||
# GCC 3.1 is a requirement
|
||||
"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::asm/md5-sparcv9.o::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
# Sunos configs, assuming sparc for the gcc one.
|
||||
##"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:::",
|
||||
@@ -392,7 +391,7 @@ my %table=(
|
||||
"linux-s390", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-s390x", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-x86_64", "gcc:-DL_ENDIAN -DNO_ASM ::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL:asm/x86_64-gcc.o:::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"NetBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"NetBSD-m68", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"NetBSD-x86", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
@@ -528,7 +527,7 @@ my %table=(
|
||||
"DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::",
|
||||
|
||||
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
|
||||
"ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN::(unknown):::::::",
|
||||
"ultrix-cc","cc:-std1 -O -Olimit 2500 -DL_ENDIAN::(unknown):::::::",
|
||||
"ultrix-gcc","gcc:-O3 -DL_ENDIAN::(unknown):::::::",
|
||||
# K&R C is no longer supported; you need gcc on old Ultrix installations
|
||||
##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::",
|
||||
@@ -1084,6 +1083,11 @@ if ($no_asm)
|
||||
$sha1_obj=$md5_obj=$rmd160_obj="";
|
||||
}
|
||||
|
||||
if (!$no_shared)
|
||||
{
|
||||
$cast_obj=""; # CAST assembler is not PIC
|
||||
}
|
||||
|
||||
if ($threads)
|
||||
{
|
||||
$cflags=$thread_cflags;
|
||||
@@ -1099,20 +1103,16 @@ if ($zlib)
|
||||
|
||||
# You will find shlib_mark1 and shlib_mark2 explained in Makefile.org
|
||||
my $shared_mark = "";
|
||||
if ($shared_target ne "")
|
||||
if ($shared_target eq "")
|
||||
{
|
||||
$no_shared = 1;
|
||||
}
|
||||
if (!$no_shared)
|
||||
{
|
||||
if ($shared_cflag ne "")
|
||||
{
|
||||
$cflags = "$shared_cflag $cflags";
|
||||
}
|
||||
if (!$no_shared)
|
||||
{
|
||||
#$shared_mark = "\$(SHARED_LIBS)";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$no_shared = 1;
|
||||
}
|
||||
|
||||
if ($sys_id ne "")
|
||||
|
||||
6
INSTALL
6
INSTALL
@@ -140,8 +140,8 @@
|
||||
standard headers). If it is a problem with OpenSSL itself, please
|
||||
report the problem to <openssl-bugs@openssl.org> (note that your
|
||||
message will be recorded in the request tracker publicly readable
|
||||
via http://www.openssl.org/rt2.html and will be forwarded to a public
|
||||
mailing list). Include the output of "make report" in your message.
|
||||
via http://www.openssl.org/support/rt2.html and will be forwarded to a
|
||||
public mailing list). Include the output of "make report" in your message.
|
||||
Please check out the request tracker. Maybe the bug was already
|
||||
reported or has already been fixed.
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
in Makefile.ssl and run "make clean; make". Please send a bug
|
||||
report to <openssl-bugs@openssl.org>, including the output of
|
||||
"make report" in order to be added to the request tracker at
|
||||
http://www.openssl.org/rt2.html.
|
||||
http://www.openssl.org/support/rt2.html.
|
||||
|
||||
4. If everything tests ok, install OpenSSL with
|
||||
|
||||
|
||||
56
Makefile.org
56
Makefile.org
@@ -15,6 +15,11 @@ OPTIONS=
|
||||
CONFIGURE_ARGS=
|
||||
SHLIB_TARGET=
|
||||
|
||||
# HERE indicates where this Makefile lives. This can be used to indicate
|
||||
# where sub-Makefiles are expected to be. Currently has very limited usage,
|
||||
# and should probably not be bothered with at all.
|
||||
HERE=.
|
||||
|
||||
# INSTALL_PREFIX is for package builders so that they can configure
|
||||
# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
|
||||
# Normally it is left empty.
|
||||
@@ -274,10 +279,7 @@ do_gnu-shared:
|
||||
libs="$$libs -l$$i"; \
|
||||
done
|
||||
|
||||
DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \
|
||||
my_ld=`${CC} -print-prog-name=ld 2>&1` && \
|
||||
[ -n "$$my_ld" ] && \
|
||||
$$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1
|
||||
DETECT_GNU_LD=(${CC} -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
|
||||
|
||||
# For Darwin AKA Mac OS/X (dyld)
|
||||
do_darwin-shared:
|
||||
@@ -355,10 +357,13 @@ do_solaris-shared:
|
||||
else \
|
||||
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
|
||||
( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
|
||||
set -x; ${CC} ${SHARED_LDFLAGS} \
|
||||
-G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
MINUSZ='-z '; \
|
||||
(${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
|
||||
set -x; ${CC} ${SHARED_LDFLAGS} -G -dy -z text \
|
||||
-o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
||||
-z allextract lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
$${MINUSZ}allextract lib$$i.a $${MINUSZ}defaultextract \
|
||||
$$libs ${EX_LIBS} -lc ) || exit 1; \
|
||||
libs="$$libs -l$$i"; \
|
||||
done; \
|
||||
fi
|
||||
@@ -597,7 +602,7 @@ rehash.time: certs
|
||||
@(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; \
|
||||
export OPENSSL OPENSSL_DEBUG_MEMORY; \
|
||||
LD_LIBRARY_PATH="`pwd`"; DYLD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \
|
||||
if [ "$(PLATFORM)" == "DJGPP" ]; then PATH="`pwd`\;$$PATH"; \
|
||||
if [ "$(PLATFORM)" = "DJGPP" ]; then PATH="`pwd`\;$$PATH"; \
|
||||
elif [ "$(PLATFORM)" != "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
|
||||
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
|
||||
$(PERL) tools/c_rehash certs)
|
||||
@@ -609,7 +614,7 @@ tests: rehash
|
||||
@(cd test && echo "testing..." && \
|
||||
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
|
||||
@LD_LIBRARY_PATH="`pwd`"; DYLD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \
|
||||
if [ "$(PLATFORM)" == "DJGPP" ]; then PATH="`pwd`\;$$PATH"; \
|
||||
if [ "$(PLATFORM)" = "DJGPP" ]; then PATH="`pwd`\;$$PATH"; \
|
||||
elif [ "$(PLATFORM)" != "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
|
||||
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
|
||||
apps/openssl version -a
|
||||
@@ -731,7 +736,7 @@ install: all install_docs
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
$(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
|
||||
fi; \
|
||||
done;
|
||||
@if [ -n "$(SHARED_LIBS)" ]; then \
|
||||
@@ -743,15 +748,15 @@ install: all install_docs
|
||||
if [ "$(PLATFORM)" != "Cygwin" ]; then \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
|
||||
mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
|
||||
else \
|
||||
c=`echo $$i | sed 's/^lib\(.*\)/cyg\1-$(SHLIB_VERSION_NUMBER)/'`; \
|
||||
cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
|
||||
mv $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
|
||||
cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
|
||||
mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
|
||||
fi ); \
|
||||
fi; \
|
||||
done; \
|
||||
@@ -769,6 +774,11 @@ install_docs:
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man5 \
|
||||
$(INSTALL_PREFIX)$(MANDIR)/man7
|
||||
@pod2man="`cd util; ./pod2mantest $(PERL)`"; \
|
||||
here="`pwd`"; \
|
||||
filecase=; \
|
||||
if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" ]; then \
|
||||
filecase=-i; \
|
||||
fi; \
|
||||
for i in doc/apps/*.pod; do \
|
||||
fn=`basename $$i .pod`; \
|
||||
if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
|
||||
@@ -778,10 +788,12 @@ install_docs:
|
||||
--section=$$sec --center=OpenSSL \
|
||||
--release=$(VERSION) `basename $$i`") \
|
||||
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$$sec; \
|
||||
$(PERL) util/extract-names.pl < $$i | grep -v "^$$fn" | \
|
||||
while read n; do \
|
||||
util/point.sh $$fn.$$sec $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$n.$$sec; \
|
||||
done; \
|
||||
$(PERL) util/extract-names.pl < $$i | \
|
||||
grep -v $$filecase "^$$fn\$$" | \
|
||||
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
|
||||
while read n; do \
|
||||
$$here/util/point.sh $$fn.$$sec $$n.$$sec; \
|
||||
done); \
|
||||
done; \
|
||||
for i in doc/crypto/*.pod doc/ssl/*.pod; do \
|
||||
fn=`basename $$i .pod`; \
|
||||
@@ -792,10 +804,12 @@ install_docs:
|
||||
--section=$$sec --center=OpenSSL \
|
||||
--release=$(VERSION) `basename $$i`") \
|
||||
> $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$$sec; \
|
||||
$(PERL) util/extract-names.pl < $$i | grep -v "^$$fn" | \
|
||||
while read n; do \
|
||||
util/point.sh $$fn.$$sec $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$n.$$sec; \
|
||||
done; \
|
||||
$(PERL) util/extract-names.pl < $$i | \
|
||||
grep -v $$filecase "^$$fn\$$" | \
|
||||
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
|
||||
while read n; do \
|
||||
$$here/util/point.sh $$fn.$$sec $$n.$$sec; \
|
||||
done); \
|
||||
done
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
5
NEWS
5
NEWS
@@ -18,11 +18,14 @@
|
||||
o New elliptic curve library section.
|
||||
o New AES (Rijndael) library section.
|
||||
o Support for new platforms: Windows CE, Tandem OSS, A/UX, AIX 64-bit,
|
||||
Linux x86_64
|
||||
Linux x86_64, Linux 64-bit on Sparc v9
|
||||
o Extended support for some platforms: VxWorks
|
||||
o Enhanced support for shared libraries.
|
||||
o Now only builds PIC code when shared library support is requested.
|
||||
o Support for pkg-config.
|
||||
o Lots of new manuals.
|
||||
o Makes symbolic links to or copies of manuals to cover all described
|
||||
functions.
|
||||
o Change DES API to clean up the namespace (some applications link also
|
||||
against libdes providing similar functions having the same name).
|
||||
Provide macros for backward compatibility (will be removed in the
|
||||
|
||||
2
README
2
README
@@ -1,5 +1,5 @@
|
||||
|
||||
OpenSSL 0.9.7-beta5 5 Dec 2002
|
||||
OpenSSL 0.9.7-beta6 17 Dec 2002
|
||||
|
||||
Copyright (c) 1998-2002 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
|
||||
6
STATUS
6
STATUS
@@ -1,10 +1,11 @@
|
||||
|
||||
OpenSSL STATUS Last modified at
|
||||
______________ $Date: 2002/12/05 22:51:17 $
|
||||
______________ $Date: 2002/12/17 14:24:51 $
|
||||
|
||||
DEVELOPMENT STATE
|
||||
|
||||
o OpenSSL 0.9.8: Under development...
|
||||
o OpenSSL 0.9.7-beta6: Released on December 17th, 2002
|
||||
o OpenSSL 0.9.7-beta5: Released on December 5th, 2002
|
||||
o OpenSSL 0.9.7-beta4: Released on November 19th, 2002
|
||||
o OpenSSL 0.9.7-beta3: Released on July 30th, 2002
|
||||
@@ -67,9 +68,8 @@
|
||||
UTIL (a new set of library functions to support some higher level
|
||||
functionality that is currently missing).
|
||||
Shared library support for VMS.
|
||||
Kerberos 5 authentication
|
||||
Kerberos 5 authentication (Heimdal)
|
||||
Constification
|
||||
OCSP
|
||||
|
||||
NEEDS PATCH
|
||||
|
||||
|
||||
53
TABLE
53
TABLE
@@ -1945,7 +1945,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -1995,7 +1995,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -3377,13 +3377,13 @@ $arflags =
|
||||
|
||||
*** linux-x86_64
|
||||
$cc = gcc
|
||||
$cflags = -DL_ENDIAN -DNO_ASM
|
||||
$cflags = -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id =
|
||||
$lflags = -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG
|
||||
$bn_obj =
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL
|
||||
$bn_obj = asm/x86_64-gcc.o
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj =
|
||||
@@ -3395,7 +3395,32 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= linux-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -m64
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
|
||||
*** linux64-sparcv9
|
||||
$cc = gcc
|
||||
$cflags = -m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
|
||||
$unistd =
|
||||
$thread_cflag = -D_REENTRANT
|
||||
$sys_id = ULTRASPARC
|
||||
$lflags = -ldl
|
||||
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
|
||||
$bn_obj =
|
||||
$des_obj =
|
||||
$bf_obj =
|
||||
$md5_obj = asm/md5-sparcv9.o
|
||||
$sha1_obj =
|
||||
$cast_obj =
|
||||
$rc4_obj =
|
||||
$rmd160_obj =
|
||||
$rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= linux-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag = -m64
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -3770,7 +3795,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -3820,7 +3845,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -3870,7 +3895,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -3895,7 +3920,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -3945,7 +3970,7 @@ $rc5_obj = asm/r586-sol.o
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag =
|
||||
$shared_ldflag = -shared
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -3995,7 +4020,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag = -m64
|
||||
$shared_ldflag = -m64 -shared
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -4020,7 +4045,7 @@ $rc5_obj =
|
||||
$dso_scheme = dlfcn
|
||||
$shared_target= solaris-shared
|
||||
$shared_cflag = -fPIC
|
||||
$shared_ldflag = -m64
|
||||
$shared_ldflag = -m64 -shared
|
||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
|
||||
$ranlib =
|
||||
$arflags =
|
||||
@@ -4077,7 +4102,7 @@ $arflags =
|
||||
|
||||
*** ultrix-cc
|
||||
$cc = cc
|
||||
$cflags = -std1 -O -Olimit 1000 -DL_ENDIAN
|
||||
$cflags = -std1 -O -Olimit 2500 -DL_ENDIAN
|
||||
$unistd =
|
||||
$thread_cflag = (unknown)
|
||||
$sys_id =
|
||||
|
||||
@@ -99,17 +99,20 @@ install:
|
||||
@for i in $(EXE); \
|
||||
do \
|
||||
(echo installing $$i; \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
|
||||
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
|
||||
done;
|
||||
@for i in $(SCRIPTS); \
|
||||
do \
|
||||
(echo installing $$i; \
|
||||
cp $$i $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i ); \
|
||||
cp $$i $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i.new; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/misc/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/misc/$$i ); \
|
||||
done
|
||||
@cp openssl.cnf $(INSTALL_PREFIX)$(OPENSSLDIR); \
|
||||
chmod 644 $(INSTALL_PREFIX)$(OPENSSLDIR)/openssl.cnf
|
||||
@cp openssl.cnf $(INSTALL_PREFIX)$(OPENSSLDIR)/openssl.cnf.new; \
|
||||
chmod 644 $(INSTALL_PREFIX)$(OPENSSLDIR)/openssl.cnf.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(OPENSSLDIR)/openssl.cnf.new $(INSTALL_PREFIX)$(OPENSSLDIR)/openssl.cnf
|
||||
|
||||
tags:
|
||||
ctags $(SRC)
|
||||
@@ -148,7 +151,7 @@ $(PROGRAM): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
|
||||
fi
|
||||
-(cd ..; OPENSSL="`pwd`/apps/openssl"; export OPENSSL; \
|
||||
LIBPATH="`pwd`"; LD_LIBRARY_PATH="`pwd`"; DYLD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; \
|
||||
if [ "$(PLATFORM)" == "DJGPP" ]; then PATH="`pwd`\;$$PATH"; \
|
||||
if [ "$(PLATFORM)" = "DJGPP" ]; then PATH="`pwd`\;$$PATH"; \
|
||||
elif [ "$(PLATFORM)" != "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
|
||||
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
|
||||
$(PERL) tools/c_rehash certs)
|
||||
|
||||
13
config
13
config
@@ -547,12 +547,13 @@ EOF
|
||||
ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
|
||||
i386-apple-darwin*) OUT="darwin-i386-cc" ;;
|
||||
sparc64-*-linux2)
|
||||
#Before we can uncomment following lines we have to wait at least
|
||||
#till 64-bit glibc for SPARC is operational:-(
|
||||
#echo "WARNING! If you wish to build 64-bit library, then you have to"
|
||||
#echo " invoke './Configure linux64-sparcv9' *manually*."
|
||||
#echo " Type return if you want to continue, Ctrl-C to abort."
|
||||
#read waste < /dev/tty
|
||||
echo "WARNING! If *know* that your GNU C supports 64-bit/V9 ABI"
|
||||
echo " and wish to build 64-bit library, then you have to"
|
||||
echo " invoke './Configure linux64-sparcv9' *manually*."
|
||||
if [ "$TEST" = "false" ]; then
|
||||
echo " You have about 5 seconds to press Ctrl-C to abort."
|
||||
(stty -icanon min 0 time 50; read waste) < /dev/tty
|
||||
fi
|
||||
OUT="linux-sparcv9" ;;
|
||||
sparc-*-linux2)
|
||||
KARCH=`awk '/^type/{print$3}' /proc/cpuinfo`
|
||||
|
||||
@@ -149,7 +149,12 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
|
||||
ASN1_CTX c;
|
||||
int want=HEADER_SIZE;
|
||||
int eos=0;
|
||||
#if defined(__GNUC__) && defined(__ia64)
|
||||
/* pathetic compiler bug in all known versions as of Nov. 2002 */
|
||||
long off=0;
|
||||
#else
|
||||
int off=0;
|
||||
#endif
|
||||
int len=0;
|
||||
|
||||
b=BUF_MEM_new();
|
||||
|
||||
@@ -136,6 +136,8 @@ asm/ia64-cpp.o: asm/ia64.S
|
||||
$(CC) $(ASFLAGS) -c -o asm/ia64-cpp.o /tmp/ia64.$$$$.s; \
|
||||
rm -f /tmp/ia64.$$$$.s
|
||||
|
||||
asm/x86_64-gcc.o: asm/x86_64-gcc.c
|
||||
|
||||
files:
|
||||
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
|
||||
|
||||
|
||||
575
crypto/bn/asm/x86_64-gcc.c
Normal file
575
crypto/bn/asm/x86_64-gcc.c
Normal file
@@ -0,0 +1,575 @@
|
||||
/*
|
||||
* x86_64 BIGNUM accelerator version 0.1, December 2002.
|
||||
*
|
||||
* Implemented by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
|
||||
* project.
|
||||
*
|
||||
* Rights for redistribution and usage in source and binary forms are
|
||||
* granted according to the OpenSSL license. Warranty of any kind is
|
||||
* disclaimed.
|
||||
*
|
||||
* Q. Version 0.1? It doesn't sound like Andy, he used to assign real
|
||||
* versions, like 1.0...
|
||||
* A. Well, that's because this code is basically a quick-n-dirty
|
||||
* proof-of-concept hack. As you can see it's implemented with
|
||||
* inline assembler, which means that you're bound to GCC and that
|
||||
* there must be a room for fine-tuning.
|
||||
*
|
||||
* Q. Why inline assembler?
|
||||
* A. x86_64 features own ABI I'm not familiar with. Which is why
|
||||
* I decided to let the compiler take care of subroutine
|
||||
* prologue/epilogue as well as register allocation.
|
||||
*
|
||||
* Q. How much faster does it get?
|
||||
* A. Unfortunately people sitting on x86_64 hardware are prohibited
|
||||
* to disclose the performance numbers, so they (SuSE labs to be
|
||||
* specific) wouldn't tell me. However! Very similar coding technique
|
||||
* (reaching out for 128-bit result from 64x64-bit multiplication)
|
||||
* results in >3 times performance improvement on MIPS and I see no
|
||||
* reason why gain on x86_64 would be so much different:-)
|
||||
*/
|
||||
|
||||
#define BN_ULONG unsigned long
|
||||
|
||||
/*
|
||||
* "m"(a), "+m"(r) is the way to favor DirectPath <20>-code;
|
||||
* "g"(0) let the compiler to decide where does it
|
||||
* want to keep the value of zero;
|
||||
*/
|
||||
#define mul_add(r,a,word,carry) do { \
|
||||
register BN_ULONG high,low; \
|
||||
asm ("mulq %3" \
|
||||
: "=a"(low),"=d"(high) \
|
||||
: "a"(word),"m"(a) \
|
||||
: "cc"); \
|
||||
asm ("addq %2,%0; adcq %3,%1" \
|
||||
: "+r"(carry),"+d"(high)\
|
||||
: "a"(low),"g"(0) \
|
||||
: "cc"); \
|
||||
asm ("addq %2,%0; adcq %3,%1" \
|
||||
: "+m"(r),"+d"(high) \
|
||||
: "r"(carry),"g"(0) \
|
||||
: "cc"); \
|
||||
carry=high; \
|
||||
} while (0)
|
||||
|
||||
#define mul(r,a,word,carry) do { \
|
||||
register BN_ULONG high,low; \
|
||||
asm ("mulq %3" \
|
||||
: "=a"(low),"=d"(high) \
|
||||
: "a"(word),"g"(a) \
|
||||
: "cc"); \
|
||||
asm ("addq %2,%0; adcq %3,%1" \
|
||||
: "+r"(carry),"+d"(high)\
|
||||
: "a"(low),"g"(0) \
|
||||
: "cc"); \
|
||||
(r)=carry, carry=high; \
|
||||
} while (0)
|
||||
|
||||
#define sqr(r0,r1,a) \
|
||||
asm ("mulq %2" \
|
||||
: "=a"(r0),"=d"(r1) \
|
||||
: "a"(a) \
|
||||
: "cc");
|
||||
|
||||
BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w)
|
||||
{
|
||||
BN_ULONG c1=0;
|
||||
|
||||
if (num <= 0) return(c1);
|
||||
|
||||
while (num&~3)
|
||||
{
|
||||
mul_add(rp[0],ap[0],w,c1);
|
||||
mul_add(rp[1],ap[1],w,c1);
|
||||
mul_add(rp[2],ap[2],w,c1);
|
||||
mul_add(rp[3],ap[3],w,c1);
|
||||
ap+=4; rp+=4; num-=4;
|
||||
}
|
||||
if (num)
|
||||
{
|
||||
mul_add(rp[0],ap[0],w,c1); if (--num==0) return c1;
|
||||
mul_add(rp[1],ap[1],w,c1); if (--num==0) return c1;
|
||||
mul_add(rp[2],ap[2],w,c1); return c1;
|
||||
}
|
||||
|
||||
return(c1);
|
||||
}
|
||||
|
||||
BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w)
|
||||
{
|
||||
BN_ULONG c1=0;
|
||||
|
||||
if (num <= 0) return(c1);
|
||||
|
||||
while (num&~3)
|
||||
{
|
||||
mul(rp[0],ap[0],w,c1);
|
||||
mul(rp[1],ap[1],w,c1);
|
||||
mul(rp[2],ap[2],w,c1);
|
||||
mul(rp[3],ap[3],w,c1);
|
||||
ap+=4; rp+=4; num-=4;
|
||||
}
|
||||
if (num)
|
||||
{
|
||||
mul(rp[0],ap[0],w,c1); if (--num == 0) return c1;
|
||||
mul(rp[1],ap[1],w,c1); if (--num == 0) return c1;
|
||||
mul(rp[2],ap[2],w,c1);
|
||||
}
|
||||
return(c1);
|
||||
}
|
||||
|
||||
void bn_sqr_words(BN_ULONG *r, BN_ULONG *a, int n)
|
||||
{
|
||||
if (n <= 0) return;
|
||||
|
||||
while (n&~3)
|
||||
{
|
||||
sqr(r[0],r[1],a[0]);
|
||||
sqr(r[2],r[3],a[1]);
|
||||
sqr(r[4],r[5],a[2]);
|
||||
sqr(r[6],r[7],a[3]);
|
||||
a+=4; r+=8; n-=4;
|
||||
}
|
||||
if (n)
|
||||
{
|
||||
sqr(r[0],r[1],a[0]); if (--n == 0) return;
|
||||
sqr(r[2],r[3],a[1]); if (--n == 0) return;
|
||||
sqr(r[4],r[5],a[2]);
|
||||
}
|
||||
}
|
||||
|
||||
BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
|
||||
{ BN_ULONG ret,waste;
|
||||
|
||||
asm ("divq %3"
|
||||
: "=a"(ret),"=d"(waste)
|
||||
: "a"(l),"d"(h),"g"(d)
|
||||
: "cc");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
BN_ULONG bn_add_words (BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,int n)
|
||||
{ BN_ULONG ret,i;
|
||||
|
||||
if (n <= 0) return 0;
|
||||
|
||||
asm (
|
||||
" subq %2,%2 \n"
|
||||
".align 16 \n"
|
||||
"1: movq (%4,%2,8),%0 \n"
|
||||
" adcq (%5,%2,8),%0 \n"
|
||||
" movq %0,(%3,%2,8) \n"
|
||||
" leaq 1(%2),%2 \n"
|
||||
" loop 1b \n"
|
||||
" sbbq %0,%0 \n"
|
||||
: "+a"(ret),"+c"(n),"+r"(i)
|
||||
: "r"(rp),"r"(ap),"r"(bp)
|
||||
: "cc"
|
||||
);
|
||||
|
||||
return ret&1;
|
||||
}
|
||||
|
||||
#ifndef SIMICS
|
||||
BN_ULONG bn_sub_words (BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,int n)
|
||||
{ BN_ULONG ret,i;
|
||||
|
||||
if (n <= 0) return 0;
|
||||
|
||||
asm (
|
||||
" subq %2,%2 \n"
|
||||
".align 16 \n"
|
||||
"1: movq (%4,%2,8),%0 \n"
|
||||
" sbbq (%5,%2,8),%0 \n"
|
||||
" movq %0,(%3,%2,8) \n"
|
||||
" leaq 1(%2),%2 \n"
|
||||
" loop 1b \n"
|
||||
" sbbq %0,%0 \n"
|
||||
: "+a"(ret),"+c"(n),"+r"(i)
|
||||
: "r"(rp),"r"(ap),"r"(bp)
|
||||
: "cc"
|
||||
);
|
||||
|
||||
return ret&1;
|
||||
}
|
||||
#else
|
||||
/* Simics 1.4<7 has buggy sbbq:-( */
|
||||
#define BN_MASK2 0xffffffffffffffffL
|
||||
BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
|
||||
{
|
||||
BN_ULONG t1,t2;
|
||||
int c=0;
|
||||
|
||||
if (n <= 0) return((BN_ULONG)0);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
t1=a[0]; t2=b[0];
|
||||
r[0]=(t1-t2-c)&BN_MASK2;
|
||||
if (t1 != t2) c=(t1 < t2);
|
||||
if (--n <= 0) break;
|
||||
|
||||
t1=a[1]; t2=b[1];
|
||||
r[1]=(t1-t2-c)&BN_MASK2;
|
||||
if (t1 != t2) c=(t1 < t2);
|
||||
if (--n <= 0) break;
|
||||
|
||||
t1=a[2]; t2=b[2];
|
||||
r[2]=(t1-t2-c)&BN_MASK2;
|
||||
if (t1 != t2) c=(t1 < t2);
|
||||
if (--n <= 0) break;
|
||||
|
||||
t1=a[3]; t2=b[3];
|
||||
r[3]=(t1-t2-c)&BN_MASK2;
|
||||
if (t1 != t2) c=(t1 < t2);
|
||||
if (--n <= 0) break;
|
||||
|
||||
a+=4;
|
||||
b+=4;
|
||||
r+=4;
|
||||
}
|
||||
return(c);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* mul_add_c(a,b,c0,c1,c2) -- c+=a*b for three word number c=(c2,c1,c0) */
|
||||
/* mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) */
|
||||
/* sqr_add_c(a,i,c0,c1,c2) -- c+=a[i]^2 for three word number c=(c2,c1,c0) */
|
||||
/* sqr_add_c2(a,i,c0,c1,c2) -- c+=2*a[i]*a[j] for three word number c=(c2,c1,c0) */
|
||||
|
||||
#if 0
|
||||
/* original macros are kept for reference purposes */
|
||||
#define mul_add_c(a,b,c0,c1,c2) { \
|
||||
BN_ULONG ta=(a),tb=(b); \
|
||||
t1 = ta * tb; \
|
||||
t2 = BN_UMULT_HIGH(ta,tb); \
|
||||
c0 += t1; t2 += (c0<t1)?1:0; \
|
||||
c1 += t2; c2 += (c1<t2)?1:0; \
|
||||
}
|
||||
|
||||
#define mul_add_c2(a,b,c0,c1,c2) { \
|
||||
BN_ULONG ta=(a),tb=(b),t0; \
|
||||
t1 = BN_UMULT_HIGH(ta,tb); \
|
||||
t0 = ta * tb; \
|
||||
t2 = t1+t1; c2 += (t2<t1)?1:0; \
|
||||
t1 = t0+t0; t2 += (t1<t0)?1:0; \
|
||||
c0 += t1; t2 += (c0<t1)?1:0; \
|
||||
c1 += t2; c2 += (c1<t2)?1:0; \
|
||||
}
|
||||
#else
|
||||
#define mul_add_c(a,b,c0,c1,c2) do { \
|
||||
asm ("mulq %3" \
|
||||
: "=a"(t1),"=d"(t2) \
|
||||
: "a"(a),"m"(b) \
|
||||
: "cc"); \
|
||||
asm ("addq %2,%0; adcq %3,%1" \
|
||||
: "+r"(c0),"+d"(t2) \
|
||||
: "a"(t1),"g"(0) \
|
||||
: "cc"); \
|
||||
asm ("addq %2,%0; adcq %3,%1" \
|
||||
: "+r"(c1),"+r"(c2) \
|
||||
: "d"(t2),"g"(0) \
|
||||
: "cc"); \
|
||||
} while (0)
|
||||
|
||||
#define sqr_add_c(a,i,c0,c1,c2) do { \
|
||||
asm ("mulq %2" \
|
||||
: "=a"(t1),"=d"(t2) \
|
||||
: "a"(a[i]) \
|
||||
: "cc"); \
|
||||
asm ("addq %2,%0; adcq %3,%1" \
|
||||
: "+r"(c0),"+d"(t2) \
|
||||
: "a"(t1),"g"(0) \
|
||||
: "cc"); \
|
||||
asm ("addq %2,%0; adcq %3,%1" \
|
||||
: "+r"(c1),"+r"(c2) \
|
||||
: "d"(t2),"g"(0) \
|
||||
: "cc"); \
|
||||
} while (0)
|
||||
|
||||
#define mul_add_c2(a,b,c0,c1,c2) do { \
|
||||
asm ("mulq %3" \
|
||||
: "=a"(t1),"=d"(t2) \
|
||||
: "a"(a),"m"(b) \
|
||||
: "cc"); \
|
||||
asm ("addq %0,%0; adcq %2,%1" \
|
||||
: "+d"(t2),"+r"(c2) \
|
||||
: "g"(0) \
|
||||
: "cc"); \
|
||||
asm ("addq %0,%0; adcq %2,%1" \
|
||||
: "+a"(t1),"+d"(t2) \
|
||||
: "g"(0) \
|
||||
: "cc"); \
|
||||
asm ("addq %2,%0; adcq %3,%1" \
|
||||
: "+r"(c0),"+d"(t2) \
|
||||
: "a"(t1),"g"(0) \
|
||||
: "cc"); \
|
||||
asm ("addq %2,%0; adcq %3,%1" \
|
||||
: "+r"(c1),"+r"(c2) \
|
||||
: "d"(t2),"g"(0) \
|
||||
: "cc"); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#define sqr_add_c2(a,i,j,c0,c1,c2) \
|
||||
mul_add_c2((a)[i],(a)[j],c0,c1,c2)
|
||||
|
||||
void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
|
||||
{
|
||||
BN_ULONG bl,bh;
|
||||
BN_ULONG t1,t2;
|
||||
BN_ULONG c1,c2,c3;
|
||||
|
||||
c1=0;
|
||||
c2=0;
|
||||
c3=0;
|
||||
mul_add_c(a[0],b[0],c1,c2,c3);
|
||||
r[0]=c1;
|
||||
c1=0;
|
||||
mul_add_c(a[0],b[1],c2,c3,c1);
|
||||
mul_add_c(a[1],b[0],c2,c3,c1);
|
||||
r[1]=c2;
|
||||
c2=0;
|
||||
mul_add_c(a[2],b[0],c3,c1,c2);
|
||||
mul_add_c(a[1],b[1],c3,c1,c2);
|
||||
mul_add_c(a[0],b[2],c3,c1,c2);
|
||||
r[2]=c3;
|
||||
c3=0;
|
||||
mul_add_c(a[0],b[3],c1,c2,c3);
|
||||
mul_add_c(a[1],b[2],c1,c2,c3);
|
||||
mul_add_c(a[2],b[1],c1,c2,c3);
|
||||
mul_add_c(a[3],b[0],c1,c2,c3);
|
||||
r[3]=c1;
|
||||
c1=0;
|
||||
mul_add_c(a[4],b[0],c2,c3,c1);
|
||||
mul_add_c(a[3],b[1],c2,c3,c1);
|
||||
mul_add_c(a[2],b[2],c2,c3,c1);
|
||||
mul_add_c(a[1],b[3],c2,c3,c1);
|
||||
mul_add_c(a[0],b[4],c2,c3,c1);
|
||||
r[4]=c2;
|
||||
c2=0;
|
||||
mul_add_c(a[0],b[5],c3,c1,c2);
|
||||
mul_add_c(a[1],b[4],c3,c1,c2);
|
||||
mul_add_c(a[2],b[3],c3,c1,c2);
|
||||
mul_add_c(a[3],b[2],c3,c1,c2);
|
||||
mul_add_c(a[4],b[1],c3,c1,c2);
|
||||
mul_add_c(a[5],b[0],c3,c1,c2);
|
||||
r[5]=c3;
|
||||
c3=0;
|
||||
mul_add_c(a[6],b[0],c1,c2,c3);
|
||||
mul_add_c(a[5],b[1],c1,c2,c3);
|
||||
mul_add_c(a[4],b[2],c1,c2,c3);
|
||||
mul_add_c(a[3],b[3],c1,c2,c3);
|
||||
mul_add_c(a[2],b[4],c1,c2,c3);
|
||||
mul_add_c(a[1],b[5],c1,c2,c3);
|
||||
mul_add_c(a[0],b[6],c1,c2,c3);
|
||||
r[6]=c1;
|
||||
c1=0;
|
||||
mul_add_c(a[0],b[7],c2,c3,c1);
|
||||
mul_add_c(a[1],b[6],c2,c3,c1);
|
||||
mul_add_c(a[2],b[5],c2,c3,c1);
|
||||
mul_add_c(a[3],b[4],c2,c3,c1);
|
||||
mul_add_c(a[4],b[3],c2,c3,c1);
|
||||
mul_add_c(a[5],b[2],c2,c3,c1);
|
||||
mul_add_c(a[6],b[1],c2,c3,c1);
|
||||
mul_add_c(a[7],b[0],c2,c3,c1);
|
||||
r[7]=c2;
|
||||
c2=0;
|
||||
mul_add_c(a[7],b[1],c3,c1,c2);
|
||||
mul_add_c(a[6],b[2],c3,c1,c2);
|
||||
mul_add_c(a[5],b[3],c3,c1,c2);
|
||||
mul_add_c(a[4],b[4],c3,c1,c2);
|
||||
mul_add_c(a[3],b[5],c3,c1,c2);
|
||||
mul_add_c(a[2],b[6],c3,c1,c2);
|
||||
mul_add_c(a[1],b[7],c3,c1,c2);
|
||||
r[8]=c3;
|
||||
c3=0;
|
||||
mul_add_c(a[2],b[7],c1,c2,c3);
|
||||
mul_add_c(a[3],b[6],c1,c2,c3);
|
||||
mul_add_c(a[4],b[5],c1,c2,c3);
|
||||
mul_add_c(a[5],b[4],c1,c2,c3);
|
||||
mul_add_c(a[6],b[3],c1,c2,c3);
|
||||
mul_add_c(a[7],b[2],c1,c2,c3);
|
||||
r[9]=c1;
|
||||
c1=0;
|
||||
mul_add_c(a[7],b[3],c2,c3,c1);
|
||||
mul_add_c(a[6],b[4],c2,c3,c1);
|
||||
mul_add_c(a[5],b[5],c2,c3,c1);
|
||||
mul_add_c(a[4],b[6],c2,c3,c1);
|
||||
mul_add_c(a[3],b[7],c2,c3,c1);
|
||||
r[10]=c2;
|
||||
c2=0;
|
||||
mul_add_c(a[4],b[7],c3,c1,c2);
|
||||
mul_add_c(a[5],b[6],c3,c1,c2);
|
||||
mul_add_c(a[6],b[5],c3,c1,c2);
|
||||
mul_add_c(a[7],b[4],c3,c1,c2);
|
||||
r[11]=c3;
|
||||
c3=0;
|
||||
mul_add_c(a[7],b[5],c1,c2,c3);
|
||||
mul_add_c(a[6],b[6],c1,c2,c3);
|
||||
mul_add_c(a[5],b[7],c1,c2,c3);
|
||||
r[12]=c1;
|
||||
c1=0;
|
||||
mul_add_c(a[6],b[7],c2,c3,c1);
|
||||
mul_add_c(a[7],b[6],c2,c3,c1);
|
||||
r[13]=c2;
|
||||
c2=0;
|
||||
mul_add_c(a[7],b[7],c3,c1,c2);
|
||||
r[14]=c3;
|
||||
r[15]=c1;
|
||||
}
|
||||
|
||||
void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
|
||||
{
|
||||
BN_ULONG bl,bh;
|
||||
BN_ULONG t1,t2;
|
||||
BN_ULONG c1,c2,c3;
|
||||
|
||||
c1=0;
|
||||
c2=0;
|
||||
c3=0;
|
||||
mul_add_c(a[0],b[0],c1,c2,c3);
|
||||
r[0]=c1;
|
||||
c1=0;
|
||||
mul_add_c(a[0],b[1],c2,c3,c1);
|
||||
mul_add_c(a[1],b[0],c2,c3,c1);
|
||||
r[1]=c2;
|
||||
c2=0;
|
||||
mul_add_c(a[2],b[0],c3,c1,c2);
|
||||
mul_add_c(a[1],b[1],c3,c1,c2);
|
||||
mul_add_c(a[0],b[2],c3,c1,c2);
|
||||
r[2]=c3;
|
||||
c3=0;
|
||||
mul_add_c(a[0],b[3],c1,c2,c3);
|
||||
mul_add_c(a[1],b[2],c1,c2,c3);
|
||||
mul_add_c(a[2],b[1],c1,c2,c3);
|
||||
mul_add_c(a[3],b[0],c1,c2,c3);
|
||||
r[3]=c1;
|
||||
c1=0;
|
||||
mul_add_c(a[3],b[1],c2,c3,c1);
|
||||
mul_add_c(a[2],b[2],c2,c3,c1);
|
||||
mul_add_c(a[1],b[3],c2,c3,c1);
|
||||
r[4]=c2;
|
||||
c2=0;
|
||||
mul_add_c(a[2],b[3],c3,c1,c2);
|
||||
mul_add_c(a[3],b[2],c3,c1,c2);
|
||||
r[5]=c3;
|
||||
c3=0;
|
||||
mul_add_c(a[3],b[3],c1,c2,c3);
|
||||
r[6]=c1;
|
||||
r[7]=c2;
|
||||
}
|
||||
|
||||
void bn_sqr_comba8(BN_ULONG *r, BN_ULONG *a)
|
||||
{
|
||||
BN_ULONG bl,bh;
|
||||
BN_ULONG t1,t2;
|
||||
BN_ULONG c1,c2,c3;
|
||||
|
||||
c1=0;
|
||||
c2=0;
|
||||
c3=0;
|
||||
sqr_add_c(a,0,c1,c2,c3);
|
||||
r[0]=c1;
|
||||
c1=0;
|
||||
sqr_add_c2(a,1,0,c2,c3,c1);
|
||||
r[1]=c2;
|
||||
c2=0;
|
||||
sqr_add_c(a,1,c3,c1,c2);
|
||||
sqr_add_c2(a,2,0,c3,c1,c2);
|
||||
r[2]=c3;
|
||||
c3=0;
|
||||
sqr_add_c2(a,3,0,c1,c2,c3);
|
||||
sqr_add_c2(a,2,1,c1,c2,c3);
|
||||
r[3]=c1;
|
||||
c1=0;
|
||||
sqr_add_c(a,2,c2,c3,c1);
|
||||
sqr_add_c2(a,3,1,c2,c3,c1);
|
||||
sqr_add_c2(a,4,0,c2,c3,c1);
|
||||
r[4]=c2;
|
||||
c2=0;
|
||||
sqr_add_c2(a,5,0,c3,c1,c2);
|
||||
sqr_add_c2(a,4,1,c3,c1,c2);
|
||||
sqr_add_c2(a,3,2,c3,c1,c2);
|
||||
r[5]=c3;
|
||||
c3=0;
|
||||
sqr_add_c(a,3,c1,c2,c3);
|
||||
sqr_add_c2(a,4,2,c1,c2,c3);
|
||||
sqr_add_c2(a,5,1,c1,c2,c3);
|
||||
sqr_add_c2(a,6,0,c1,c2,c3);
|
||||
r[6]=c1;
|
||||
c1=0;
|
||||
sqr_add_c2(a,7,0,c2,c3,c1);
|
||||
sqr_add_c2(a,6,1,c2,c3,c1);
|
||||
sqr_add_c2(a,5,2,c2,c3,c1);
|
||||
sqr_add_c2(a,4,3,c2,c3,c1);
|
||||
r[7]=c2;
|
||||
c2=0;
|
||||
sqr_add_c(a,4,c3,c1,c2);
|
||||
sqr_add_c2(a,5,3,c3,c1,c2);
|
||||
sqr_add_c2(a,6,2,c3,c1,c2);
|
||||
sqr_add_c2(a,7,1,c3,c1,c2);
|
||||
r[8]=c3;
|
||||
c3=0;
|
||||
sqr_add_c2(a,7,2,c1,c2,c3);
|
||||
sqr_add_c2(a,6,3,c1,c2,c3);
|
||||
sqr_add_c2(a,5,4,c1,c2,c3);
|
||||
r[9]=c1;
|
||||
c1=0;
|
||||
sqr_add_c(a,5,c2,c3,c1);
|
||||
sqr_add_c2(a,6,4,c2,c3,c1);
|
||||
sqr_add_c2(a,7,3,c2,c3,c1);
|
||||
r[10]=c2;
|
||||
c2=0;
|
||||
sqr_add_c2(a,7,4,c3,c1,c2);
|
||||
sqr_add_c2(a,6,5,c3,c1,c2);
|
||||
r[11]=c3;
|
||||
c3=0;
|
||||
sqr_add_c(a,6,c1,c2,c3);
|
||||
sqr_add_c2(a,7,5,c1,c2,c3);
|
||||
r[12]=c1;
|
||||
c1=0;
|
||||
sqr_add_c2(a,7,6,c2,c3,c1);
|
||||
r[13]=c2;
|
||||
c2=0;
|
||||
sqr_add_c(a,7,c3,c1,c2);
|
||||
r[14]=c3;
|
||||
r[15]=c1;
|
||||
}
|
||||
|
||||
void bn_sqr_comba4(BN_ULONG *r, BN_ULONG *a)
|
||||
{
|
||||
BN_ULONG bl,bh;
|
||||
BN_ULONG t1,t2;
|
||||
BN_ULONG c1,c2,c3;
|
||||
|
||||
c1=0;
|
||||
c2=0;
|
||||
c3=0;
|
||||
sqr_add_c(a,0,c1,c2,c3);
|
||||
r[0]=c1;
|
||||
c1=0;
|
||||
sqr_add_c2(a,1,0,c2,c3,c1);
|
||||
r[1]=c2;
|
||||
c2=0;
|
||||
sqr_add_c(a,1,c3,c1,c2);
|
||||
sqr_add_c2(a,2,0,c3,c1,c2);
|
||||
r[2]=c3;
|
||||
c3=0;
|
||||
sqr_add_c2(a,3,0,c1,c2,c3);
|
||||
sqr_add_c2(a,2,1,c1,c2,c3);
|
||||
r[3]=c1;
|
||||
c1=0;
|
||||
sqr_add_c(a,2,c2,c3,c1);
|
||||
sqr_add_c2(a,3,1,c2,c3,c1);
|
||||
r[4]=c2;
|
||||
c2=0;
|
||||
sqr_add_c2(a,3,2,c3,c1,c2);
|
||||
r[5]=c3;
|
||||
c3=0;
|
||||
sqr_add_c(a,3,c1,c2,c3);
|
||||
r[6]=c1;
|
||||
r[7]=c2;
|
||||
}
|
||||
@@ -150,6 +150,20 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
|
||||
q; \
|
||||
})
|
||||
# define REMAINDER_IS_ALREADY_CALCULATED
|
||||
# elif defined(__x86_64) && defined(SIXTY_FOUR_BIT_LONG)
|
||||
/*
|
||||
* Same story here, but it's 128-bit by 64-bit division. Wow!
|
||||
* <appro@fy.chalmers.se>
|
||||
*/
|
||||
# define bn_div_words(n0,n1,d0) \
|
||||
({ asm volatile ( \
|
||||
"divq %4" \
|
||||
: "=a"(q), "=d"(rem) \
|
||||
: "a"(n1), "d"(n0), "g"(d0) \
|
||||
: "cc"); \
|
||||
q; \
|
||||
})
|
||||
# define REMAINDER_IS_ALREADY_CALCULATED
|
||||
# endif /* __<cpu> */
|
||||
# endif /* __GNUC__ */
|
||||
#endif /* OPENSSL_NO_ASM */
|
||||
@@ -296,7 +310,9 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
|
||||
rem=(n1-q*d0)&BN_MASK2;
|
||||
#endif
|
||||
|
||||
#ifdef BN_UMULT_HIGH
|
||||
#if defined(BN_UMULT_LOHI)
|
||||
BN_UMULT_LOHI(t2l,t2h,d1,q);
|
||||
#elif defined(BN_UMULT_HIGH)
|
||||
t2l = d1 * q;
|
||||
t2h = BN_UMULT_HIGH(d1,q);
|
||||
#else
|
||||
|
||||
@@ -230,6 +230,21 @@ struct bignum_ctx
|
||||
: "r"(a), "r"(b)); \
|
||||
ret; })
|
||||
# endif /* compiler */
|
||||
# elif defined(__x86_64) && defined(SIXTY_FOUR_BIT_LONG)
|
||||
# if defined(__GNUC__)
|
||||
# define BN_UMULT_HIGH(a,b) ({ \
|
||||
register BN_ULONG ret,discard; \
|
||||
asm ("mulq %3" \
|
||||
: "=a"(discard),"=d"(ret) \
|
||||
: "a"(a), "g"(b) \
|
||||
: "cc"); \
|
||||
ret; })
|
||||
# define BN_UMULT_LOHI(low,high,a,b) \
|
||||
asm ("mulq %3" \
|
||||
: "=a"(low),"=d"(high) \
|
||||
: "a"(a),"g"(b) \
|
||||
: "cc");
|
||||
# endif
|
||||
# endif /* cpu */
|
||||
#endif /* OPENSSL_NO_ASM */
|
||||
|
||||
@@ -337,7 +352,7 @@ struct bignum_ctx
|
||||
|
||||
#define LBITS(a) ((a)&BN_MASK2l)
|
||||
#define HBITS(a) (((a)>>BN_BITS4)&BN_MASK2l)
|
||||
#define L2HBITS(a) ((BN_ULONG)((a)&BN_MASK2l)<<BN_BITS4)
|
||||
#define L2HBITS(a) (((a)<<BN_BITS4)&BN_MASK2)
|
||||
|
||||
#define LLBITS(a) ((a)&BN_MASKl)
|
||||
#define LHBITS(a) (((a)>>BN_BITS2)&BN_MASKl)
|
||||
@@ -418,10 +433,13 @@ void bn_sqr_comba4(BN_ULONG *r,const BN_ULONG *a);
|
||||
int bn_cmp_words(const BN_ULONG *a,const BN_ULONG *b,int n);
|
||||
int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b,
|
||||
int cl, int dl);
|
||||
#if 0
|
||||
/* bn_mul.c rollback <appro> */
|
||||
void bn_mul_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2,
|
||||
int dna,int dnb,BN_ULONG *t);
|
||||
void bn_mul_part_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,
|
||||
int n,int tna,int tnb,BN_ULONG *t);
|
||||
#endif
|
||||
void bn_sqr_recursive(BN_ULONG *r,const BN_ULONG *a, int n2, BN_ULONG *t);
|
||||
void bn_mul_low_normal(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b, int n);
|
||||
void bn_mul_low_recursive(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b,int n2,
|
||||
|
||||
@@ -56,325 +56,10 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifndef BN_DEBUG
|
||||
# undef NDEBUG /* avoid conflicting definitions */
|
||||
# define NDEBUG
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include "cryptlib.h"
|
||||
#include "bn_lcl.h"
|
||||
|
||||
#if defined(OPENSSL_NO_ASM) || !(defined(__i386) || defined(__i386__)) || defined(__DJGPP__) /* Assembler implementation exists only for x86 */
|
||||
/* Here follows specialised variants of bn_add_words() and
|
||||
bn_sub_words(). They have the property performing operations on
|
||||
arrays of different sizes. The sizes of those arrays is expressed through
|
||||
cl, which is the common length ( basicall, min(len(a),len(b)) ), and dl,
|
||||
which is the delta between the two lengths, calculated as len(a)-len(b).
|
||||
All lengths are the number of BN_ULONGs... For the operations that require
|
||||
a result array as parameter, it must have the length cl+abs(dl).
|
||||
These functions should probably end up in bn_asm.c as soon as there are
|
||||
assembler counterparts for the systems that use assembler files. */
|
||||
|
||||
BN_ULONG bn_sub_part_words(BN_ULONG *r,
|
||||
const BN_ULONG *a, const BN_ULONG *b,
|
||||
int cl, int dl)
|
||||
{
|
||||
BN_ULONG c, t;
|
||||
|
||||
assert(cl >= 0);
|
||||
c = bn_sub_words(r, a, b, cl);
|
||||
|
||||
if (dl == 0)
|
||||
return c;
|
||||
|
||||
r += cl;
|
||||
a += cl;
|
||||
b += cl;
|
||||
|
||||
if (dl < 0)
|
||||
{
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr, " bn_sub_part_words %d + %d (dl < 0, c = %d)\n", cl, dl, c);
|
||||
#endif
|
||||
for (;;)
|
||||
{
|
||||
t = b[0];
|
||||
r[0] = (0-t-c)&BN_MASK2;
|
||||
if (t != 0) c=1;
|
||||
if (++dl >= 0) break;
|
||||
|
||||
t = b[1];
|
||||
r[1] = (0-t-c)&BN_MASK2;
|
||||
if (t != 0) c=1;
|
||||
if (++dl >= 0) break;
|
||||
|
||||
t = b[2];
|
||||
r[2] = (0-t-c)&BN_MASK2;
|
||||
if (t != 0) c=1;
|
||||
if (++dl >= 0) break;
|
||||
|
||||
t = b[3];
|
||||
r[3] = (0-t-c)&BN_MASK2;
|
||||
if (t != 0) c=1;
|
||||
if (++dl >= 0) break;
|
||||
|
||||
b += 4;
|
||||
r += 4;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int save_dl = dl;
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr, " bn_sub_part_words %d + %d (dl > 0, c = %d)\n", cl, dl, c);
|
||||
#endif
|
||||
while(c)
|
||||
{
|
||||
t = a[0];
|
||||
r[0] = (t-c)&BN_MASK2;
|
||||
if (t != 0) c=0;
|
||||
if (--dl <= 0) break;
|
||||
|
||||
t = a[1];
|
||||
r[1] = (t-c)&BN_MASK2;
|
||||
if (t != 0) c=0;
|
||||
if (--dl <= 0) break;
|
||||
|
||||
t = a[2];
|
||||
r[2] = (t-c)&BN_MASK2;
|
||||
if (t != 0) c=0;
|
||||
if (--dl <= 0) break;
|
||||
|
||||
t = a[3];
|
||||
r[3] = (t-c)&BN_MASK2;
|
||||
if (t != 0) c=0;
|
||||
if (--dl <= 0) break;
|
||||
|
||||
save_dl = dl;
|
||||
a += 4;
|
||||
r += 4;
|
||||
}
|
||||
if (dl > 0)
|
||||
{
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr, " bn_sub_part_words %d + %d (dl > 0, c == 0)\n", cl, dl);
|
||||
#endif
|
||||
if (save_dl > dl)
|
||||
{
|
||||
switch (save_dl - dl)
|
||||
{
|
||||
case 1:
|
||||
r[1] = a[1];
|
||||
if (--dl <= 0) break;
|
||||
case 2:
|
||||
r[2] = a[2];
|
||||
if (--dl <= 0) break;
|
||||
case 3:
|
||||
r[3] = a[3];
|
||||
if (--dl <= 0) break;
|
||||
}
|
||||
a += 4;
|
||||
r += 4;
|
||||
}
|
||||
}
|
||||
if (dl > 0)
|
||||
{
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr, " bn_sub_part_words %d + %d (dl > 0, copy)\n", cl, dl);
|
||||
#endif
|
||||
for(;;)
|
||||
{
|
||||
r[0] = a[0];
|
||||
if (--dl <= 0) break;
|
||||
r[1] = a[1];
|
||||
if (--dl <= 0) break;
|
||||
r[2] = a[2];
|
||||
if (--dl <= 0) break;
|
||||
r[3] = a[3];
|
||||
if (--dl <= 0) break;
|
||||
|
||||
a += 4;
|
||||
r += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
return c;
|
||||
}
|
||||
#endif
|
||||
|
||||
BN_ULONG bn_add_part_words(BN_ULONG *r,
|
||||
const BN_ULONG *a, const BN_ULONG *b,
|
||||
int cl, int dl)
|
||||
{
|
||||
BN_ULONG c, l, t;
|
||||
|
||||
assert(cl >= 0);
|
||||
c = bn_add_words(r, a, b, cl);
|
||||
|
||||
if (dl == 0)
|
||||
return c;
|
||||
|
||||
r += cl;
|
||||
a += cl;
|
||||
b += cl;
|
||||
|
||||
if (dl < 0)
|
||||
{
|
||||
int save_dl = dl;
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr, " bn_add_part_words %d + %d (dl < 0, c = %d)\n", cl, dl, c);
|
||||
#endif
|
||||
while (c)
|
||||
{
|
||||
l=(c+b[0])&BN_MASK2;
|
||||
c=(l < c);
|
||||
r[0]=l;
|
||||
if (++dl >= 0) break;
|
||||
|
||||
l=(c+b[1])&BN_MASK2;
|
||||
c=(l < c);
|
||||
r[1]=l;
|
||||
if (++dl >= 0) break;
|
||||
|
||||
l=(c+b[2])&BN_MASK2;
|
||||
c=(l < c);
|
||||
r[2]=l;
|
||||
if (++dl >= 0) break;
|
||||
|
||||
l=(c+b[3])&BN_MASK2;
|
||||
c=(l < c);
|
||||
r[3]=l;
|
||||
if (++dl >= 0) break;
|
||||
|
||||
save_dl = dl;
|
||||
b+=4;
|
||||
r+=4;
|
||||
}
|
||||
if (dl < 0)
|
||||
{
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr, " bn_add_part_words %d + %d (dl < 0, c == 0)\n", cl, dl);
|
||||
#endif
|
||||
if (save_dl < dl)
|
||||
{
|
||||
switch (dl - save_dl)
|
||||
{
|
||||
case 1:
|
||||
r[1] = b[1];
|
||||
if (++dl >= 0) break;
|
||||
case 2:
|
||||
r[2] = b[2];
|
||||
if (++dl >= 0) break;
|
||||
case 3:
|
||||
r[3] = b[3];
|
||||
if (++dl >= 0) break;
|
||||
}
|
||||
b += 4;
|
||||
r += 4;
|
||||
}
|
||||
}
|
||||
if (dl < 0)
|
||||
{
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr, " bn_add_part_words %d + %d (dl < 0, copy)\n", cl, dl);
|
||||
#endif
|
||||
for(;;)
|
||||
{
|
||||
r[0] = b[0];
|
||||
if (++dl >= 0) break;
|
||||
r[1] = b[1];
|
||||
if (++dl >= 0) break;
|
||||
r[2] = b[2];
|
||||
if (++dl >= 0) break;
|
||||
r[3] = b[3];
|
||||
if (++dl >= 0) break;
|
||||
|
||||
b += 4;
|
||||
r += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int save_dl = dl;
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr, " bn_add_part_words %d + %d (dl > 0)\n", cl, dl);
|
||||
#endif
|
||||
while (c)
|
||||
{
|
||||
t=(a[0]+c)&BN_MASK2;
|
||||
c=(t < c);
|
||||
r[0]=t;
|
||||
if (--dl <= 0) break;
|
||||
|
||||
t=(a[1]+c)&BN_MASK2;
|
||||
c=(t < c);
|
||||
r[1]=t;
|
||||
if (--dl <= 0) break;
|
||||
|
||||
t=(a[2]+c)&BN_MASK2;
|
||||
c=(t < c);
|
||||
r[2]=t;
|
||||
if (--dl <= 0) break;
|
||||
|
||||
t=(a[3]+c)&BN_MASK2;
|
||||
c=(t < c);
|
||||
r[3]=t;
|
||||
if (--dl <= 0) break;
|
||||
|
||||
save_dl = dl;
|
||||
a+=4;
|
||||
r+=4;
|
||||
}
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr, " bn_add_part_words %d + %d (dl > 0, c == 0)\n", cl, dl);
|
||||
#endif
|
||||
if (dl > 0)
|
||||
{
|
||||
if (save_dl > dl)
|
||||
{
|
||||
switch (save_dl - dl)
|
||||
{
|
||||
case 1:
|
||||
r[1] = a[1];
|
||||
if (--dl <= 0) break;
|
||||
case 2:
|
||||
r[2] = a[2];
|
||||
if (--dl <= 0) break;
|
||||
case 3:
|
||||
r[3] = a[3];
|
||||
if (--dl <= 0) break;
|
||||
}
|
||||
a += 4;
|
||||
r += 4;
|
||||
}
|
||||
}
|
||||
if (dl > 0)
|
||||
{
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr, " bn_add_part_words %d + %d (dl > 0, copy)\n", cl, dl);
|
||||
#endif
|
||||
for(;;)
|
||||
{
|
||||
r[0] = a[0];
|
||||
if (--dl <= 0) break;
|
||||
r[1] = a[1];
|
||||
if (--dl <= 0) break;
|
||||
r[2] = a[2];
|
||||
if (--dl <= 0) break;
|
||||
r[3] = a[3];
|
||||
if (--dl <= 0) break;
|
||||
|
||||
a += 4;
|
||||
r += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
#ifdef BN_RECURSION
|
||||
/* Karatsuba recursive multiplication algorithm
|
||||
* (cf. Knuth, The Art of Computer Programming, Vol. 2) */
|
||||
@@ -390,15 +75,14 @@ BN_ULONG bn_add_part_words(BN_ULONG *r,
|
||||
* a[1]*b[1]
|
||||
*/
|
||||
void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
|
||||
int dna, int dnb, BN_ULONG *t)
|
||||
BN_ULONG *t)
|
||||
{
|
||||
int n=n2/2,c1,c2;
|
||||
int tna=n+dna, tnb=n+dnb;
|
||||
unsigned int neg,zero;
|
||||
BN_ULONG ln,lo,*p;
|
||||
|
||||
# ifdef BN_COUNT
|
||||
fprintf(stderr," bn_mul_recursive %d * %d\n",n2,n2);
|
||||
printf(" bn_mul_recursive %d * %d\n",n2,n2);
|
||||
# endif
|
||||
# ifdef BN_MUL_COMBA
|
||||
# if 0
|
||||
@@ -408,40 +92,34 @@ void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
/* Only call bn_mul_comba 8 if n2 == 8 and the
|
||||
* two arrays are complete [steve]
|
||||
*/
|
||||
if (n2 == 8 && dna == 0 && dnb == 0)
|
||||
if (n2 == 8)
|
||||
{
|
||||
bn_mul_comba8(r,a,b);
|
||||
return;
|
||||
}
|
||||
# endif /* BN_MUL_COMBA */
|
||||
/* Else do normal multiply */
|
||||
if (n2 < BN_MUL_RECURSIVE_SIZE_NORMAL)
|
||||
{
|
||||
bn_mul_normal(r,a,n2+dna,b,n2+dnb);
|
||||
if ((dna + dnb) < 0)
|
||||
memset(&r[2*n2 + dna + dnb], 0,
|
||||
sizeof(BN_ULONG) * -(dna + dnb));
|
||||
/* This should not happen */
|
||||
bn_mul_normal(r,a,n2,b,n2);
|
||||
return;
|
||||
}
|
||||
/* r=(a[0]-a[1])*(b[1]-b[0]) */
|
||||
c1=bn_cmp_part_words(a,&(a[n]),tna,n-tna);
|
||||
c2=bn_cmp_part_words(&(b[n]),b,tnb,tnb-n);
|
||||
c1=bn_cmp_words(a,&(a[n]),n);
|
||||
c2=bn_cmp_words(&(b[n]),b,n);
|
||||
zero=neg=0;
|
||||
switch (c1*3+c2)
|
||||
{
|
||||
case -4:
|
||||
bn_sub_part_words(t, &(a[n]),a, tna,tna-n); /* - */
|
||||
bn_sub_part_words(&(t[n]),b, &(b[n]),tnb,n-tnb); /* - */
|
||||
bn_sub_words(t, &(a[n]),a, n); /* - */
|
||||
bn_sub_words(&(t[n]),b, &(b[n]),n); /* - */
|
||||
break;
|
||||
case -3:
|
||||
zero=1;
|
||||
break;
|
||||
case -2:
|
||||
bn_sub_part_words(t, &(a[n]),a, tna,tna-n); /* - */
|
||||
bn_sub_part_words(&(t[n]),&(b[n]),b, tnb,tnb-n); /* + */
|
||||
bn_sub_words(t, &(a[n]),a, n); /* - */
|
||||
bn_sub_words(&(t[n]),&(b[n]),b, n); /* + */
|
||||
neg=1;
|
||||
break;
|
||||
case -1:
|
||||
@@ -450,22 +128,21 @@ void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
|
||||
zero=1;
|
||||
break;
|
||||
case 2:
|
||||
bn_sub_part_words(t, a, &(a[n]),tna,n-tna); /* + */
|
||||
bn_sub_part_words(&(t[n]),b, &(b[n]),tnb,n-tnb); /* - */
|
||||
bn_sub_words(t, a, &(a[n]),n); /* + */
|
||||
bn_sub_words(&(t[n]),b, &(b[n]),n); /* - */
|
||||
neg=1;
|
||||
break;
|
||||
case 3:
|
||||
zero=1;
|
||||
break;
|
||||
case 4:
|
||||
bn_sub_part_words(t, a, &(a[n]),tna,n-tna);
|
||||
bn_sub_part_words(&(t[n]),&(b[n]),b, tnb,tnb-n);
|
||||
bn_sub_words(t, a, &(a[n]),n);
|
||||
bn_sub_words(&(t[n]),&(b[n]),b, n);
|
||||
break;
|
||||
}
|
||||
|
||||
# ifdef BN_MUL_COMBA
|
||||
if (n == 4 && dna == 0 && dnb == 0) /* XXX: bn_mul_comba4 could take
|
||||
extra args to do this well */
|
||||
if (n == 4)
|
||||
{
|
||||
if (!zero)
|
||||
bn_mul_comba4(&(t[n2]),t,&(t[n]));
|
||||
@@ -475,9 +152,7 @@ void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
|
||||
bn_mul_comba4(r,a,b);
|
||||
bn_mul_comba4(&(r[n2]),&(a[n]),&(b[n]));
|
||||
}
|
||||
else if (n == 8 && dna == 0 && dnb == 0) /* XXX: bn_mul_comba8 could
|
||||
take extra args to do this
|
||||
well */
|
||||
else if (n == 8)
|
||||
{
|
||||
if (!zero)
|
||||
bn_mul_comba8(&(t[n2]),t,&(t[n]));
|
||||
@@ -492,11 +167,11 @@ void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
|
||||
{
|
||||
p= &(t[n2*2]);
|
||||
if (!zero)
|
||||
bn_mul_recursive(&(t[n2]),t,&(t[n]),n,0,0,p);
|
||||
bn_mul_recursive(&(t[n2]),t,&(t[n]),n,p);
|
||||
else
|
||||
memset(&(t[n2]),0,n2*sizeof(BN_ULONG));
|
||||
bn_mul_recursive(r,a,b,n,0,0,p);
|
||||
bn_mul_recursive(&(r[n2]),&(a[n]),&(b[n]),n,dna,dnb,p);
|
||||
bn_mul_recursive(r,a,b,n,p);
|
||||
bn_mul_recursive(&(r[n2]),&(a[n]),&(b[n]),n,p);
|
||||
}
|
||||
|
||||
/* t[32] holds (a[0]-a[1])*(b[1]-b[0]), c1 is the sign
|
||||
@@ -545,39 +220,39 @@ void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
|
||||
|
||||
/* n+tn is the word length
|
||||
* t needs to be n*4 is size, as does r */
|
||||
void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
|
||||
int tna, int tnb, BN_ULONG *t)
|
||||
void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int tn,
|
||||
int n, BN_ULONG *t)
|
||||
{
|
||||
int i,j,n2=n*2;
|
||||
unsigned int c1,c2,neg,zero;
|
||||
BN_ULONG ln,lo,*p;
|
||||
|
||||
# ifdef BN_COUNT
|
||||
fprintf(stderr," bn_mul_part_recursive (%d+%d) * (%d+%d)\n",
|
||||
tna, n, tnb, n);
|
||||
printf(" bn_mul_part_recursive %d * %d\n",tn+n,tn+n);
|
||||
# endif
|
||||
if (n < 8)
|
||||
{
|
||||
bn_mul_normal(r,a,n+tna,b,n+tnb);
|
||||
i=tn+n;
|
||||
bn_mul_normal(r,a,i,b,i);
|
||||
return;
|
||||
}
|
||||
|
||||
/* r=(a[0]-a[1])*(b[1]-b[0]) */
|
||||
c1=bn_cmp_part_words(a,&(a[n]),tna,n-tna);
|
||||
c2=bn_cmp_part_words(&(b[n]),b,tnb,tnb-n);
|
||||
c1=bn_cmp_words(a,&(a[n]),n);
|
||||
c2=bn_cmp_words(&(b[n]),b,n);
|
||||
zero=neg=0;
|
||||
switch (c1*3+c2)
|
||||
{
|
||||
case -4:
|
||||
bn_sub_part_words(t, &(a[n]),a, tna,tna-n); /* - */
|
||||
bn_sub_part_words(&(t[n]),b, &(b[n]),tnb,n-tnb); /* - */
|
||||
bn_sub_words(t, &(a[n]),a, n); /* - */
|
||||
bn_sub_words(&(t[n]),b, &(b[n]),n); /* - */
|
||||
break;
|
||||
case -3:
|
||||
zero=1;
|
||||
/* break; */
|
||||
case -2:
|
||||
bn_sub_part_words(t, &(a[n]),a, tna,tna-n); /* - */
|
||||
bn_sub_part_words(&(t[n]),&(b[n]),b, tnb,tnb-n); /* + */
|
||||
bn_sub_words(t, &(a[n]),a, n); /* - */
|
||||
bn_sub_words(&(t[n]),&(b[n]),b, n); /* + */
|
||||
neg=1;
|
||||
break;
|
||||
case -1:
|
||||
@@ -586,16 +261,16 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
|
||||
zero=1;
|
||||
/* break; */
|
||||
case 2:
|
||||
bn_sub_part_words(t, a, &(a[n]),tna,n-tna); /* + */
|
||||
bn_sub_part_words(&(t[n]),b, &(b[n]),tnb,n-tnb); /* - */
|
||||
bn_sub_words(t, a, &(a[n]),n); /* + */
|
||||
bn_sub_words(&(t[n]),b, &(b[n]),n); /* - */
|
||||
neg=1;
|
||||
break;
|
||||
case 3:
|
||||
zero=1;
|
||||
/* break; */
|
||||
case 4:
|
||||
bn_sub_part_words(t, a, &(a[n]),tna,n-tna);
|
||||
bn_sub_part_words(&(t[n]),&(b[n]),b, tnb,tnb-n);
|
||||
bn_sub_words(t, a, &(a[n]),n);
|
||||
bn_sub_words(&(t[n]),&(b[n]),b, n);
|
||||
break;
|
||||
}
|
||||
/* The zero case isn't yet implemented here. The speedup
|
||||
@@ -614,59 +289,54 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
|
||||
{
|
||||
bn_mul_comba8(&(t[n2]),t,&(t[n]));
|
||||
bn_mul_comba8(r,a,b);
|
||||
bn_mul_normal(&(r[n2]),&(a[n]),tna,&(b[n]),tnb);
|
||||
memset(&(r[n2+tna+tnb]),0,sizeof(BN_ULONG)*(n2-tna-tnb));
|
||||
bn_mul_normal(&(r[n2]),&(a[n]),tn,&(b[n]),tn);
|
||||
memset(&(r[n2+tn*2]),0,sizeof(BN_ULONG)*(n2-tn*2));
|
||||
}
|
||||
else
|
||||
{
|
||||
p= &(t[n2*2]);
|
||||
bn_mul_recursive(&(t[n2]),t,&(t[n]),n,0,0,p);
|
||||
bn_mul_recursive(r,a,b,n,0,0,p);
|
||||
bn_mul_recursive(&(t[n2]),t,&(t[n]),n,p);
|
||||
bn_mul_recursive(r,a,b,n,p);
|
||||
i=n/2;
|
||||
/* If there is only a bottom half to the number,
|
||||
* just do it */
|
||||
if (tna > tnb)
|
||||
j = tna - i;
|
||||
else
|
||||
j = tnb - i;
|
||||
j=tn-i;
|
||||
if (j == 0)
|
||||
{
|
||||
bn_mul_recursive(&(r[n2]),&(a[n]),&(b[n]),
|
||||
i,tna-i,tnb-i,p);
|
||||
bn_mul_recursive(&(r[n2]),&(a[n]),&(b[n]),i,p);
|
||||
memset(&(r[n2+i*2]),0,sizeof(BN_ULONG)*(n2-i*2));
|
||||
}
|
||||
else if (j > 0) /* eg, n == 16, i == 8 and tn == 11 */
|
||||
{
|
||||
bn_mul_part_recursive(&(r[n2]),&(a[n]),&(b[n]),
|
||||
i,tna-i,tnb-i,p);
|
||||
memset(&(r[n2+tna+tnb]),0,
|
||||
sizeof(BN_ULONG)*(n2-tna-tnb));
|
||||
j,i,p);
|
||||
memset(&(r[n2+tn*2]),0,
|
||||
sizeof(BN_ULONG)*(n2-tn*2));
|
||||
}
|
||||
else /* (j < 0) eg, n == 16, i == 8 and tn == 5 */
|
||||
{
|
||||
memset(&(r[n2]),0,sizeof(BN_ULONG)*n2);
|
||||
if (tna < BN_MUL_RECURSIVE_SIZE_NORMAL
|
||||
&& tnb < BN_MUL_RECURSIVE_SIZE_NORMAL)
|
||||
if (tn < BN_MUL_RECURSIVE_SIZE_NORMAL)
|
||||
{
|
||||
bn_mul_normal(&(r[n2]),&(a[n]),tna,&(b[n]),tnb);
|
||||
bn_mul_normal(&(r[n2]),&(a[n]),tn,&(b[n]),tn);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
i/=2;
|
||||
if (i < tna && i < tnb)
|
||||
if (i < tn)
|
||||
{
|
||||
bn_mul_part_recursive(&(r[n2]),
|
||||
&(a[n]),&(b[n]),
|
||||
i,tna-i,tnb-i,p);
|
||||
tn-i,i,p);
|
||||
break;
|
||||
}
|
||||
else if (i <= tna && i <= tnb)
|
||||
else if (i == tn)
|
||||
{
|
||||
bn_mul_recursive(&(r[n2]),
|
||||
&(a[n]),&(b[n]),
|
||||
i,tna-i,tnb-i,p);
|
||||
i,p);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -727,10 +397,10 @@ void bn_mul_low_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
|
||||
int n=n2/2;
|
||||
|
||||
# ifdef BN_COUNT
|
||||
fprintf(stderr," bn_mul_low_recursive %d * %d\n",n2,n2);
|
||||
printf(" bn_mul_low_recursive %d * %d\n",n2,n2);
|
||||
# endif
|
||||
|
||||
bn_mul_recursive(r,a,b,n,0,0,&(t[0]));
|
||||
bn_mul_recursive(r,a,b,n,&(t[0]));
|
||||
if (n >= BN_MUL_LOW_RECURSIVE_SIZE_NORMAL)
|
||||
{
|
||||
bn_mul_low_recursive(&(t[0]),&(a[0]),&(b[n]),n,&(t[n2]));
|
||||
@@ -761,7 +431,7 @@ void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2,
|
||||
BN_ULONG ll,lc,*lp,*mp;
|
||||
|
||||
# ifdef BN_COUNT
|
||||
fprintf(stderr," bn_mul_high %d * %d\n",n2,n2);
|
||||
printf(" bn_mul_high %d * %d\n",n2,n2);
|
||||
# endif
|
||||
n=n2/2;
|
||||
|
||||
@@ -814,8 +484,8 @@ void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2,
|
||||
else
|
||||
# endif
|
||||
{
|
||||
bn_mul_recursive(&(t[0]),&(r[0]),&(r[n]),n,0,0,&(t[n2]));
|
||||
bn_mul_recursive(r,&(a[n]),&(b[n]),n,0,0,&(t[n2]));
|
||||
bn_mul_recursive(&(t[0]),&(r[0]),&(r[n]),n,&(t[n2]));
|
||||
bn_mul_recursive(r,&(a[n]),&(b[n]),n,&(t[n2]));
|
||||
}
|
||||
|
||||
/* s0 == low(al*bl)
|
||||
@@ -940,19 +610,19 @@ void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2,
|
||||
|
||||
int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
|
||||
{
|
||||
int ret=0;
|
||||
int top,al,bl;
|
||||
BIGNUM *rr;
|
||||
int ret = 0;
|
||||
#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
|
||||
int i;
|
||||
#endif
|
||||
#ifdef BN_RECURSION
|
||||
BIGNUM *t=NULL;
|
||||
int j=0,k;
|
||||
BIGNUM *t;
|
||||
int j,k;
|
||||
#endif
|
||||
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr,"BN_mul %d * %d\n",a->top,b->top);
|
||||
printf("BN_mul %d * %d\n",a->top,b->top);
|
||||
#endif
|
||||
|
||||
bn_check_top(a);
|
||||
@@ -1005,55 +675,21 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
|
||||
#ifdef BN_RECURSION
|
||||
if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL))
|
||||
{
|
||||
if (i >= -1 && i <= 1)
|
||||
if (i == 1 && !BN_get_flags(b,BN_FLG_STATIC_DATA) && bl<b->dmax)
|
||||
{
|
||||
int sav_j =0;
|
||||
/* Find out the power of two lower or equal
|
||||
to the longest of the two numbers */
|
||||
if (i >= 0)
|
||||
{
|
||||
j = BN_num_bits_word((BN_ULONG)al);
|
||||
}
|
||||
if (i == -1)
|
||||
{
|
||||
j = BN_num_bits_word((BN_ULONG)bl);
|
||||
}
|
||||
sav_j = j;
|
||||
j = 1<<(j-1);
|
||||
assert(j <= al || j <= bl);
|
||||
k = j+j;
|
||||
t = BN_CTX_get(ctx);
|
||||
if (al > j || bl > j)
|
||||
{
|
||||
bn_wexpand(t,k*4);
|
||||
bn_wexpand(rr,k*4);
|
||||
bn_mul_part_recursive(rr->d,a->d,b->d,
|
||||
j,al-j,bl-j,t->d);
|
||||
}
|
||||
else /* al <= j || bl <= j */
|
||||
{
|
||||
bn_wexpand(t,k*2);
|
||||
bn_wexpand(rr,k*2);
|
||||
bn_mul_recursive(rr->d,a->d,b->d,
|
||||
j,al-j,bl-j,t->d);
|
||||
}
|
||||
rr->top=top;
|
||||
goto end;
|
||||
}
|
||||
#if 0
|
||||
if (i == 1 && !BN_get_flags(b,BN_FLG_STATIC_DATA))
|
||||
{
|
||||
BIGNUM *tmp_bn = (BIGNUM *)b;
|
||||
if (bn_wexpand(tmp_bn,al) == NULL) goto err;
|
||||
tmp_bn->d[bl]=0;
|
||||
#if 0 /* tribute to const-ification, bl<b->dmax above covers for this */
|
||||
if (bn_wexpand(b,al) == NULL) goto err;
|
||||
#endif
|
||||
b->d[bl]=0;
|
||||
bl++;
|
||||
i--;
|
||||
}
|
||||
else if (i == -1 && !BN_get_flags(a,BN_FLG_STATIC_DATA))
|
||||
else if (i == -1 && !BN_get_flags(a,BN_FLG_STATIC_DATA) && al<a->dmax)
|
||||
{
|
||||
BIGNUM *tmp_bn = (BIGNUM *)a;
|
||||
if (bn_wexpand(tmp_bn,bl) == NULL) goto err;
|
||||
tmp_bn->d[al]=0;
|
||||
#if 0 /* tribute to const-ification, al<a->dmax above covers for this */
|
||||
if (bn_wexpand(a,bl) == NULL) goto err;
|
||||
#endif
|
||||
a->d[al]=0;
|
||||
al++;
|
||||
i++;
|
||||
}
|
||||
@@ -1070,17 +706,26 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
|
||||
if (bn_wexpand(t,k*2) == NULL) goto err;
|
||||
if (bn_wexpand(rr,k*2) == NULL) goto err;
|
||||
bn_mul_recursive(rr->d,a->d,b->d,al,t->d);
|
||||
rr->top=top;
|
||||
goto end;
|
||||
}
|
||||
#if 0 /* tribute to const-ification, rsa/dsa performance is not affected */
|
||||
else
|
||||
{
|
||||
if (bn_wexpand(t,k*4) == NULL) goto err;
|
||||
if (bn_wexpand(rr,k*4) == NULL) goto err;
|
||||
if (bn_wexpand(a,k) == NULL ) goto err;
|
||||
if (bn_wexpand(b,k) == NULL ) goto err;
|
||||
if (bn_wexpand(t,k*4) == NULL ) goto err;
|
||||
if (bn_wexpand(rr,k*4) == NULL ) goto err;
|
||||
for (i=a->top; i<k; i++)
|
||||
a->d[i]=0;
|
||||
for (i=b->top; i<k; i++)
|
||||
b->d[i]=0;
|
||||
bn_mul_part_recursive(rr->d,a->d,b->d,al-j,j,t->d);
|
||||
}
|
||||
rr->top=top;
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif /* BN_RECURSION */
|
||||
if (bn_wexpand(rr,top) == NULL) goto err;
|
||||
@@ -1103,7 +748,7 @@ void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb)
|
||||
BN_ULONG *rr;
|
||||
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr," bn_mul_normal %d * %d\n",na,nb);
|
||||
printf(" bn_mul_normal %d * %d\n",na,nb);
|
||||
#endif
|
||||
|
||||
if (na < nb)
|
||||
@@ -1116,13 +761,7 @@ void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb)
|
||||
|
||||
}
|
||||
rr= &(r[na]);
|
||||
if (nb <= 0)
|
||||
{
|
||||
(void)bn_mul_words(r,a,na,0);
|
||||
return;
|
||||
}
|
||||
else
|
||||
rr[0]=bn_mul_words(r,a,na,b[0]);
|
||||
rr[0]=bn_mul_words(r,a,na,b[0]);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -1143,7 +782,7 @@ void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb)
|
||||
void bn_mul_low_normal(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
|
||||
{
|
||||
#ifdef BN_COUNT
|
||||
fprintf(stderr," bn_mul_low_normal %d * %d\n",n,n);
|
||||
printf(" bn_mul_low_normal %d * %d\n",n,n);
|
||||
#endif
|
||||
bn_mul_words(r,a,n,b[0]);
|
||||
|
||||
|
||||
@@ -104,7 +104,8 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
|
||||
"dynlock",
|
||||
"engine",
|
||||
"ui",
|
||||
#if CRYPTO_NUM_LOCKS != 32
|
||||
"hwcrhk", /* This is a HACK which will disappear in 0.9.8 */
|
||||
#if CRYPTO_NUM_LOCKS != 33
|
||||
# error "Inconsistency between crypto.h and cryptlib.c"
|
||||
#endif
|
||||
};
|
||||
@@ -207,10 +208,18 @@ int CRYPTO_get_new_dynlockid(void)
|
||||
i=sk_CRYPTO_dynlock_find(dyn_locks,NULL);
|
||||
/* If there was none, push, thereby creating a new one */
|
||||
if (i == -1)
|
||||
i=sk_CRYPTO_dynlock_push(dyn_locks,pointer);
|
||||
/* Since sk_push() returns the number of items on the
|
||||
stack, not the location of the pushed item, we need
|
||||
to transform the returned number into a position,
|
||||
by decreasing it. */
|
||||
i=sk_CRYPTO_dynlock_push(dyn_locks,pointer) - 1;
|
||||
else
|
||||
/* If we found a place with a NULL pointer, put our pointer
|
||||
in it. */
|
||||
sk_CRYPTO_dynlock_set(dyn_locks,i,pointer);
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
|
||||
|
||||
if (!i)
|
||||
if (i == -1)
|
||||
{
|
||||
dynlock_destroy_callback(pointer->data,__FILE__,__LINE__);
|
||||
OPENSSL_free(pointer);
|
||||
@@ -402,15 +411,17 @@ void CRYPTO_lock(int mode, int type, const char *file, int line)
|
||||
#endif
|
||||
if (type < 0)
|
||||
{
|
||||
struct CRYPTO_dynlock_value *pointer
|
||||
= CRYPTO_get_dynlock_value(type);
|
||||
|
||||
if (pointer && dynlock_lock_callback)
|
||||
if (dynlock_lock_callback != NULL)
|
||||
{
|
||||
dynlock_lock_callback(mode, pointer, file, line);
|
||||
}
|
||||
struct CRYPTO_dynlock_value *pointer
|
||||
= CRYPTO_get_dynlock_value(type);
|
||||
|
||||
CRYPTO_destroy_dynlockid(type);
|
||||
OPENSSL_assert(pointer != NULL);
|
||||
|
||||
dynlock_lock_callback(mode, pointer, file, line);
|
||||
|
||||
CRYPTO_destroy_dynlockid(type);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (locking_callback != NULL)
|
||||
|
||||
@@ -127,7 +127,8 @@ extern "C" {
|
||||
#define CRYPTO_LOCK_DYNLOCK 29
|
||||
#define CRYPTO_LOCK_ENGINE 30
|
||||
#define CRYPTO_LOCK_UI 31
|
||||
#define CRYPTO_NUM_LOCKS 32
|
||||
#define CRYPTO_LOCK_HWCRHK 32 /* This is a HACK which will disappear in 0.9.8 */
|
||||
#define CRYPTO_NUM_LOCKS 33
|
||||
|
||||
#define CRYPTO_LOCK 1
|
||||
#define CRYPTO_UNLOCK 2
|
||||
|
||||
@@ -67,19 +67,27 @@ des: des.o cbc3_enc.o lib
|
||||
|
||||
# elf
|
||||
asm/dx86-elf.o: asm/dx86unix.cpp
|
||||
$(CPP) -DELF -x c asm/dx86unix.cpp | as -o asm/dx86-elf.o
|
||||
$(CPP) -DELF \
|
||||
`(echo $(CFLAGS) | egrep -ie '-[fK]PIC') > /dev/null 2>&1 && echo -DPIC`\
|
||||
-x c asm/dx86unix.cpp | as -o asm/dx86-elf.o
|
||||
|
||||
asm/yx86-elf.o: asm/yx86unix.cpp
|
||||
$(CPP) -DELF -x c asm/yx86unix.cpp | as -o asm/yx86-elf.o
|
||||
$(CPP) -DELF \
|
||||
`(echo $(CFLAGS) | egrep -ie '-[fK]PIC') > /dev/null 2>&1 && echo -DPIC`\
|
||||
-x c asm/yx86unix.cpp | as -o asm/yx86-elf.o
|
||||
|
||||
# solaris
|
||||
asm/dx86-sol.o: asm/dx86unix.cpp
|
||||
$(CC) -E -DSOL asm/dx86unix.cpp | sed 's/^#.*//' > asm/dx86-sol.s
|
||||
$(CC) -E -DSOL \
|
||||
`(echo $(CFLAGS) | egrep -ie '-[fK]PIC') > /dev/null 2>&1 && echo -DPIC`\
|
||||
asm/dx86unix.cpp | sed 's/^#.*//' > asm/dx86-sol.s
|
||||
as -o asm/dx86-sol.o asm/dx86-sol.s
|
||||
rm -f asm/dx86-sol.s
|
||||
|
||||
asm/yx86-sol.o: asm/yx86unix.cpp
|
||||
$(CC) -E -DSOL asm/yx86unix.cpp | sed 's/^#.*//' > asm/yx86-sol.s
|
||||
$(CC) -E -DSOL \
|
||||
`(echo $(CFLAGS) | egrep -ie '-[fK]PIC') > /dev/null 2>&1 && echo -DPIC`\
|
||||
asm/yx86unix.cpp | sed 's/^#.*//' > asm/yx86-sol.s
|
||||
as -o asm/yx86-sol.o asm/yx86-sol.s
|
||||
rm -f asm/yx86-sol.s
|
||||
|
||||
|
||||
@@ -26,11 +26,17 @@ sub fcrypt_body
|
||||
|
||||
&comment("");
|
||||
&comment("Load the 2 words");
|
||||
$ks="ebp";
|
||||
$trans="ebp";
|
||||
|
||||
&xor( $L, $L);
|
||||
&xor( $R, $R);
|
||||
&mov($ks,&wparam(1));
|
||||
|
||||
# PIC-ification:-)
|
||||
if ($cpp) { &picmeup("edx","DES_SPtrans"); }
|
||||
else { &lea("edx",&DWP("DES_SPtrans")); }
|
||||
&push("edx"); # becomes &swtmp(1)
|
||||
#
|
||||
&mov($trans,&wparam(1)); # reloaded with DES_SPtrans in D_ENCRYPT
|
||||
|
||||
&push(&DWC(25)); # add a variable
|
||||
|
||||
@@ -39,11 +45,11 @@ sub fcrypt_body
|
||||
{
|
||||
&comment("");
|
||||
&comment("Round $i");
|
||||
&D_ENCRYPT($i,$L,$R,$i*2,$ks,"DES_SPtrans","eax","ebx","ecx","edx");
|
||||
&D_ENCRYPT($i,$L,$R,$i*2,$trans,"eax","ebx","ecx","edx");
|
||||
|
||||
&comment("");
|
||||
&comment("Round ".sprintf("%d",$i+1));
|
||||
&D_ENCRYPT($i+1,$R,$L,($i+1)*2,$ks,"DES_SPtrans","eax","ebx","ecx","edx");
|
||||
&D_ENCRYPT($i+1,$R,$L,($i+1)*2,$trans,"eax","ebx","ecx","edx");
|
||||
}
|
||||
&mov("ebx", &swtmp(0));
|
||||
&mov("eax", $L);
|
||||
@@ -61,14 +67,14 @@ sub fcrypt_body
|
||||
&mov(&DWP(0,"edx","",0),"eax");
|
||||
&mov(&DWP(4,"edx","",0),$L);
|
||||
|
||||
&pop("ecx"); # remove variable
|
||||
&add("esp",8); # remove variables
|
||||
|
||||
&function_end($name);
|
||||
}
|
||||
|
||||
sub D_ENCRYPT
|
||||
{
|
||||
local($r,$L,$R,$S,$ks,$desSP,$u,$tmp1,$tmp2,$t)=@_;
|
||||
local($r,$L,$R,$S,$trans,$u,$tmp1,$tmp2,$t)=@_;
|
||||
|
||||
&mov( $u, &wparam(2)); # 2
|
||||
&mov( $t, $R);
|
||||
@@ -85,9 +91,9 @@ sub D_ENCRYPT
|
||||
&shl( $tmp2, 16); # 1
|
||||
&xor( $u, $tmp1); # 2
|
||||
&xor( $t, $tmp2); # 2
|
||||
&mov( $tmp1, &DWP(&n2a($S*4),$ks,"",0)); # 2
|
||||
&mov( $tmp1, &DWP(&n2a($S*4),$trans,"",0)); # 2
|
||||
&xor( $u, $tmp1);
|
||||
&mov( $tmp2, &DWP(&n2a(($S+1)*4),$ks,"",0)); # 2
|
||||
&mov( $tmp2, &DWP(&n2a(($S+1)*4),$trans,"",0)); # 2
|
||||
&xor( $u, $R);
|
||||
&xor( $t, $R);
|
||||
&xor( $t, $tmp2);
|
||||
@@ -99,31 +105,28 @@ sub D_ENCRYPT
|
||||
&movb( &LB($tmp1), &LB($u) );
|
||||
&movb( &LB($tmp2), &HB($u) );
|
||||
&rotr( $t, 4 );
|
||||
&mov( $ks, &DWP(" $desSP",$tmp1,"",0));
|
||||
&mov( $trans, &swtmp(1));
|
||||
&xor( $L, &DWP(" ",$trans,$tmp1,0));
|
||||
&movb( &LB($tmp1), &LB($t) );
|
||||
&xor( $L, $ks);
|
||||
&mov( $ks, &DWP("0x200+$desSP",$tmp2,"",0));
|
||||
&xor( $L, $ks);
|
||||
&xor( $L, &DWP("0x200",$trans,$tmp2,0));
|
||||
&movb( &LB($tmp2), &HB($t) );
|
||||
&shr( $u, 16);
|
||||
&mov( $ks, &DWP("0x100+$desSP",$tmp1,"",0));
|
||||
&xor( $L, $ks);
|
||||
&xor( $L, &DWP("0x100",$trans,$tmp1,0));
|
||||
&movb( &LB($tmp1), &HB($u) );
|
||||
&shr( $t, 16);
|
||||
&mov( $ks, &DWP("0x300+$desSP",$tmp2,"",0));
|
||||
&xor( $L, $ks);
|
||||
&mov( $ks, &wparam(1));
|
||||
&xor( $L, &DWP("0x300",$trans,$tmp2,0));
|
||||
&movb( &LB($tmp2), &HB($t) );
|
||||
&and( $u, "0xff" );
|
||||
&and( $t, "0xff" );
|
||||
&mov( $tmp1, &DWP("0x600+$desSP",$tmp1,"",0));
|
||||
&mov( $tmp1, &DWP("0x600",$trans,$tmp1,0));
|
||||
&xor( $L, $tmp1);
|
||||
&mov( $tmp1, &DWP("0x700+$desSP",$tmp2,"",0));
|
||||
&mov( $tmp1, &DWP("0x700",$trans,$tmp2,0));
|
||||
&xor( $L, $tmp1);
|
||||
&mov( $tmp1, &DWP("0x400+$desSP",$u,"",0));
|
||||
&mov( $tmp1, &DWP("0x400",$trans,$u,0));
|
||||
&xor( $L, $tmp1);
|
||||
&mov( $tmp1, &DWP("0x500+$desSP",$t,"",0));
|
||||
&mov( $tmp1, &DWP("0x500",$trans,$t,0));
|
||||
&xor( $L, $tmp1);
|
||||
&mov( $trans, &wparam(1));
|
||||
}
|
||||
|
||||
sub n2a
|
||||
|
||||
@@ -40,7 +40,7 @@ sub DES_encrypt
|
||||
|
||||
&comment("");
|
||||
&comment("Load the 2 words");
|
||||
$ks="ebp";
|
||||
$trans="ebp";
|
||||
|
||||
if ($do_ip)
|
||||
{
|
||||
@@ -72,7 +72,11 @@ sub DES_encrypt
|
||||
&rotl($L,3);
|
||||
}
|
||||
|
||||
&mov( $ks, &wparam(1) );
|
||||
# PIC-ification:-)
|
||||
if ($cpp) { &picmeup($trans,"DES_SPtrans"); }
|
||||
else { &lea($trans,&DWP("DES_SPtrans")); }
|
||||
|
||||
&mov( "ecx", &wparam(1) );
|
||||
&cmp("ebx","0");
|
||||
&je(&label("start_decrypt"));
|
||||
|
||||
@@ -80,11 +84,11 @@ sub DES_encrypt
|
||||
{
|
||||
&comment("");
|
||||
&comment("Round $i");
|
||||
&D_ENCRYPT($i,$L,$R,$i*2,$ks,"DES_SPtrans","eax","ebx","ecx","edx");
|
||||
&D_ENCRYPT($i,$L,$R,$i*2,$trans,"eax","ebx","ecx","edx");
|
||||
|
||||
&comment("");
|
||||
&comment("Round ".sprintf("%d",$i+1));
|
||||
&D_ENCRYPT($i+1,$R,$L,($i+1)*2,$ks,"DES_SPtrans","eax","ebx","ecx","edx");
|
||||
&D_ENCRYPT($i+1,$R,$L,($i+1)*2,$trans,"eax","ebx","ecx","edx");
|
||||
}
|
||||
&jmp(&label("end"));
|
||||
|
||||
@@ -94,10 +98,10 @@ sub DES_encrypt
|
||||
{
|
||||
&comment("");
|
||||
&comment("Round $i");
|
||||
&D_ENCRYPT(15-$i,$L,$R,$i*2,$ks,"DES_SPtrans","eax","ebx","ecx","edx");
|
||||
&D_ENCRYPT(15-$i,$L,$R,$i*2,$trans,"eax","ebx","ecx","edx");
|
||||
&comment("");
|
||||
&comment("Round ".sprintf("%d",$i-1));
|
||||
&D_ENCRYPT(15-$i+1,$R,$L,($i-1)*2,$ks,"DES_SPtrans","eax","ebx","ecx","edx");
|
||||
&D_ENCRYPT(15-$i+1,$R,$L,($i-1)*2,$trans,"eax","ebx","ecx","edx");
|
||||
}
|
||||
|
||||
&set_label("end");
|
||||
@@ -134,43 +138,36 @@ sub DES_encrypt
|
||||
|
||||
sub D_ENCRYPT
|
||||
{
|
||||
local($r,$L,$R,$S,$ks,$desSP,$u,$tmp1,$tmp2,$t)=@_;
|
||||
local($r,$L,$R,$S,$trans,$u,$tmp1,$tmp2,$t)=@_;
|
||||
|
||||
&mov( $u, &DWP(&n2a($S*4),$ks,"",0));
|
||||
&mov( $u, &DWP(&n2a($S*4),$tmp2,"",0));
|
||||
&xor( $tmp1, $tmp1);
|
||||
&mov( $t, &DWP(&n2a(($S+1)*4),$ks,"",0));
|
||||
&mov( $t, &DWP(&n2a(($S+1)*4),$tmp2,"",0));
|
||||
&xor( $u, $R);
|
||||
&xor( $tmp2, $tmp2);
|
||||
&xor( $t, $R);
|
||||
&and( $u, "0xfcfcfcfc" );
|
||||
&and( $t, "0xcfcfcfcf" );
|
||||
&movb( &LB($tmp1), &LB($u) );
|
||||
&movb( &LB($tmp2), &HB($u) );
|
||||
&rotr( $t, 4 );
|
||||
&mov( $ks, &DWP(" $desSP",$tmp1,"",0));
|
||||
&xor( $L, &DWP(" ",$trans,$tmp1,0));
|
||||
&movb( &LB($tmp1), &LB($t) );
|
||||
&xor( $L, $ks);
|
||||
&mov( $ks, &DWP("0x200+$desSP",$tmp2,"",0));
|
||||
&xor( $L, $ks); ######
|
||||
&xor( $L, &DWP("0x200",$trans,$tmp2,0));
|
||||
&movb( &LB($tmp2), &HB($t) );
|
||||
&shr( $u, 16);
|
||||
&mov( $ks, &DWP("0x100+$desSP",$tmp1,"",0));
|
||||
&xor( $L, $ks); ######
|
||||
&xor( $L, &DWP("0x100",$trans,$tmp1,0));
|
||||
&movb( &LB($tmp1), &HB($u) );
|
||||
&shr( $t, 16);
|
||||
&mov( $ks, &DWP("0x300+$desSP",$tmp2,"",0));
|
||||
&xor( $L, $ks);
|
||||
&mov( $ks, &wparam(1) );
|
||||
&xor( $L, &DWP("0x300",$trans,$tmp2,0));
|
||||
&movb( &LB($tmp2), &HB($t) );
|
||||
&and( $u, "0xff" );
|
||||
&and( $t, "0xff" );
|
||||
&mov( $tmp1, &DWP("0x600+$desSP",$tmp1,"",0));
|
||||
&xor( $L, $tmp1);
|
||||
&mov( $tmp1, &DWP("0x700+$desSP",$tmp2,"",0));
|
||||
&xor( $L, $tmp1);
|
||||
&mov( $tmp1, &DWP("0x400+$desSP",$u,"",0));
|
||||
&xor( $L, $tmp1);
|
||||
&mov( $tmp1, &DWP("0x500+$desSP",$t,"",0));
|
||||
&xor( $L, $tmp1);
|
||||
&xor( $L, &DWP("0x600",$trans,$tmp1,0));
|
||||
&xor( $L, &DWP("0x700",$trans,$tmp2,0));
|
||||
&mov( $tmp2, &wparam(1) );
|
||||
&xor( $L, &DWP("0x400",$trans,$u,0));
|
||||
&xor( $L, &DWP("0x500",$trans,$t,0));
|
||||
}
|
||||
|
||||
sub n2a
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifndef HEADER_DES_H
|
||||
#define HEADER_DES_H
|
||||
#ifndef HEADER_NEW_DES_H
|
||||
#define HEADER_NEW_DES_H
|
||||
|
||||
#ifdef OPENSSL_NO_DES
|
||||
#error DES is disabled.
|
||||
|
||||
@@ -162,7 +162,18 @@
|
||||
|
||||
#if defined(OPENSSL_SYS_WIN32) && defined(_MSC_VER)
|
||||
#define ROTATE(a,n) (_lrotr(a,n))
|
||||
#else
|
||||
#elif defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(NO_ASM) && !defined(NO_INLINE_ASM)
|
||||
# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
|
||||
# define ROTATE(a,n) ({ register unsigned int ret; \
|
||||
asm ("rorl %1,%0" \
|
||||
: "=r"(ret) \
|
||||
: "I"(n),"0"(a) \
|
||||
: "cc"); \
|
||||
ret; \
|
||||
})
|
||||
# endif
|
||||
#endif
|
||||
#ifndef ROTATE
|
||||
#define ROTATE(a,n) (((a)>>(n))+((a)<<(32-(n))))
|
||||
#endif
|
||||
|
||||
|
||||
@@ -88,14 +88,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_DES_OLD_H
|
||||
#define HEADER_DES_OLD_H
|
||||
#ifndef HEADER_DES_H
|
||||
#define HEADER_DES_H
|
||||
|
||||
#ifdef OPENSSL_NO_DES
|
||||
#error DES is disabled.
|
||||
#endif
|
||||
|
||||
#ifndef HEADER_DES_H
|
||||
#ifndef HEADER_NEW_DES_H
|
||||
#error You must include des.h, not des_old.h directly.
|
||||
#endif
|
||||
|
||||
|
||||
@@ -222,6 +222,7 @@ end:
|
||||
static int cb_exit(int ec)
|
||||
{
|
||||
EXIT(ec);
|
||||
return(0); /* To keep some compilers quiet */
|
||||
}
|
||||
|
||||
static void MS_CALLBACK dsa_cb(int p, int n, void *arg)
|
||||
|
||||
@@ -91,11 +91,19 @@ static int hwcrhk_init(ENGINE *e);
|
||||
static int hwcrhk_finish(ENGINE *e);
|
||||
static int hwcrhk_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)());
|
||||
|
||||
/* Functions to handle mutexes */
|
||||
/* Functions to handle mutexes if have dynamic locks */
|
||||
static int hwcrhk_mutex_init(HWCryptoHook_Mutex*, HWCryptoHook_CallerContext*);
|
||||
static int hwcrhk_mutex_lock(HWCryptoHook_Mutex*);
|
||||
static void hwcrhk_mutex_unlock(HWCryptoHook_Mutex*);
|
||||
static void hwcrhk_mutex_destroy(HWCryptoHook_Mutex*);
|
||||
#if 1 /* This is a HACK which will disappear in 0.9.8 */
|
||||
/* Functions to handle mutexes if only have static locks */
|
||||
static int hwcrhk_static_mutex_init(HWCryptoHook_Mutex *m,
|
||||
HWCryptoHook_CallerContext *c);
|
||||
static int hwcrhk_static_mutex_lock(HWCryptoHook_Mutex *m);
|
||||
static void hwcrhk_static_mutex_unlock(HWCryptoHook_Mutex *m);
|
||||
static void hwcrhk_static_mutex_destroy(HWCryptoHook_Mutex *m);
|
||||
#endif
|
||||
|
||||
/* BIGNUM stuff */
|
||||
static int hwcrhk_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
@@ -573,9 +581,17 @@ static int hwcrhk_init(ENGINE *e)
|
||||
}
|
||||
else if (CRYPTO_get_locking_callback() != NULL)
|
||||
{
|
||||
HWCRHKerr(HWCRHK_F_HWCRHK_INIT,HWCRHK_R_LOCKING_MISSING);
|
||||
HWCRHKerr(HWCRHK_F_HWCRHK_INIT,HWCRHK_R_DYNAMIC_LOCKING_MISSING);
|
||||
ERR_add_error_data(1,"You HAVE to add dynamic locking callbacks via CRYPTO_set_dynlock_{create,lock,destroy}_callback()");
|
||||
#if 1 /* This is a HACK which will disappear in 0.9.8 */
|
||||
hwcrhk_globals.maxmutexes = 1; /* Only have one lock */
|
||||
hwcrhk_globals.mutex_init = hwcrhk_static_mutex_init;
|
||||
hwcrhk_globals.mutex_acquire = hwcrhk_static_mutex_lock;
|
||||
hwcrhk_globals.mutex_release = hwcrhk_static_mutex_unlock;
|
||||
hwcrhk_globals.mutex_destroy = hwcrhk_static_mutex_destroy;
|
||||
#else
|
||||
goto err;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1181,6 +1197,26 @@ static void hwcrhk_mutex_destroy(HWCryptoHook_Mutex *mt)
|
||||
CRYPTO_destroy_dynlockid(mt->lockid);
|
||||
}
|
||||
|
||||
/* Mutex upcalls to use if the application does not support dynamic locks */
|
||||
|
||||
static int hwcrhk_static_mutex_init(HWCryptoHook_Mutex *m,
|
||||
HWCryptoHook_CallerContext *c)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static int hwcrhk_static_mutex_lock(HWCryptoHook_Mutex *m)
|
||||
{
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_HWCRHK);
|
||||
return 0;
|
||||
}
|
||||
static void hwcrhk_static_mutex_unlock(HWCryptoHook_Mutex *m)
|
||||
{
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_HWCRHK);
|
||||
}
|
||||
static void hwcrhk_static_mutex_destroy(HWCryptoHook_Mutex *m)
|
||||
{
|
||||
}
|
||||
|
||||
static int hwcrhk_get_pass(const char *prompt_info,
|
||||
int *len_io, char *buf,
|
||||
HWCryptoHook_PassphraseContext *ppctx,
|
||||
|
||||
@@ -86,7 +86,7 @@ static ERR_STRING_DATA HWCRHK_str_reasons[]=
|
||||
{HWCRHK_R_CHIL_ERROR ,"chil error"},
|
||||
{HWCRHK_R_CTRL_COMMAND_NOT_IMPLEMENTED ,"ctrl command not implemented"},
|
||||
{HWCRHK_R_DSO_FAILURE ,"dso failure"},
|
||||
{HWCRHK_R_LOCKING_MISSING ,"locking missing"},
|
||||
{HWCRHK_R_DYNAMIC_LOCKING_MISSING ,"dynamic locking missing"},
|
||||
{HWCRHK_R_MISSING_KEY_COMPONENTS ,"missing key components"},
|
||||
{HWCRHK_R_NOT_INITIALISED ,"not initialised"},
|
||||
{HWCRHK_R_NOT_LOADED ,"not loaded"},
|
||||
|
||||
@@ -84,7 +84,7 @@ static void ERR_HWCRHK_error(int function, int reason, char *file, int line);
|
||||
#define HWCRHK_R_CHIL_ERROR 102
|
||||
#define HWCRHK_R_CTRL_COMMAND_NOT_IMPLEMENTED 103
|
||||
#define HWCRHK_R_DSO_FAILURE 104
|
||||
#define HWCRHK_R_LOCKING_MISSING 114
|
||||
#define HWCRHK_R_DYNAMIC_LOCKING_MISSING 114
|
||||
#define HWCRHK_R_MISSING_KEY_COMPONENTS 105
|
||||
#define HWCRHK_R_NOT_INITIALISED 106
|
||||
#define HWCRHK_R_NOT_LOADED 107
|
||||
|
||||
@@ -81,7 +81,7 @@ int ENGINE_register_ciphers(ENGINE *e)
|
||||
int num_nids = e->ciphers(e, NULL, &nids, 0);
|
||||
if(num_nids > 0)
|
||||
return engine_table_register(&cipher_table,
|
||||
&engine_unregister_all_ciphers, e, nids,
|
||||
engine_unregister_all_ciphers, e, nids,
|
||||
num_nids, 0);
|
||||
}
|
||||
return 1;
|
||||
@@ -103,7 +103,7 @@ int ENGINE_set_default_ciphers(ENGINE *e)
|
||||
int num_nids = e->ciphers(e, NULL, &nids, 0);
|
||||
if(num_nids > 0)
|
||||
return engine_table_register(&cipher_table,
|
||||
&engine_unregister_all_ciphers, e, nids,
|
||||
engine_unregister_all_ciphers, e, nids,
|
||||
num_nids, 1);
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -78,7 +78,7 @@ int ENGINE_register_DH(ENGINE *e)
|
||||
{
|
||||
if(e->dh_meth)
|
||||
return engine_table_register(&dh_table,
|
||||
&engine_unregister_all_DH, e, &dummy_nid, 1, 0);
|
||||
engine_unregister_all_DH, e, &dummy_nid, 1, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ int ENGINE_set_default_DH(ENGINE *e)
|
||||
{
|
||||
if(e->dh_meth)
|
||||
return engine_table_register(&dh_table,
|
||||
&engine_unregister_all_DH, e, &dummy_nid, 1, 1);
|
||||
engine_unregister_all_DH, e, &dummy_nid, 1, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ int ENGINE_register_digests(ENGINE *e)
|
||||
int num_nids = e->digests(e, NULL, &nids, 0);
|
||||
if(num_nids > 0)
|
||||
return engine_table_register(&digest_table,
|
||||
&engine_unregister_all_digests, e, nids,
|
||||
engine_unregister_all_digests, e, nids,
|
||||
num_nids, 0);
|
||||
}
|
||||
return 1;
|
||||
@@ -103,7 +103,7 @@ int ENGINE_set_default_digests(ENGINE *e)
|
||||
int num_nids = e->digests(e, NULL, &nids, 0);
|
||||
if(num_nids > 0)
|
||||
return engine_table_register(&digest_table,
|
||||
&engine_unregister_all_digests, e, nids,
|
||||
engine_unregister_all_digests, e, nids,
|
||||
num_nids, 1);
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -78,7 +78,7 @@ int ENGINE_register_DSA(ENGINE *e)
|
||||
{
|
||||
if(e->dsa_meth)
|
||||
return engine_table_register(&dsa_table,
|
||||
&engine_unregister_all_DSA, e, &dummy_nid, 1, 0);
|
||||
engine_unregister_all_DSA, e, &dummy_nid, 1, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ int ENGINE_set_default_DSA(ENGINE *e)
|
||||
{
|
||||
if(e->dsa_meth)
|
||||
return engine_table_register(&dsa_table,
|
||||
&engine_unregister_all_DSA, e, &dummy_nid, 1, 0);
|
||||
engine_unregister_all_DSA, e, &dummy_nid, 1, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ int ENGINE_register_RAND(ENGINE *e)
|
||||
{
|
||||
if(e->rand_meth)
|
||||
return engine_table_register(&rand_table,
|
||||
&engine_unregister_all_RAND, e, &dummy_nid, 1, 0);
|
||||
engine_unregister_all_RAND, e, &dummy_nid, 1, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ int ENGINE_set_default_RAND(ENGINE *e)
|
||||
{
|
||||
if(e->rand_meth)
|
||||
return engine_table_register(&rand_table,
|
||||
&engine_unregister_all_RAND, e, &dummy_nid, 1, 1);
|
||||
engine_unregister_all_RAND, e, &dummy_nid, 1, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ int ENGINE_register_RSA(ENGINE *e)
|
||||
{
|
||||
if(e->rsa_meth)
|
||||
return engine_table_register(&rsa_table,
|
||||
&engine_unregister_all_RSA, e, &dummy_nid, 1, 0);
|
||||
engine_unregister_all_RSA, e, &dummy_nid, 1, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ int ENGINE_set_default_RSA(ENGINE *e)
|
||||
{
|
||||
if(e->rsa_meth)
|
||||
return engine_table_register(&rsa_table,
|
||||
&engine_unregister_all_RSA, e, &dummy_nid, 1, 1);
|
||||
engine_unregister_all_RSA, e, &dummy_nid, 1, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,6 +126,7 @@ static unsigned char *ustrsep(char **p,const char *sep)
|
||||
static int test1_exit(int ec)
|
||||
{
|
||||
EXIT(ec);
|
||||
return(0); /* To keep some compilers quiet */
|
||||
}
|
||||
|
||||
static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
*
|
||||
* <appro@fy.chalmers.se>
|
||||
*/
|
||||
# if defined(__i386) || defined(__i386__)
|
||||
# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
|
||||
# define ROTATE(a,n) ({ register unsigned int ret; \
|
||||
asm ( \
|
||||
"roll %1,%0" \
|
||||
@@ -224,7 +224,7 @@
|
||||
*/
|
||||
# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
|
||||
/* some GNU C inline assembler templates by <appro@fy.chalmers.se> */
|
||||
# if (defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)
|
||||
# if (defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)) && !defined(I386_ONLY)
|
||||
# define BE_FETCH32(a) ({ register unsigned int l=(a);\
|
||||
asm ( \
|
||||
"bswapl %0" \
|
||||
@@ -610,3 +610,28 @@ int HASH_FINAL (unsigned char *md, HASH_CTX *c)
|
||||
*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef MD32_REG_T
|
||||
#define MD32_REG_T long
|
||||
/*
|
||||
* This comment was originaly written for MD5, which is why it
|
||||
* discusses A-D. But it basically applies to all 32-bit digests,
|
||||
* which is why it was moved to common header file.
|
||||
*
|
||||
* In case you wonder why A-D are declared as long and not
|
||||
* as MD5_LONG. Doing so results in slight performance
|
||||
* boost on LP64 architectures. The catch is we don't
|
||||
* really care if 32 MSBs of a 64-bit register get polluted
|
||||
* with eventual overflows as we *save* only 32 LSBs in
|
||||
* *either* case. Now declaring 'em long excuses the compiler
|
||||
* from keeping 32 MSBs zeroed resulting in 13% performance
|
||||
* improvement under SPARC Solaris7/64 and 5% under AlphaLinux.
|
||||
* Well, to be honest it should say that this *prevents*
|
||||
* performance degradation.
|
||||
* <appro@fy.chalmers.se>
|
||||
* Apparently there're LP64 compilers that generate better
|
||||
* code if A-D are declared int. Most notably GCC-x86_64
|
||||
* generates better code.
|
||||
* <appro@fy.chalmers.se>
|
||||
*/
|
||||
#endif
|
||||
|
||||
@@ -86,21 +86,7 @@ int MD4_Init(MD4_CTX *c)
|
||||
void md4_block_host_order (MD4_CTX *c, const void *data, int num)
|
||||
{
|
||||
const MD4_LONG *X=data;
|
||||
register unsigned long A,B,C,D;
|
||||
/*
|
||||
* In case you wonder why A-D are declared as long and not
|
||||
* as MD4_LONG. Doing so results in slight performance
|
||||
* boost on LP64 architectures. The catch is we don't
|
||||
* really care if 32 MSBs of a 64-bit register get polluted
|
||||
* with eventual overflows as we *save* only 32 LSBs in
|
||||
* *either* case. Now declaring 'em long excuses the compiler
|
||||
* from keeping 32 MSBs zeroed resulting in 13% performance
|
||||
* improvement under SPARC Solaris7/64 and 5% under AlphaLinux.
|
||||
* Well, to be honest it should say that this *prevents*
|
||||
* performance degradation.
|
||||
*
|
||||
* <appro@fy.chalmers.se>
|
||||
*/
|
||||
register unsigned MD32_REG_T A,B,C,D;
|
||||
|
||||
A=c->A;
|
||||
B=c->B;
|
||||
@@ -176,25 +162,11 @@ void md4_block_host_order (MD4_CTX *c, const void *data, int num)
|
||||
void md4_block_data_order (MD4_CTX *c, const void *data_, int num)
|
||||
{
|
||||
const unsigned char *data=data_;
|
||||
register unsigned long A,B,C,D,l;
|
||||
/*
|
||||
* In case you wonder why A-D are declared as long and not
|
||||
* as MD4_LONG. Doing so results in slight performance
|
||||
* boost on LP64 architectures. The catch is we don't
|
||||
* really care if 32 MSBs of a 64-bit register get polluted
|
||||
* with eventual overflows as we *save* only 32 LSBs in
|
||||
* *either* case. Now declaring 'em long excuses the compiler
|
||||
* from keeping 32 MSBs zeroed resulting in 13% performance
|
||||
* improvement under SPARC Solaris7/64 and 5% under AlphaLinux.
|
||||
* Well, to be honest it should say that this *prevents*
|
||||
* performance degradation.
|
||||
*
|
||||
* <appro@fy.chalmers.se>
|
||||
*/
|
||||
register unsigned MD32_REG_T A,B,C,D,l;
|
||||
#ifndef MD32_XARRAY
|
||||
/* See comment in crypto/sha/sha_locl.h for details. */
|
||||
unsigned long XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
|
||||
XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
|
||||
unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
|
||||
XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
|
||||
# define X(i) XX##i
|
||||
#else
|
||||
MD4_LONG XX[MD4_LBLOCK];
|
||||
|
||||
@@ -86,21 +86,7 @@ int MD5_Init(MD5_CTX *c)
|
||||
void md5_block_host_order (MD5_CTX *c, const void *data, int num)
|
||||
{
|
||||
const MD5_LONG *X=data;
|
||||
register unsigned long A,B,C,D;
|
||||
/*
|
||||
* In case you wonder why A-D are declared as long and not
|
||||
* as MD5_LONG. Doing so results in slight performance
|
||||
* boost on LP64 architectures. The catch is we don't
|
||||
* really care if 32 MSBs of a 64-bit register get polluted
|
||||
* with eventual overflows as we *save* only 32 LSBs in
|
||||
* *either* case. Now declaring 'em long excuses the compiler
|
||||
* from keeping 32 MSBs zeroed resulting in 13% performance
|
||||
* improvement under SPARC Solaris7/64 and 5% under AlphaLinux.
|
||||
* Well, to be honest it should say that this *prevents*
|
||||
* performance degradation.
|
||||
*
|
||||
* <appro@fy.chalmers.se>
|
||||
*/
|
||||
register unsigned MD32_REG_T A,B,C,D;
|
||||
|
||||
A=c->A;
|
||||
B=c->B;
|
||||
@@ -193,25 +179,11 @@ void md5_block_host_order (MD5_CTX *c, const void *data, int num)
|
||||
void md5_block_data_order (MD5_CTX *c, const void *data_, int num)
|
||||
{
|
||||
const unsigned char *data=data_;
|
||||
register unsigned long A,B,C,D,l;
|
||||
/*
|
||||
* In case you wonder why A-D are declared as long and not
|
||||
* as MD5_LONG. Doing so results in slight performance
|
||||
* boost on LP64 architectures. The catch is we don't
|
||||
* really care if 32 MSBs of a 64-bit register get polluted
|
||||
* with eventual overflows as we *save* only 32 LSBs in
|
||||
* *either* case. Now declaring 'em long excuses the compiler
|
||||
* from keeping 32 MSBs zeroed resulting in 13% performance
|
||||
* improvement under SPARC Solaris7/64 and 5% under AlphaLinux.
|
||||
* Well, to be honest it should say that this *prevents*
|
||||
* performance degradation.
|
||||
*
|
||||
* <appro@fy.chalmers.se>
|
||||
*/
|
||||
register unsigned MD32_REG_T A,B,C,D,l;
|
||||
#ifndef MD32_XARRAY
|
||||
/* See comment in crypto/sha/sha_locl.h for details. */
|
||||
unsigned long XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
|
||||
XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
|
||||
unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
|
||||
XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
|
||||
# define X(i) XX##i
|
||||
#else
|
||||
MD5_LONG XX[MD5_LBLOCK];
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (defined(HEADER_DES_H) || defined(HEADER_DES_OLD_H)) && !defined(DES_LONG)
|
||||
#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)
|
||||
/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
|
||||
* %20 speed up (longs are 8 bytes, int's are 4). */
|
||||
#ifndef DES_LONG
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
|
||||
* major minor fix final patch/beta)
|
||||
*/
|
||||
#define OPENSSL_VERSION_NUMBER 0x00907005L
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.7-beta5 5 Dec 2002"
|
||||
#define OPENSSL_VERSION_NUMBER 0x00907006L
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.7-beta6 17 Dec 2002"
|
||||
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
|
||||
|
||||
|
||||
|
||||
@@ -146,9 +146,15 @@ sub cbc
|
||||
&mov($count, &wparam(2)); # length
|
||||
&and($count, 7);
|
||||
&jz(&label("finish"));
|
||||
&call(&label("PIC_point"));
|
||||
&set_label("PIC_point");
|
||||
&blindpop("edx");
|
||||
&lea("ecx",&DWP(&label("cbc_enc_jmp_table")."-".&label("PIC_point"),"edx"));
|
||||
&mov($count,&DWP(0,"ecx",$count,4))
|
||||
&add($count,"edx");
|
||||
&xor("ecx","ecx");
|
||||
&xor("edx","edx");
|
||||
&mov($count,&DWP(&label("cbc_enc_jmp_table"),"",$count,4));
|
||||
#&mov($count,&DWP(&label("cbc_enc_jmp_table"),"",$count,4));
|
||||
&jmp_ptr($count);
|
||||
|
||||
&set_label("ej7");
|
||||
@@ -318,22 +324,23 @@ sub cbc
|
||||
|
||||
&set_label("cbc_enc_jmp_table",1);
|
||||
&data_word("0");
|
||||
&data_word(&label("ej1"));
|
||||
&data_word(&label("ej2"));
|
||||
&data_word(&label("ej3"));
|
||||
&data_word(&label("ej4"));
|
||||
&data_word(&label("ej5"));
|
||||
&data_word(&label("ej6"));
|
||||
&data_word(&label("ej7"));
|
||||
&set_label("cbc_dec_jmp_table",1);
|
||||
&data_word("0");
|
||||
&data_word(&label("dj1"));
|
||||
&data_word(&label("dj2"));
|
||||
&data_word(&label("dj3"));
|
||||
&data_word(&label("dj4"));
|
||||
&data_word(&label("dj5"));
|
||||
&data_word(&label("dj6"));
|
||||
&data_word(&label("dj7"));
|
||||
&data_word(&label("ej1")."-".&label("PIC_point"));
|
||||
&data_word(&label("ej2")."-".&label("PIC_point"));
|
||||
&data_word(&label("ej3")."-".&label("PIC_point"));
|
||||
&data_word(&label("ej4")."-".&label("PIC_point"));
|
||||
&data_word(&label("ej5")."-".&label("PIC_point"));
|
||||
&data_word(&label("ej6")."-".&label("PIC_point"));
|
||||
&data_word(&label("ej7")."-".&label("PIC_point"));
|
||||
# not used
|
||||
#&set_label("cbc_dec_jmp_table",1);
|
||||
#&data_word("0");
|
||||
#&data_word(&label("dj1")."-".&label("PIC_point"));
|
||||
#&data_word(&label("dj2")."-".&label("PIC_point"));
|
||||
#&data_word(&label("dj3")."-".&label("PIC_point"));
|
||||
#&data_word(&label("dj4")."-".&label("PIC_point"));
|
||||
#&data_word(&label("dj5")."-".&label("PIC_point"));
|
||||
#&data_word(&label("dj6")."-".&label("PIC_point"));
|
||||
#&data_word(&label("dj7")."-".&label("PIC_point"));
|
||||
|
||||
&function_end_B($name);
|
||||
|
||||
|
||||
@@ -92,6 +92,8 @@ sub get_mem
|
||||
$addr="_$addr";
|
||||
}
|
||||
|
||||
if ($addr =~ /^.+\-.+$/) { $addr="($addr)"; }
|
||||
|
||||
$reg1="$regs{$reg1}" if defined($regs{$reg1});
|
||||
$reg2="$regs{$reg2}" if defined($regs{$reg2});
|
||||
if (($addr ne "") && ($addr ne 0))
|
||||
@@ -111,6 +113,7 @@ sub get_mem
|
||||
{
|
||||
$ret.="[$reg1$post]"
|
||||
}
|
||||
$ret =~ s/\[\]//; # in case $addr was the only argument
|
||||
return($ret);
|
||||
}
|
||||
|
||||
@@ -151,7 +154,7 @@ sub main'push { &out1("push",@_); $stack+=4; }
|
||||
sub main'pop { &out1("pop",@_); $stack-=4; }
|
||||
sub main'bswap { &out1("bswap",@_); &using486(); }
|
||||
sub main'not { &out1("not",@_); }
|
||||
sub main'call { &out1("call",'_'.$_[0]); }
|
||||
sub main'call { &out1("call",($_[0]=~/^\$L/?'':'_').$_[0]); }
|
||||
sub main'ret { &out0("ret"); }
|
||||
sub main'nop { &out0("nop"); }
|
||||
|
||||
@@ -338,7 +341,7 @@ sub main'set_label
|
||||
{
|
||||
if (!defined($label{$_[0]}))
|
||||
{
|
||||
$label{$_[0]}="${label}${_[0]}";
|
||||
$label{$_[0]}="\$${label}${_[0]}";
|
||||
$label++;
|
||||
}
|
||||
if((defined $_[2]) && ($_[2] == 1))
|
||||
@@ -363,3 +366,5 @@ sub out1p
|
||||
|
||||
push(@out,"\t$name\t ".&conv($p1)."\n");
|
||||
}
|
||||
|
||||
sub main'blindpop { &out1("pop",@_); }
|
||||
|
||||
@@ -98,6 +98,8 @@ sub get_mem
|
||||
$addr="_$addr";
|
||||
}
|
||||
|
||||
if ($addr =~ /^.+\-.+$/) { $addr="($addr)"; }
|
||||
|
||||
$reg1="$regs{$reg1}" if defined($regs{$reg1});
|
||||
$reg2="$regs{$reg2}" if defined($regs{$reg2});
|
||||
if (($addr ne "") && ($addr ne 0))
|
||||
@@ -117,6 +119,7 @@ sub get_mem
|
||||
{
|
||||
$ret.="$reg1$post]"
|
||||
}
|
||||
$ret =~ s/\+\]/]/; # in case $addr was the only argument
|
||||
return($ret);
|
||||
}
|
||||
|
||||
@@ -160,7 +163,7 @@ sub main'push { &out1("push",@_); $stack+=4; }
|
||||
sub main'pop { &out1("pop",@_); $stack-=4; }
|
||||
sub main'bswap { &out1("bswap",@_); &using486(); }
|
||||
sub main'not { &out1("not",@_); }
|
||||
sub main'call { &out1("call",'_'.$_[0]); }
|
||||
sub main'call { &out1("call",($_[0]=~/^\$L/?'':'_').$_[0]); }
|
||||
sub main'ret { &out0("ret"); }
|
||||
sub main'nop { &out0("nop"); }
|
||||
|
||||
@@ -322,7 +325,7 @@ sub main'set_label
|
||||
{
|
||||
if (!defined($label{$_[0]}))
|
||||
{
|
||||
$label{$_[0]}="${label}${_[0]}";
|
||||
$label{$_[0]}="\$${label}${_[0]}";
|
||||
$label++;
|
||||
}
|
||||
push(@out,"$label{$_[0]}:\n");
|
||||
@@ -340,3 +343,5 @@ sub out1p
|
||||
|
||||
push(@out,"\t$name\t ".&conv($p1)."\n");
|
||||
}
|
||||
|
||||
sub main'blindpop { &out1("pop",@_); }
|
||||
|
||||
@@ -87,12 +87,12 @@ sub main'DWP
|
||||
$ret.=$addr if ($addr ne "") && ($addr ne 0);
|
||||
if ($reg2 ne "")
|
||||
{
|
||||
if($idx ne "")
|
||||
if($idx ne "" && $idx != 0)
|
||||
{ $ret.="($reg1,$reg2,$idx)"; }
|
||||
else
|
||||
{ $ret.="($reg1,$reg2)"; }
|
||||
}
|
||||
else
|
||||
elsif ($reg1 ne "")
|
||||
{ $ret.="($reg1)" }
|
||||
return($ret);
|
||||
}
|
||||
@@ -167,7 +167,7 @@ sub main'pop { &out1("popl",@_); $stack-=4; }
|
||||
sub main'pushf { &out0("pushf"); $stack+=4; }
|
||||
sub main'popf { &out0("popf"); $stack-=4; }
|
||||
sub main'not { &out1("notl",@_); }
|
||||
sub main'call { &out1("call",$under.$_[0]); }
|
||||
sub main'call { &out1("call",($_[0]=~/^\.L/?'':$under).$_[0]); }
|
||||
sub main'ret { &out0("ret"); }
|
||||
sub main'nop { &out0("nop"); }
|
||||
|
||||
@@ -542,3 +542,22 @@ sub popvars
|
||||
&main'pop("edx");
|
||||
&main'popf();
|
||||
}
|
||||
|
||||
sub main'picmeup
|
||||
{
|
||||
local($dst,$sym)=@_;
|
||||
local($tmp)=<<___;
|
||||
#if (defined(ELF) || defined(SOL)) && defined(PIC)
|
||||
.align 8
|
||||
call 1f
|
||||
1: popl $regs{$dst}
|
||||
addl \$_GLOBAL_OFFSET_TABLE_+[.-1b],$regs{$dst}
|
||||
movl $sym\@GOT($regs{$dst}),$regs{$dst}
|
||||
#else
|
||||
leal $sym,$regs{$dst}
|
||||
#endif
|
||||
___
|
||||
push(@out,$tmp);
|
||||
}
|
||||
|
||||
sub main'blindpop { &out1("popl",@_); }
|
||||
|
||||
@@ -149,8 +149,28 @@
|
||||
#if defined(OPENSSL_SYS_WIN32) && defined(_MSC_VER)
|
||||
#define ROTATE_l32(a,n) _lrotl(a,n)
|
||||
#define ROTATE_r32(a,n) _lrotr(a,n)
|
||||
#else
|
||||
#elif defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(NO_ASM) && !defined(NO_INLINE_ASM)
|
||||
# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
|
||||
# define ROTATE_l32(a,n) ({ register unsigned int ret; \
|
||||
asm ("roll %%cl,%0" \
|
||||
: "=r"(ret) \
|
||||
: "c"(n),"0"(a) \
|
||||
: "cc"); \
|
||||
ret; \
|
||||
})
|
||||
# define ROTATE_r32(a,n) ({ register unsigned int ret; \
|
||||
asm ("rorl %%cl,%0" \
|
||||
: "=r"(ret) \
|
||||
: "c"(n),"0"(a) \
|
||||
: "cc"); \
|
||||
ret; \
|
||||
})
|
||||
# endif
|
||||
#endif
|
||||
#ifndef ROTATE_l32
|
||||
#define ROTATE_l32(a,n) (((a)<<(n&0x1f))|(((a)&0xffffffff)>>(32-(n&0x1f))))
|
||||
#endif
|
||||
#ifndef ROTATE_r32
|
||||
#define ROTATE_r32(a,n) (((a)<<(32-(n&0x1f)))|(((a)&0xffffffff)>>(n&0x1f)))
|
||||
#endif
|
||||
|
||||
|
||||
@@ -90,8 +90,8 @@ int RIPEMD160_Init(RIPEMD160_CTX *c)
|
||||
void ripemd160_block_host_order (RIPEMD160_CTX *ctx, const void *p, int num)
|
||||
{
|
||||
const RIPEMD160_LONG *XX=p;
|
||||
register unsigned long A,B,C,D,E;
|
||||
register unsigned long a,b,c,d,e;
|
||||
register unsigned MD32_REG_T A,B,C,D,E;
|
||||
register unsigned MD32_REG_T a,b,c,d,e;
|
||||
|
||||
for (;num--;XX+=HASH_LBLOCK)
|
||||
{
|
||||
@@ -290,12 +290,12 @@ void ripemd160_block_host_order (RIPEMD160_CTX *ctx, const void *p, int num)
|
||||
void ripemd160_block_data_order (RIPEMD160_CTX *ctx, const void *p, int num)
|
||||
{
|
||||
const unsigned char *data=p;
|
||||
register unsigned long A,B,C,D,E;
|
||||
unsigned long a,b,c,d,e,l;
|
||||
register unsigned MD32_REG_T A,B,C,D,E;
|
||||
unsigned MD32_REG_T a,b,c,d,e,l;
|
||||
#ifndef MD32_XARRAY
|
||||
/* See comment in crypto/sha/sha_locl.h for details. */
|
||||
unsigned long XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
|
||||
XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
|
||||
unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
|
||||
XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
|
||||
# define X(i) XX##i
|
||||
#else
|
||||
RIPEMD160_LONG XX[16];
|
||||
|
||||
@@ -224,10 +224,10 @@ int HASH_INIT (SHA_CTX *c)
|
||||
void HASH_BLOCK_HOST_ORDER (SHA_CTX *c, const void *d, int num)
|
||||
{
|
||||
const SHA_LONG *W=d;
|
||||
register unsigned long A,B,C,D,E,T;
|
||||
register unsigned MD32_REG_T A,B,C,D,E,T;
|
||||
#ifndef MD32_XARRAY
|
||||
unsigned long XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
|
||||
XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
|
||||
unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
|
||||
XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
|
||||
#else
|
||||
SHA_LONG XX[16];
|
||||
#endif
|
||||
@@ -349,10 +349,10 @@ void HASH_BLOCK_HOST_ORDER (SHA_CTX *c, const void *d, int num)
|
||||
void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, int num)
|
||||
{
|
||||
const unsigned char *data=p;
|
||||
register unsigned long A,B,C,D,E,T,l;
|
||||
register unsigned MD32_REG_T A,B,C,D,E,T,l;
|
||||
#ifndef MD32_XARRAY
|
||||
unsigned long XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
|
||||
XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
|
||||
unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
|
||||
XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
|
||||
#else
|
||||
SHA_LONG XX[16];
|
||||
#endif
|
||||
|
||||
@@ -1158,7 +1158,7 @@ void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx)
|
||||
ctx->chain=NULL;
|
||||
}
|
||||
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE_CTX, ctx, &(ctx->ex_data));
|
||||
OPENSSL_cleanse(&ctx->ex_data,sizeof(CRYPTO_EX_DATA));
|
||||
memset(&ctx->ex_data,0,sizeof(CRYPTO_EX_DATA));
|
||||
}
|
||||
|
||||
void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, long flags)
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
BIO_new_bio_pair - create a new BIO pair
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/bio.h>
|
||||
|
||||
int BIO_new_bio_pair(BIO **bio1, size_t writebuf1, BIO **bio2, size_t writebuf2);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
BIO_new_bio_pair() creates a buffering BIO pair based on the
|
||||
L<SSL_set_bio(3)|SSL_set_bio(3)> method. The BIO pair has two endpoints between which
|
||||
data can be buffered. Its typical use is to connect one endpoint as underlying
|
||||
input/output BIO to an SSL and access the other one controlled by the program
|
||||
instead of accessing the network connection directly.
|
||||
|
||||
The two new BIOs B<bio1> and B<bio2> are symmetric with respect to their
|
||||
functionality. The size of their buffers is determined by B<writebuf1> and
|
||||
B<writebuf2>. If the size give is 0, the default size is used.
|
||||
|
||||
BIO_new_bio_pair() does not check whether B<bio1> or B<bio2> do point to
|
||||
some other BIO, the values are overwritten, BIO_free() is not called.
|
||||
|
||||
The two BIOs, even though forming a BIO pair and must be BIO_free()'ed
|
||||
separately. This can be of importance, as some SSL-functions like SSL_set_bio()
|
||||
or SSL_free() call BIO_free() implicitly, so that the peer-BIO is left
|
||||
untouched and must also be BIO_free()'ed.
|
||||
|
||||
=head1 EXAMPLE
|
||||
|
||||
The BIO pair can be used to have full control over the network access of an
|
||||
application. The application can call select() on the socket as required
|
||||
without having to go through the SSL-interface.
|
||||
|
||||
BIO *internal_bio, *network_bio;
|
||||
...
|
||||
BIO_new_bio_pair(internal_bio, 0, network_bio, 0);
|
||||
SSL_set_bio(ssl, internal_bio, internal_bio);
|
||||
SSL_operations();
|
||||
...
|
||||
|
||||
application | TLS-engine
|
||||
| |
|
||||
+----------> SSL_operations()
|
||||
| /\ ||
|
||||
| || \/
|
||||
| BIO-pair (internal_bio)
|
||||
+----------< BIO-pair (network_bio)
|
||||
| |
|
||||
socket |
|
||||
|
||||
...
|
||||
SSL_free(ssl); /* implicitly frees internal_bio */
|
||||
BIO_free(network_bio);
|
||||
...
|
||||
|
||||
As the BIO pair will only buffer the data and never directly access the
|
||||
connection, it behaves non-blocking and will return as soon as the write
|
||||
buffer is full or the read buffer is drained. Then the application has to
|
||||
flush the write buffer and/or fill the read buffer.
|
||||
|
||||
Use the BIO_ctrl_pending(), to find out whether data is buffered in the BIO
|
||||
and must be transfered to the network. Use BIO_ctrl_get_read_request() to
|
||||
find out, how many bytes must be written into the buffer before the
|
||||
SSL_operation() can successfully be continued.
|
||||
|
||||
=head1 WARNING
|
||||
|
||||
As the data is buffered, SSL_operation() may return with a ERROR_SSL_WANT_READ
|
||||
condition, but there is still data in the write buffer. An application must
|
||||
not rely on the error value of SSL_operation() but must assure that the
|
||||
write buffer is always flushed first. Otherwise a deadlock may occur as
|
||||
the peer might be waiting for the data before being able to continue.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
The following return values can occur:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 1
|
||||
|
||||
The BIO pair was created successfully. The new BIOs are available in
|
||||
B<bio1> and B<bio2>.
|
||||
|
||||
=item 0
|
||||
|
||||
The operation failed. The NULL pointer is stored into the locations for
|
||||
B<bio1> and B<bio2>. Check the error stack for more information.
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<SSL_set_bio(3)|SSL_set_bio(3)>, L<ssl(3)|ssl(3)>, L<bio(3)|bio(3)>,
|
||||
L<BIO_ctrl_pending(3)|BIO_ctrl_pending(3)>,
|
||||
L<BIO_ctrl_get_read_request(3)|BIO_ctrl_get_read_request(3)>
|
||||
|
||||
=cut
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
BIO_s_accept, BIO_set_nbio, BIO_set_accept_port, BIO_get_accept_port,
|
||||
BIO_s_accept, BIO_set_accept_port, BIO_get_accept_port,
|
||||
BIO_set_nbio_accept, BIO_set_accept_bios, BIO_set_bind_mode,
|
||||
BIO_get_bind_mode, BIO_do_accept - accept BIO
|
||||
|
||||
|
||||
@@ -76,7 +76,9 @@ BIO_get_write_buf_size() returns the size of the write buffer.
|
||||
BIO_new_bio_pair() combines the calls to BIO_new(), BIO_make_bio_pair() and
|
||||
BIO_set_write_buf_size() to create a connected pair of BIOs B<bio1>, B<bio2>
|
||||
with write buffer sizes B<writebuf1> and B<writebuf2>. If either size is
|
||||
zero then the default size is used.
|
||||
zero then the default size is used. BIO_new_bio_pair() does not check whether
|
||||
B<bio1> or B<bio2> do point to some other BIO, the values are overwritten,
|
||||
BIO_free() is not called.
|
||||
|
||||
BIO_get_write_guarantee() and BIO_ctrl_get_write_guarantee() return the maximum
|
||||
length of data that can be currently written to the BIO. Writes larger than this
|
||||
@@ -118,9 +120,59 @@ the application then waits for data to be available on the underlying transport
|
||||
before flushing the write buffer it will never succeed because the request was
|
||||
never sent!
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
BIO_new_bio_pair() returns 1 on success, with the new BIOs available in
|
||||
B<bio1> and B<bio2>, or 0 on failure, with NULL pointers stored into the
|
||||
locations for B<bio1> and B<bio2>. Check the error stack for more information.
|
||||
|
||||
[XXXXX: More return values need to be added here]
|
||||
|
||||
=head1 EXAMPLE
|
||||
|
||||
TBA
|
||||
The BIO pair can be used to have full control over the network access of an
|
||||
application. The application can call select() on the socket as required
|
||||
without having to go through the SSL-interface.
|
||||
|
||||
BIO *internal_bio, *network_bio;
|
||||
...
|
||||
BIO_new_bio_pair(internal_bio, 0, network_bio, 0);
|
||||
SSL_set_bio(ssl, internal_bio, internal_bio);
|
||||
SSL_operations();
|
||||
...
|
||||
|
||||
application | TLS-engine
|
||||
| |
|
||||
+----------> SSL_operations()
|
||||
| /\ ||
|
||||
| || \/
|
||||
| BIO-pair (internal_bio)
|
||||
+----------< BIO-pair (network_bio)
|
||||
| |
|
||||
socket |
|
||||
|
||||
...
|
||||
SSL_free(ssl); /* implicitly frees internal_bio */
|
||||
BIO_free(network_bio);
|
||||
...
|
||||
|
||||
As the BIO pair will only buffer the data and never directly access the
|
||||
connection, it behaves non-blocking and will return as soon as the write
|
||||
buffer is full or the read buffer is drained. Then the application has to
|
||||
flush the write buffer and/or fill the read buffer.
|
||||
|
||||
Use the BIO_ctrl_pending(), to find out whether data is buffered in the BIO
|
||||
and must be transfered to the network. Use BIO_ctrl_get_read_request() to
|
||||
find out, how many bytes must be written into the buffer before the
|
||||
SSL_operation() can successfully be continued.
|
||||
|
||||
=head1 WARNING
|
||||
|
||||
As the data is buffered, SSL_operation() may return with a ERROR_SSL_WANT_READ
|
||||
condition, but there is still data in the write buffer. An application must
|
||||
not rely on the error value of SSL_operation() but must assure that the
|
||||
write buffer is always flushed first. Otherwise a deadlock may occur as
|
||||
the peer might be waiting for the data before being able to continue.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ tell which one you are dealing with at any given point in time (after all
|
||||
they are both simply (ENGINE *) pointers, the difference is in the way they
|
||||
are used).
|
||||
|
||||
=head3 Structural references
|
||||
I<Structural references>
|
||||
|
||||
This basic type of reference is typically used for creating new ENGINEs
|
||||
dynamically, iterating across OpenSSL's internal linked-list of loaded
|
||||
@@ -224,7 +224,7 @@ To clarify a particular function's handling of references, one should
|
||||
always consult that function's documentation "man" page, or failing that
|
||||
the openssl/engine.h header file includes some hints.
|
||||
|
||||
=head3 Functional references
|
||||
I<Functional references>
|
||||
|
||||
As mentioned, functional references exist when the cryptographic
|
||||
functionality of an ENGINE is required to be available. A functional
|
||||
@@ -386,7 +386,7 @@ things, so we will simply illustrate the consequences as they apply to a
|
||||
couple of simple cases and leave developers to consider these and the
|
||||
source code to openssl's builtin utilities as guides.
|
||||
|
||||
=head3 Using a specific ENGINE implementation
|
||||
I<Using a specific ENGINE implementation>
|
||||
|
||||
Here we'll assume an application has been configured by its user or admin
|
||||
to want to use the "ACME" ENGINE if it is available in the version of
|
||||
@@ -418,7 +418,7 @@ illustrates how to approach this;
|
||||
/* Release the structural reference from ENGINE_by_id() */
|
||||
ENGINE_free(e);
|
||||
|
||||
=head3 Automatically using builtin ENGINE implementations
|
||||
I<Automatically using builtin ENGINE implementations>
|
||||
|
||||
Here we'll assume we want to load and register all ENGINE implementations
|
||||
bundled with OpenSSL, such that for any cryptographic algorithm required by
|
||||
@@ -469,7 +469,7 @@ in same cases both. ENGINE implementations should provide indications of
|
||||
this in the descriptions attached to builtin control commands and/or in
|
||||
external product documentation.
|
||||
|
||||
=head3 Issuing control commands to an ENGINE
|
||||
I<Issuing control commands to an ENGINE>
|
||||
|
||||
Let's illustrate by example; a function for which the caller supplies the
|
||||
name of the ENGINE it wishes to use, a table of string-pairs for use before
|
||||
@@ -526,7 +526,7 @@ return success without doing anything. In this case we assume the user is
|
||||
only supplying commands specific to the given ENGINE so we set this to
|
||||
FALSE.
|
||||
|
||||
=head3 Discovering supported control commands
|
||||
I<Discovering supported control commands>
|
||||
|
||||
It is possible to discover at run-time the names, numerical-ids, descriptions
|
||||
and input parameters of the control commands supported from a structural
|
||||
|
||||
@@ -751,7 +751,12 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
|
||||
*/
|
||||
if (rule_str == NULL) return(NULL);
|
||||
|
||||
if (init_ciphers) load_ciphers();
|
||||
if (init_ciphers)
|
||||
{
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_SSL);
|
||||
if (init_ciphers) load_ciphers();
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_SSL);
|
||||
}
|
||||
|
||||
/*
|
||||
* To reduce the work to do we only want to process the compiled
|
||||
|
||||
@@ -119,7 +119,7 @@ apps:
|
||||
@(cd ..; $(MAKE) DIRS=apps all)
|
||||
|
||||
SET_SO_PATHS=LIBPATH="`cd ..; pwd`"; LD_LIBRARY_PATH="$$LIBPATH"; DYLD_LIBRARY_PATH="$$LIBPATH"; SHLIB_PATH="$$LIBPATH"; \
|
||||
if [ "$(PLATFORM)" == "DJGPP" ]; then PATH="$$LIBPATH\;$$PATH"; \
|
||||
if [ "$(PLATFORM)" = "DJGPP" ]; then PATH="$$LIBPATH\;$$PATH"; \
|
||||
elif [ "$(PLATFORM)" != "Cygwin" ]; then PATH="$$LIBPATH:$$PATH"; fi; \
|
||||
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH
|
||||
|
||||
|
||||
16
test/testssl
16
test/testssl
@@ -121,8 +121,12 @@ $ssltest -bio_pair -server_auth -client_auth -app_verify $CA $extra || exit 1
|
||||
|
||||
#############################################################################
|
||||
|
||||
echo test tls1 with 1024bit anonymous DH, multiple handshakes
|
||||
$ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1
|
||||
if ../apps/openssl no-dh; then
|
||||
echo skipping anonymous DH tests
|
||||
else
|
||||
echo test tls1 with 1024bit anonymous DH, multiple handshakes
|
||||
$ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1
|
||||
fi
|
||||
|
||||
if ../apps/openssl no-rsa; then
|
||||
echo skipping RSA tests
|
||||
@@ -130,8 +134,12 @@ else
|
||||
echo test tls1 with 1024bit RSA, no DHE, multiple handshakes
|
||||
./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -no_dhe -num 10 -f -time $extra || exit 1
|
||||
|
||||
echo test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes
|
||||
./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1
|
||||
if ../apps/openssl no-dh; then
|
||||
echo skipping RSA+DHE tests
|
||||
else
|
||||
echo test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes
|
||||
./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -159,16 +159,25 @@ $ if $severity .ne. 1 then goto exit3
|
||||
$
|
||||
$!###########################################################################
|
||||
$
|
||||
$ write sys$output "test tls1 with 1024bit anonymous DH, multiple handshakes"
|
||||
$ 'ssltest' -v -bio_pair -tls1 -cipher "ADH" -dhe1024dsa -num 10 -f -time
|
||||
$ if $severity .ne. 1 then goto exit3
|
||||
$
|
||||
$ set noon
|
||||
$ define/user sys$output nla0:
|
||||
$ mcr 'exe_dir'openssl no-rsa
|
||||
$ save_severity=$SEVERITY
|
||||
$ no_rsa=$SEVERITY
|
||||
$ define/user sys$output nla0:
|
||||
$ mcr 'exe_dir'openssl no-dh
|
||||
$ no_dh=$SEVERITY
|
||||
$ set on
|
||||
$ if save_severity
|
||||
$
|
||||
$ if no_dh
|
||||
$ then
|
||||
$ write sys$output "skipping anonymous DH tests"
|
||||
$ else
|
||||
$ write sys$output "test tls1 with 1024bit anonymous DH, multiple handshakes"
|
||||
$ 'ssltest' -v -bio_pair -tls1 -cipher "ADH" -dhe1024dsa -num 10 -f -time
|
||||
$ if $severity .ne. 1 then goto exit3
|
||||
$ endif
|
||||
$
|
||||
$ if no_rsa
|
||||
$ then
|
||||
$ write sys$output "skipping RSA tests"
|
||||
$ else
|
||||
@@ -176,9 +185,14 @@ $ write sys$output "test tls1 with 1024bit RSA, no DHE, multiple handshakes"
|
||||
$ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -no_dhe -num 10 -f -time
|
||||
$ if $severity .ne. 1 then goto exit3
|
||||
$
|
||||
$ write sys$output "test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes"
|
||||
$ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -dhe1024dsa -num 10 -f -time
|
||||
$ if $severity .ne. 1 then goto exit3
|
||||
$ if no_dh
|
||||
$ then
|
||||
$ write sys$output "skipping RSA+DHE tests"
|
||||
$ else
|
||||
$ write sys$output "test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes"
|
||||
$ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -dhe1024dsa -num 10 -f -time
|
||||
$ if $severity .ne. 1 then goto exit3
|
||||
$ endif
|
||||
$ endif
|
||||
$
|
||||
$ RET = 1
|
||||
|
||||
@@ -27,13 +27,15 @@ all:
|
||||
install:
|
||||
@for i in $(APPS) ; \
|
||||
do \
|
||||
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
|
||||
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
|
||||
done;
|
||||
@for i in $(MISC_APPS) ; \
|
||||
do \
|
||||
(cp $$i $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i ); \
|
||||
(cp $$i $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i.new; \
|
||||
chmod 755 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i.new; \
|
||||
mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/misc/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/misc/$$i ); \
|
||||
done;
|
||||
|
||||
files:
|
||||
|
||||
Reference in New Issue
Block a user