Remove outdated legacy crypto options

Many options for supporting optimizations for legacy crypto on legacy
platforms have been removed.  This simplifies the source code and
does not really penalize anyone.
        DES_PTR (always on)
        DES_RISC1, DES_RISC2 (always off)
        DES_INT (always 'unsigned int')
        DES_UNROLL (always on)
        BF_PTR (always on) BF_PTR2 (removed)
        MD2_CHAR, MD2_LONG (always 'unsigned char')
        IDEA_SHORT, IDEA_LONG (always 'unsigned int')
        RC2_SHORT, RC2_LONG (always 'unsigned int')
        RC4_LONG (only int and char (for assembler) are supported)
        RC4_CHUNK (always long), RC_CHUNK_LL (removed)
        RC4_INDEX (always on)
And also make D_ENCRYPT macro more clear (@appro)

This is done in consultation with Andy.

Reviewed-by: Andy Polyakov <appro@openssl.org>
This commit is contained in:
Rich Salz 2016-01-27 18:43:25 -05:00 committed by Rich Salz
parent 8ed40b83ec
commit 3e9e810f2e
31 changed files with 138 additions and 1152 deletions

View file

@ -4,6 +4,14 @@
Changes between 1.0.2e and 1.1.0 [xx XXX xxxx]
*) Removed many obsolete configuration items, including
DES_PTR, DES_RISC1, DES_RISC2, DES_INT
MD2_CHAR, MD2_INT, MD2_LONG
BF_PTR, BF_PTR2
IDEA_SHORT, IDEA_LONG
RC2_SHORT, RC2_LONG, RC4_LONG, RC4_CHUNK, RC4_INDEX
[Rich Salz, with advice from Andy Polyakov]
*) Configuration and writing out the results from it has changed.
Files such as Makefile include/openssl/opensslconf.h and are now
produced through general templates, such as Makefile.in and

View file

@ -76,7 +76,7 @@
debug_cflags => "-O0 -g",
release_cflags => "-O3",
thread_cflag => "-pthread",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
shared_cflag => "-fPIC",
shared_ldflag => "-m64 -shared -static-libgcc",
@ -92,7 +92,7 @@
release_cflags => "-xO5 -xregs=frameptr -xdepend -xbuiltin",
thread_cflag => "-D_REENTRANT",
lflags => sub { join(" ",@_,"-mt -lpthread") },
bn_ops => "BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR",
bn_ops => "BN_LLONG RC4_CHAR",
shared_cflag => "-KPIC",
shared_ldflag => "-G -dy -z text",
},
@ -104,7 +104,7 @@
release_cflags => "-xO5 -xdepend -xbuiltin",
thread_cflag => "-D_REENTRANT",
lflags => sub { join(" ",@_,"-mt -lpthread") },
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
shared_cflag => "-KPIC",
shared_ldflag => "-xarch=generic64 -G -dy -z text",
@ -119,7 +119,7 @@
debug_cflags => "-O0 -g",
release_cflags => "-O3",
thread_cflag => "-pthread",
bn_ops => "BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR",
bn_ops => "BN_LLONG RC4_CHAR",
shared_cflag => "-fPIC",
shared_ldflag => "-shared",
},
@ -137,7 +137,7 @@
"solaris64-sparcv9-gcc" => {
inherit_from => [ "solaris-sparcv9-gcc" ],
cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
bn_ops => "BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR",
bn_ops => "BN_LLONG RC4_CHAR",
shared_ldflag => "-m64 -shared",
multilib => "/64",
},
@ -154,7 +154,7 @@
release_cflags => "-xO5 -xdepend",
thread_cflag => "-D_REENTRANT",
lflags => sub { join(" ",@_,"-mt -lpthread") },
bn_ops => "BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR",
bn_ops => "BN_LLONG RC4_CHAR",
shared_cflag => "-KPIC",
shared_ldflag => "-G -dy -z text",
},
@ -170,7 +170,7 @@
"solaris64-sparcv9-cc" => {
inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
cflags => add_before(" ", "-xarch=v9 -xtarget=ultra"),
bn_ops => "BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR",
bn_ops => "BN_LLONG RC4_CHAR",
shared_ldflag => "-xarch=v9 -G -dy -z text",
multilib => "/64",
},
@ -184,7 +184,7 @@
debug_cflags => "-g -O0",
release_cflags => "-O3",
thread_cflag => "(unknown)",
bn_ops => "BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR",
bn_ops => "BN_LLONG RC4_CHAR",
perlasm_scheme => "o32",
dso_scheme => "dlfcn",
shared_target => "irix-shared",
@ -197,7 +197,7 @@
debug_cflags => "-g -O0",
release_cflags => "-O2",
thread_cflag => "(unknown)",
bn_ops => "BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR",
bn_ops => "BN_LLONG RC4_CHAR",
perlasm_scheme => "o32",
dso_scheme => "dlfcn",
shared_target => "irix-shared",
@ -213,7 +213,7 @@
debug_cflags => "-g -O0",
release_cflags => "-O3",
thread_cflag => "-D_SGI_MP_SOURCE -pthread",
bn_ops => "MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT",
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
perlasm_scheme => "n32",
dso_scheme => "dlfcn",
shared_target => "irix-shared",
@ -229,7 +229,7 @@
release_cflags => "-O2",
thread_cflag => "-D_SGI_MP_SOURCE",
lflags => "-lpthread",
bn_ops => "DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT",
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
perlasm_scheme => "n32",
dso_scheme => "dlfcn",
shared_target => "irix-shared",
@ -245,7 +245,7 @@
debug_cflags => "-g -O0",
release_cflags => "-O3",
thread_cflag => "-D_SGI_MP_SOURCE",
bn_ops => "RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG",
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "64",
dso_scheme => "dlfcn",
shared_target => "irix-shared",
@ -261,7 +261,7 @@
release_cflags => "-O2",
thread_cflag => "-D_SGI_MP_SOURCE",
lflags => "-lpthread",
bn_ops => "RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG",
bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "64",
dso_scheme => "dlfcn",
shared_target => "irix-shared",
@ -305,7 +305,7 @@
release_cflags => "-O3",
thread_cflag => "-pthread",
lflags => "-Wl,+s -ldld",
bn_ops => "BN_LLONG DES_PTR DES_UNROLL DES_RISC1",
bn_ops => "BN_LLONG",
dso_scheme => "dl",
shared_target => "hpux-shared",
shared_cflag => "-fPIC",
@ -324,7 +324,7 @@
release_cflags => "-O3",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl",
bn_ops => "SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
dso_scheme => "dlfcn",
shared_target => "hpux-shared",
shared_cflag => "-fpic",
@ -344,7 +344,7 @@
release_cflags => "+O3",
thread_cflag => "-D_REENTRANT",
lflags => "-Wl,+s -ldld -lpthread",
bn_ops => "MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT",
bn_ops => "RC4_CHAR",
dso_scheme => "dl",
shared_target => "hpux-shared",
shared_cflag => "+Z",
@ -364,7 +364,7 @@
release_cflags => "+O3",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl -lpthread",
bn_ops => "SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
dso_scheme => "dlfcn",
shared_target => "hpux-shared",
shared_cflag => "+Z",
@ -382,7 +382,7 @@
release_cflags => "+O2",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl -lpthread",
bn_ops => "SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT",
bn_ops => "SIXTY_FOUR_BIT",
dso_scheme => "dlfcn",
shared_target => "hpux-shared",
shared_cflag => "+Z",
@ -400,7 +400,7 @@
release_cflags => "+O3",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl -lpthread",
bn_ops => "SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT",
bn_ops => "SIXTY_FOUR_BIT_LONG",
dso_scheme => "dlfcn",
shared_target => "hpux-shared",
shared_cflag => "+Z",
@ -417,7 +417,7 @@
release_cflags => "-O3",
thread_cflag => "-pthread",
lflags => "-ldl",
bn_ops => "SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT",
bn_ops => "SIXTY_FOUR_BIT",
dso_scheme => "dlfcn",
shared_target => "hpux-shared",
shared_cflag => "-fpic",
@ -433,7 +433,7 @@
release_cflags => "-O3",
thread_cflag => "-pthread",
lflags => "-ldl",
bn_ops => "SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT",
bn_ops => "SIXTY_FOUR_BIT_LONG",
dso_scheme => "dlfcn",
shared_target => "hpux-shared",
shared_cflag => "-fpic",
@ -449,24 +449,16 @@
thread_cflag => "(unknown)",
sys_id => "MPE",
lflags => "-L/SYSLOG/PUB -lsyslog -lsocket -lcurses",
bn_ops => "BN_LLONG DES_PTR DES_UNROLL DES_RISC1",
bn_ops => "BN_LLONG",
},
#### DEC Alpha OSF/1/Tru64 targets.
#
# "What's in a name? That which we call a rose
# By any other word would smell as sweet."
#
# - William Shakespeare, "Romeo & Juliet", Act II, scene II.
#
# For gcc, the following gave a %50 speedup on a 164 over the 'DES_INT' version
#
"osf1-alpha-gcc" => {
inherit_from => [ asm("alpha_asm") ],
cc => "gcc",
cflags => "-O3",
thread_cflag => "(unknown)",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1",
bn_ops => "SIXTY_FOUR_BIT_LONG",
dso_scheme => "dlfcn",
shared_target => "alpha-osf1-shared",
shared_extension => ".so",
@ -476,7 +468,7 @@
cc => "cc",
cflags => "-std1 -tune host -O4 -readonly_strings",
thread_cflag => "(unknown)",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK",
bn_ops => "SIXTY_FOUR_BIT_LONG",
dso_scheme => "dlfcn",
shared_target => "alpha-osf1-shared",
shared_extension => ".so",
@ -486,7 +478,7 @@
cc => "cc",
cflags => "-std1 -tune host -fast -readonly_strings",
thread_cflag => "-pthread",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK",
bn_ops => "SIXTY_FOUR_BIT_LONG",
dso_scheme => "dlfcn",
shared_target => "alpha-osf1-shared",
shared_ldflag => "-msym",
@ -505,7 +497,7 @@
release_cflags => "-O3",
thread_cflag => "-pthread",
lflags => "-ldl",
bn_ops => "BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR",
bn_ops => "BN_LLONG RC4_CHAR",
dso_scheme => "dlfcn",
shared_target => "linux-shared",
shared_cflag => "-fPIC",
@ -513,7 +505,7 @@
},
"linux-generic64" => {
inherit_from => [ "linux-generic32" ],
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
},
"linux-ppc" => {
@ -576,7 +568,7 @@
"linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
cflags => "-mabi=ilp32 -Wall",
bn_ops => "SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR",
bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
perlasm_scheme => "linux64",
shared_ldflag => "-mabi=ilp32",
},
@ -594,7 +586,7 @@
"linux-mips64" => {
inherit_from => [ "linux-generic32", asm("mips64_asm") ],
cflags => "-mabi=n32 -Wall -DBN_DIV3W",
bn_ops => "SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR",
bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
perlasm_scheme => "n32",
shared_ldflag => "-mabi=n32",
multilib => "32",
@ -631,7 +623,7 @@
"linux-x86_64" => {
inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
cflags => "-m64 -DL_ENDIAN -Wall",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
shared_ldflag => "-m64",
multilib => "64",
@ -644,7 +636,7 @@
"linux-x32" => {
inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
cflags => "-mx32 -DL_ENDIAN -Wall",
bn_ops => "SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT",
perlasm_scheme => "elf",
shared_ldflag => "-mx32",
multilib => "x32",
@ -652,7 +644,7 @@
"linux-ia64" => {
inherit_from => [ "linux-generic64", asm("ia64_asm") ],
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT",
bn_ops => "SIXTY_FOUR_BIT_LONG",
},
"linux64-s390x" => {
@ -705,7 +697,7 @@
# GCC 3.1 is a requirement
inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
cflags => "-m64 -mcpu=ultrasparc -Wall -DB_ENDIAN",
bn_ops => "BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR",
bn_ops => "BN_LLONG RC4_CHAR",
shared_ldflag => "-m64",
multilib => "64",
},
@ -713,7 +705,7 @@
"linux-alpha-gcc" => {
inherit_from => [ "linux-generic64", asm("alpha_asm") ],
cflags => "-DL_ENDIAN",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
},
"linux-c64xplus" => {
# TI_CGT_C6000_7.3.x is a requirement
@ -832,7 +824,7 @@
debug_cflags => "-O0 -g",
release_cflags => "-O3",
thread_cflag => "-pthread -D_THREAD_SAFE -D_REENTRANT",
bn_ops => "BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL",
bn_ops => "BN_LLONG",
dso_scheme => "dlfcn",
shared_target => "bsd-gcc-shared",
shared_cflag => "-fPIC",
@ -840,7 +832,7 @@
},
"BSD-generic64" => {
inherit_from => [ "BSD-generic32" ],
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
},
"BSD-x86" => {
@ -866,19 +858,19 @@
# triggered by RIPEMD160 code.
inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
cflags => "-DB_ENDIAN -DMD32_REG_T=int -Wall",
bn_ops => "BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR",
bn_ops => "BN_LLONG",
},
"BSD-ia64" => {
inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
cflags => "-DL_ENDIAN -Wall",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT",
bn_ops => "SIXTY_FOUR_BIT_LONG",
},
"BSD-x86_64" => {
inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
cflags => "-DL_ENDIAN -Wall",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
},
@ -969,7 +961,7 @@
cflags => "-O -DFILIO_H -Kalloca",
thread_cflag => "-Kthread",
lflags => "-lsocket -lnsl",
bn_ops => "BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}",
bn_ops => "BN_LLONG ${x86_gcc_des}",
perlasm_scheme => "elf-1",
dso_scheme => "dlfcn",
shared_target => "svr5-shared",
@ -1092,7 +1084,7 @@
cflags => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
thread_cflag => "(unknown)",
lflags => "-lsocket -lnsl",
bn_ops => "THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR",
bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
},
# OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
@ -1103,7 +1095,7 @@
cc => "c89.sh",
cflags => "-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE",
thread_cflag => "(unknown)",
bn_ops => "THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR",
bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
},
#### Visual C targets
@ -1125,7 +1117,7 @@
inherit_from => [ "VC-common", asm("ia64_asm") ],
cflags => add(" ", "-DUNICODE -D_UNICODE"),
sys_id => "WIN64I",
bn_ops => "SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN",
bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
bn_obj => sub { my $r=join(" ",@_); $r=~s/bn\-//; $r; },
rc4_obj => "",
perlasm_scheme => "ias",
@ -1135,7 +1127,7 @@
inherit_from => [ "VC-common", asm("x86_64_asm") ],
cflags => add(" ", "-DUNICODE -D_UNICODE"),
sys_id => "WIN64A",
bn_ops => "SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN",
bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
bn_obj => sub { my $r=join(" ",@_); $r=~s/x86_64\-gcc/bn_asm/; $r; },
perlasm_scheme => "auto",
build_scheme => [ "mk1mf", "VC-W64" ],
@ -1145,14 +1137,14 @@
# configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
inherit_from => [ "VC-common", asm("x86_asm") ],
sys_id => "WIN32",
bn_ops => "BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}",
bn_ops => "BN_LLONG EXPORT_VAR_AS_FN ${x86_gcc_opts}",
perlasm_scheme => "win32n",
build_scheme => [ "mk1mf", "VC-W32" ],
},
"VC-CE" => {
cc => "cl",
sys_id => "WINCE",
bn_ops => "BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}",
bn_ops => "BN_LLONG EXPORT_VAR_AS_FN ${x86_gcc_opts}",
dso_scheme => "win32",
build_scheme => [ "mk1mf", "VC-WCE" ],
},
@ -1161,7 +1153,7 @@
"BC-32" => {
cc => "bcc32",
sys_id => "WIN32",
bn_ops => "BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN",
bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
dso_scheme => "win32",
build_scheme => [ "mk1mf", "BC" ],
},
@ -1201,7 +1193,7 @@
thread_cflag => "-D_MT",
sys_id => "MINGW64",
lflags => "-lws2_32 -lgdi32 -lcrypt32",
bn_ops => "SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN",
bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
perlasm_scheme => "mingw64",
dso_scheme => "win32",
shared_target => "cygwin-shared",
@ -1249,7 +1241,7 @@
debug_cflags => "-g -O0",
release_cflags => "-O3",
sys_id => "CYGWIN",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "mingw64",
dso_scheme => "dlfcn",
shared_target => "cygwin-shared",
@ -1358,7 +1350,7 @@
thread_cflag => "-D_REENTRANT",
sys_id => "MACOSX",
lflags => "-Wl,-search_paths_first%",
bn_ops => "BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR",
bn_ops => "BN_LLONG RC4_CHAR",
perlasm_scheme => "osx32",
dso_scheme => "dlfcn",
shared_target => "darwin-shared",
@ -1375,7 +1367,7 @@
"darwin64-ppc-cc" => {
inherit_from => [ "darwin-common", asm("ppc64_asm") ],
cflags => "-arch ppc64 -DB_ENDIAN",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "osx64",
shared_ldflag => "-arch ppc64 -dynamiclib",
},
@ -1383,14 +1375,14 @@
inherit_from => [ "darwin-common", asm("x86_asm") ],
cflags => "-arch i386 -DL_ENDIAN",
release_cflags => "-O3 -fomit-frame-pointer",
bn_ops => "BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR",
bn_ops => "BN_LLONG RC4_INT",
perlasm_scheme => "macosx",
shared_ldflag => "-arch i386 -dynamiclib",
},
"darwin64-x86_64-cc" => {
inherit_from => [ "darwin-common", asm("x86_64_asm") ],
cflags => "-arch x86_64 -DL_ENDIAN -Wall",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "macosx",
shared_ldflag => "-arch x86_64 -dynamiclib",
},
@ -1428,7 +1420,7 @@
inherit_from => [ "darwin-common", asm("aarch64_asm") ],
cflags => "-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common",
sys_id => "iOS",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "ios64",
},

View file

@ -24,7 +24,7 @@
cflags => "$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -m64 -DL_ENDIAN -DTERMIO -g",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
dso_scheme => "dlfcn",
shared_target => "linux-shared",
@ -99,7 +99,7 @@
cc => "clang",
cflags => "$gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=extended-offsetof -Wno-error=language-extension-token -Wno-error=unused-const-variable -Wstrict-overflow -Qunused-arguments -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe",
thread_cflag => "${BSDthreads}",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
dso_scheme => "dlfcn",
shared_target => "bsd-gcc-shared",
@ -112,7 +112,7 @@
cflags => "-arch x86_64 -DL_ENDIAN $gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=extended-offsetof -Wno-error=language-extension-token -Wno-error=unused-const-variable -Wstrict-overflow -Qunused-arguments -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe",
thread_cflag => "${BSDthreads}",
sys_id => "MACOSX",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "macosx",
dso_scheme => "dlfcn",
shared_target => "darwin-shared",

View file

@ -31,7 +31,7 @@
cc => "gcc",
cflags => "$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe",
thread_cflag => "${BSDthreads}",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
dso_scheme => "dlfcn",
shared_target => "bsd-gcc-shared",
@ -43,7 +43,7 @@
cc => "clang",
cflags => "$gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=extended-offsetof -Wno-error=language-extension-token -Wstrict-overflow -Qunused-arguments -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe",
thread_cflag => "${BSDthreads}",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
dso_scheme => "dlfcn",
shared_target => "bsd-gcc-shared",
@ -55,7 +55,7 @@
cc => "gcc",
cflags => "$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -pipe",
thread_cflag => "${BSDthreads}",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
dso_scheme => "dlfcn",
shared_target => "bsd-gcc-shared",
@ -84,7 +84,7 @@
thread_cflag => "-D_REENTRANT",
sys_id => "MACOSX",
lflags => "-Wl,-search_paths_first%",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "macosx",
dso_scheme => "dlfcn",
shared_target => "darwin-shared",

View file

@ -12,7 +12,7 @@
cflags => "$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
dso_scheme => "dlfcn",
shared_target => "linux-shared",

View file

@ -22,7 +22,7 @@
cflags => "-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
dso_scheme => "dlfcn",
shared_target => "linux-shared",
shared_cflag => "-fPIC",

View file

@ -13,7 +13,7 @@
debug_cflags => "-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -ggdb -g3",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl",
bn_ops => "BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT",
bn_ops => "BN_LLONG",
dso_scheme => "dlfcn",
shared_target => "linux-shared",
shared_cflag => "-fPIC",
@ -24,7 +24,7 @@
cflags => "-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -ggdb -g3 -Wall",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl",
bn_ops => "BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT",
bn_ops => "BN_LLONG",
dso_scheme => "dlfcn",
shared_target => "linux-shared",
shared_cflag => "-fPIC",
@ -36,7 +36,7 @@
cflags => "-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DENGINE_CONF_DEBUG -DL_ENDIAN -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl",
bn_ops => "BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT",
bn_ops => "BN_LLONG",
perlasm_scheme => "elf",
dso_scheme => "dlfcn",
shared_target => "linux-shared",
@ -48,7 +48,7 @@
cflags => "-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DPEDANTIC -ggdb -g3 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl",
bn_ops => "BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT",
bn_ops => "BN_LLONG",
perlasm_scheme => "void",
dso_scheme => "dlfcn",
shared_target => "linux-shared",

View file

@ -12,7 +12,7 @@
cflags => "$gcc_devteam_warn -pthread -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -g",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
dso_scheme => "dlfcn",
shared_target => "linux-shared",
@ -39,7 +39,7 @@
cflags => "$gcc_devteam_warn -pthread -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -g",
thread_cflag => "-D_REENTRANT",
lflags => "-ldl",
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL",
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "elf",
dso_scheme => "dlfcn",
shared_target => "linux-shared",

View file

@ -126,52 +126,13 @@ In each table entry, the following keys are significant:
source.
The valid words are:
DES_PTR use a pointer to DES_SPtrans
rather that DES_SPtrans
directly in D_ENCRYPT.
DES_RISC1 Alternate implementations of
DES_RISC2 D_ENCRYPT for certain RISC
processors.
DES_UNROLL do not loop around calls to
D_ENCRYPT.
DES_INT have unsigned int as the
integer type for DES rather
than unsigned long.
BN_LLONG use 'unsigned long long' in
some bignum calculations.
This has no value when
SIXTY_FOUR_BIT or
SIXTY_FOUR_BIT_LONG is given.
RC4_CHAR makes the basic RC4 unif of
RC4_CHAR makes the basic RC4 unit of
calculation an unsigned char.
RC4_LONG makes the basic RC4 unif of
calculation an unsigned long.
RC4_INDEX go through input and output
data by indexing into them
rather than incrementing the
pointer.
RC4_CHUNK sets the chunk type to
unsigned long.
RC4_CHUNK_LL sets the chunk type to
unsigned long long.
both these chunk sizes are for
handling data in chunks on
processors that do not have
byte load/store instructions.
MD2_CHAR makes the basic MD2 unit of
calculation an unsigned char.
MD2_LONG makes the basic MD2 unit of
calculation an unsigned long.
IDEA_SHORT makes the basic IDEA unit of
calculation an unsigned short.
IDEA_LONG makes the basic IDEA unit of
calculation an unsigned long.
RC2_SHORT makes the basic RC2 unit of
calculation an unsigned short.
RC2_LONG makes the basic RC2 unit of
calculation an unsigned long.
BF_PTR use different pointer based
BF_PTR2 versions of BF_ENC.
SIXTY_FOUR_BIT processor registers
are 64 bits, long is
32 bits, long long is

View file

@ -65,32 +65,8 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta
# DEBUG_SAFESTACK use type-safe stacks to enforce type-safety on stack items
# provided to stack calls. Generates unique stack functions for
# each possible stack type.
# DES_PTR use pointer lookup vs arrays in the DES in crypto/des/des_locl.h
# DES_RISC1 use different DES_ENCRYPT macro that helps reduce register
# dependancies but needs to more registers, good for RISC CPU's
# DES_RISC2 A different RISC variant.
# DES_UNROLL unroll the inner DES loop, sometimes helps, somtimes hinders.
# DES_INT use 'int' instead of 'long' for DES_LONG in crypto/des/des.h
# This is used on the DEC Alpha where long is 8 bytes
# and int is 4
# BN_LLONG use the type 'long long' in crypto/bn/bn.h
# MD2_CHAR use 'char' instead of 'int' for MD2_INT in crypto/md2/md2.h
# MD2_LONG use 'long' instead of 'int' for MD2_INT in crypto/md2/md2.h
# IDEA_SHORT use 'short' instead of 'int' for IDEA_INT in crypto/idea/idea.h
# IDEA_LONG use 'long' instead of 'int' for IDEA_INT in crypto/idea/idea.h
# RC2_SHORT use 'short' instead of 'int' for RC2_INT in crypto/rc2/rc2.h
# RC2_LONG use 'long' instead of 'int' for RC2_INT in crypto/rc2/rc2.h
# RC4_CHAR use 'char' instead of 'int' for RC4_INT in crypto/rc4/rc4.h
# RC4_LONG use 'long' instead of 'int' for RC4_INT in crypto/rc4/rc4.h
# RC4_INDEX define RC4_INDEX in crypto/rc4/rc4_locl.h. This turns on
# array lookups instead of pointer use.
# RC4_CHUNK enables code that handles data aligned at long (natural CPU
# word) boundary.
# RC4_CHUNK_LL enables code that handles data aligned at long long boundary
# (intended for 64-bit CPUs running 32-bit OS).
# BF_PTR use 'pointer arithmatic' for Blowfish (unsafe on Alpha).
# BF_PTR2 intel specific version (generic version is more efficient).
#
# Following are set automatically by this script
#
# MD5_ASM use some extra md5 assember,
@ -124,10 +100,8 @@ my $memleak_devteam_backtrace = "-rdynamic -DCRYPTO_MDEBUG_BACKTRACE";
my $strict_warnings = 0;
my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL";
# MD2_CHAR slags pentium pros
my $x86_gcc_opts="RC4_INDEX MD2_INT";
my $x86_gcc_des="";
my $x86_gcc_opts="";
# As for $BSDthreads. Idea is to maintain "collective" set of flags,
# which would cover all BSD flavors. -pthread applies to them all,
@ -1152,44 +1126,16 @@ $config{depflags} =~ s/^\s*//;
# Deal with bn_ops ###################################################
$config{des_ptr} =0;
$config{des_risc1} =0;
$config{des_risc2} =0;
$config{des_unroll} =0;
$config{bn_ll} =0;
$config{rc4_idx} =0;
$config{bf_ptr} =0;
$config{export_var_as_fn} =0;
my $def_int="unsigned int";
$config{rc4_int} =$def_int;
$config{rc4_chunk} ="";
$config{md2_int} =$def_int;
$config{idea_int} =$def_int;
$config{rc2_int} =$def_int;
($config{b64l},$config{b64},$config{b32},$config{b16},$config{b8})=(0,0,1,0,0);
$config{des_int} = "unsigned long";
foreach (sort split(/\s+/,$target{bn_ops})) {
$config{des_ptr}=1 if /DES_PTR/;
$config{des_risc1}=1 if /DES_RISC1/;
$config{des_risc2}=1 if /DES_RISC2/;
$config{des_unroll}=1 if /DES_UNROLL/;
$config{des_int}="unsigned int" if /DES_INT/;
$config{bn_ll}=1 if /BN_LLONG/;
$config{rc4_int}="unsigned char" if /RC4_CHAR/;
$config{rc4_int}="unsigned long" if /RC4_LONG/;
$config{rc4_idx}=1 if /RC4_INDEX/;
$config{rc4_chunk}="unsigned long" if /RC4_CHUNK/;
$config{rc4_chunk}="unsigned long long" if /RC4_CHUNK_LL/;
$config{md2_int}="unsigned char" if /MD2_CHAR/;
$config{md2_int}="unsigned long" if /MD2_LONG/;
$config{idea_int}="unsigned char" if /IDEA_CHAR/;
$config{idea_int}="unsigned long" if /IDEA_LONG/;
$config{rc2_int}="unsigned char" if /RC2_CHAR/;
$config{rc2_int}="unsigned long" if /RC2_LONG/;
$config{bf_ptr}=1 if $_ eq "BF_PTR";
$config{bf_ptr}=2 if $_ eq "BF_PTR2";
($config{b64l},$config{b64},$config{b32},$config{b16},$config{b8})
=(0,1,0,0,0) if /SIXTY_FOUR_BIT/;
($config{b64l},$config{b64},$config{b32},$config{b16},$config{b8})
@ -1351,27 +1297,15 @@ print "SIXTY_FOUR_BIT mode\n" if $config{b64};
print "THIRTY_TWO_BIT mode\n" if $config{b32};
print "SIXTEEN_BIT mode\n" if $config{b16};
print "EIGHT_BIT mode\n" if $config{b8};
print "DES_PTR used\n" if $config{des_ptr};
print "DES_RISC1 used\n" if $config{des_risc1};
print "DES_RISC2 used\n" if $config{des_risc2};
print "DES_UNROLL used\n" if $config{des_unroll};
print "DES_INT used\n" if $config{des_int} =~ / int$/;
print "BN_LLONG mode\n" if $config{bn_ll};
print "RC4 uses $config{rc4_int}\n" if $config{rc4_int} != $def_int;
print "RC4_INDEX mode\n" if $config{rc4_idx};
print "RC4_CHUNK is undefined\n" unless $config{rc4_chunk};
print "RC4_CHUNK is $config{rc4_chunk}\n" if $config{rc4_chunk};
print "MD2 uses $config{md2_int}\n" if $config{md2_int} != $def_int;
print "IDEA uses $config{idea_int}\n" if $config{idea_int} != $def_int;
print "RC2 uses $config{rc2_int}\n" if $config{rc2_int} != $def_int;
print "BF_PTR used\n" if $config{bf_ptr} == 1;
print "BF_PTR2 used\n" if $config{bf_ptr} == 2;
run_dofile("$Makefile.in","$Makefile");
run_dofile("include/openssl/opensslconf.h.in", "include/openssl/opensslconf.h");
foreach my $alg ( 'bf', 'bn', 'des', 'rc4' ) {
foreach my $alg ( 'bn' ) {
run_dofile("crypto/include/internal/${alg}_conf.h.in",
"crypto/include/internal/${alg}_conf.h");
}

View file

@ -336,7 +336,6 @@ certs = $dir.cacert.pem] # Certificate chain to include in reply
# (optional)
signer_key = $dir/private/tsakey.pem # The TSA private key (optional)
signer_digest = sha256 # Signing digest to use. (Optional)
default_policy = tsa_policy1 # Policy if request did not specify it
# (optional)
other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional)

View file

@ -67,13 +67,7 @@
const char *BF_options(void)
{
#ifdef BF_PTR
return ("blowfish(ptr)");
#elif defined(BF_PTR2)
return ("blowfish(ptr2)");
#else
return ("blowfish(idx)");
#endif
}
void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,

View file

@ -71,7 +71,6 @@ to modify the code.
void BF_encrypt(BF_LONG *data, const BF_KEY *key)
{
#ifndef BF_PTR2
register BF_LONG l, r;
register const BF_LONG *p, *s;
@ -105,50 +104,14 @@ void BF_encrypt(BF_LONG *data, const BF_KEY *key)
# endif
r ^= p[BF_ROUNDS + 1];
data[1] = l & 0xffffffffL;
data[0] = r & 0xffffffffL;
#else
register BF_LONG l, r, t, *k;
l = data[0];
r = data[1];
k = (BF_LONG *)key;
l ^= k[0];
BF_ENC(r, l, k, 1);
BF_ENC(l, r, k, 2);
BF_ENC(r, l, k, 3);
BF_ENC(l, r, k, 4);
BF_ENC(r, l, k, 5);
BF_ENC(l, r, k, 6);
BF_ENC(r, l, k, 7);
BF_ENC(l, r, k, 8);
BF_ENC(r, l, k, 9);
BF_ENC(l, r, k, 10);
BF_ENC(r, l, k, 11);
BF_ENC(l, r, k, 12);
BF_ENC(r, l, k, 13);
BF_ENC(l, r, k, 14);
BF_ENC(r, l, k, 15);
BF_ENC(l, r, k, 16);
# if BF_ROUNDS == 20
BF_ENC(r, l, k, 17);
BF_ENC(l, r, k, 18);
BF_ENC(r, l, k, 19);
BF_ENC(l, r, k, 20);
# endif
r ^= k[BF_ROUNDS + 1];
data[1] = l & 0xffffffffL;
data[0] = r & 0xffffffffL;
#endif
data[1] = l & 0xffffffffU;
data[0] = r & 0xffffffffU;
}
#ifndef BF_DEFAULT_OPTIONS
void BF_decrypt(BF_LONG *data, const BF_KEY *key)
{
# ifndef BF_PTR2
register BF_LONG l, r;
register const BF_LONG *p, *s;
@ -182,43 +145,8 @@ void BF_decrypt(BF_LONG *data, const BF_KEY *key)
BF_ENC(l, r, s, p[1]);
r ^= p[0];
data[1] = l & 0xffffffffL;
data[0] = r & 0xffffffffL;
# else
register BF_LONG l, r, t, *k;
l = data[0];
r = data[1];
k = (BF_LONG *)key;
l ^= k[BF_ROUNDS + 1];
# if BF_ROUNDS == 20
BF_ENC(r, l, k, 20);
BF_ENC(l, r, k, 19);
BF_ENC(r, l, k, 18);
BF_ENC(l, r, k, 17);
# endif
BF_ENC(r, l, k, 16);
BF_ENC(l, r, k, 15);
BF_ENC(r, l, k, 14);
BF_ENC(l, r, k, 13);
BF_ENC(r, l, k, 12);
BF_ENC(l, r, k, 11);
BF_ENC(r, l, k, 10);
BF_ENC(l, r, k, 9);
BF_ENC(r, l, k, 8);
BF_ENC(l, r, k, 7);
BF_ENC(r, l, k, 6);
BF_ENC(l, r, k, 5);
BF_ENC(r, l, k, 4);
BF_ENC(l, r, k, 3);
BF_ENC(r, l, k, 2);
BF_ENC(l, r, k, 1);
r ^= k[0];
data[1] = l & 0xffffffffL;
data[0] = r & 0xffffffffL;
# endif
data[1] = l & 0xffffffffU;
data[0] = r & 0xffffffffU;
}
void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,

View file

@ -58,52 +58,6 @@
#ifndef HEADER_BF_LOCL_H
# define HEADER_BF_LOCL_H
# include <openssl/opensslconf.h>
# include "internal/bf_conf.h"
# undef c2l
# define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
l|=((unsigned long)(*((c)++)))<< 8L, \
l|=((unsigned long)(*((c)++)))<<16L, \
l|=((unsigned long)(*((c)++)))<<24L)
/* NOTE - c is not incremented as per c2l */
# undef c2ln
# define c2ln(c,l1,l2,n) { \
c+=n; \
l1=l2=0; \
switch (n) { \
case 8: l2 =((unsigned long)(*(--(c))))<<24L; \
case 7: l2|=((unsigned long)(*(--(c))))<<16L; \
case 6: l2|=((unsigned long)(*(--(c))))<< 8L; \
case 5: l2|=((unsigned long)(*(--(c)))); \
case 4: l1 =((unsigned long)(*(--(c))))<<24L; \
case 3: l1|=((unsigned long)(*(--(c))))<<16L; \
case 2: l1|=((unsigned long)(*(--(c))))<< 8L; \
case 1: l1|=((unsigned long)(*(--(c)))); \
} \
}
# undef l2c
# define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
*((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
*((c)++)=(unsigned char)(((l)>>16L)&0xff), \
*((c)++)=(unsigned char)(((l)>>24L)&0xff))
/* NOTE - c is not incremented as per l2c */
# undef l2cn
# define l2cn(l1,l2,c,n) { \
c+=n; \
switch (n) { \
case 8: *(--(c))=(unsigned char)(((l2)>>24L)&0xff); \
case 7: *(--(c))=(unsigned char)(((l2)>>16L)&0xff); \
case 6: *(--(c))=(unsigned char)(((l2)>> 8L)&0xff); \
case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \
case 4: *(--(c))=(unsigned char)(((l1)>>24L)&0xff); \
case 3: *(--(c))=(unsigned char)(((l1)>>16L)&0xff); \
case 2: *(--(c))=(unsigned char)(((l1)>> 8L)&0xff); \
case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \
} \
}
/* NOTE - c is not incremented as per n2l */
# define n2ln(c,l1,l2,n) { \
@ -153,69 +107,12 @@
* to lookup array 0
*/
# if defined(BF_PTR2)
/*
* This is basically a special Intel version. Point is that Intel
* doesn't have many registers, but offers a reach choice of addressing
* modes. So we spare some registers by directly traversing BF_KEY
* structure and hiring the most decorated addressing mode. The code
* generated by EGCS is *perfectly* competitive with assembler
* implementation!
*/
# define BF_ENC(LL,R,KEY,Pi) (\
LL^=KEY[Pi], \
t= KEY[BF_ROUNDS+2 + 0 + ((R>>24)&0xFF)], \
t+= KEY[BF_ROUNDS+2 + 256 + ((R>>16)&0xFF)], \
t^= KEY[BF_ROUNDS+2 + 512 + ((R>>8 )&0xFF)], \
t+= KEY[BF_ROUNDS+2 + 768 + ((R )&0xFF)], \
LL^=t \
)
# elif defined(BF_PTR)
# ifndef BF_LONG_LOG2
# define BF_LONG_LOG2 2 /* default to BF_LONG being 32 bits */
# endif
# define BF_M (0xFF<<BF_LONG_LOG2)
# define BF_0 (24-BF_LONG_LOG2)
# define BF_1 (16-BF_LONG_LOG2)
# define BF_2 ( 8-BF_LONG_LOG2)
# define BF_3 BF_LONG_LOG2 /* left shift */
/*
* This is normally very good on RISC platforms where normally you
* have to explicitly "multiply" array index by sizeof(BF_LONG)
* in order to calculate the effective address. This implementation
* excuses CPU from this extra work. Power[PC] uses should have most
* fun as (R>>BF_i)&BF_M gets folded into a single instruction, namely
* rlwinm. So let'em double-check if their compiler does it.
*/
# define BF_ENC(LL,R,S,P) ( \
LL^=P, \
LL^= (((*(BF_LONG *)((unsigned char *)&(S[ 0])+((R>>BF_0)&BF_M))+ \
*(BF_LONG *)((unsigned char *)&(S[256])+((R>>BF_1)&BF_M)))^ \
*(BF_LONG *)((unsigned char *)&(S[512])+((R>>BF_2)&BF_M)))+ \
*(BF_LONG *)((unsigned char *)&(S[768])+((R<<BF_3)&BF_M))) \
LL^=((( S[ ((R>>24)&0xff)] + \
S[0x0100+((R>>16)&0xff)])^ \
S[0x0200+((R>> 8)&0xff)])+ \
S[0x0300+((R )&0xff)])&0xffffffffU \
)
# else
/*
* This is a *generic* version. Seem to perform best on platforms that
* offer explicit support for extraction of 8-bit nibbles preferably
* complemented with "multiplying" of array index by sizeof(BF_LONG).
* For the moment of this writing the list comprises Alpha CPU featuring
* extbl and s[48]addq instructions.
*/
# define BF_ENC(LL,R,S,P) ( \
LL^=P, \
LL^=((( S[ ((int)(R>>24)&0xff)] + \
S[0x0100+((int)(R>>16)&0xff)])^ \
S[0x0200+((int)(R>> 8)&0xff)])+ \
S[0x0300+((int)(R )&0xff)])&0xffffffffL \
)
# endif
#endif

View file

@ -62,12 +62,6 @@
void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
{
register DES_LONG l, r, t, u;
#ifdef DES_PTR
register const unsigned char *des_SP = (const unsigned char *)DES_SPtrans;
#endif
#ifndef DES_UNROLL
register int i;
#endif
register DES_LONG *s;
r = data[0];
@ -92,7 +86,6 @@ void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
* loop
*/
if (enc) {
#ifdef DES_UNROLL
D_ENCRYPT(l, r, 0); /* 1 */
D_ENCRYPT(r, l, 2); /* 2 */
D_ENCRYPT(l, r, 4); /* 3 */
@ -109,14 +102,7 @@ void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
D_ENCRYPT(r, l, 26); /* 14 */
D_ENCRYPT(l, r, 28); /* 15 */
D_ENCRYPT(r, l, 30); /* 16 */
#else
for (i = 0; i < 32; i += 4) {
D_ENCRYPT(l, r, i + 0); /* 1 */
D_ENCRYPT(r, l, i + 2); /* 2 */
}
#endif
} else {
#ifdef DES_UNROLL
D_ENCRYPT(l, r, 30); /* 16 */
D_ENCRYPT(r, l, 28); /* 15 */
D_ENCRYPT(l, r, 26); /* 14 */
@ -133,12 +119,6 @@ void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
D_ENCRYPT(r, l, 4); /* 3 */
D_ENCRYPT(l, r, 2); /* 2 */
D_ENCRYPT(r, l, 0); /* 1 */
#else
for (i = 30; i > 0; i -= 4) {
D_ENCRYPT(l, r, i - 0); /* 16 */
D_ENCRYPT(r, l, i - 2); /* 15 */
}
#endif
}
/* rotate and clear the top bits on machines with 8byte longs */
@ -154,12 +134,6 @@ void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
{
register DES_LONG l, r, t, u;
#ifdef DES_PTR
register const unsigned char *des_SP = (const unsigned char *)DES_SPtrans;
#endif
#ifndef DES_UNROLL
register int i;
#endif
register DES_LONG *s;
r = data[0];
@ -182,7 +156,6 @@ void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
* loop
*/
if (enc) {
#ifdef DES_UNROLL
D_ENCRYPT(l, r, 0); /* 1 */
D_ENCRYPT(r, l, 2); /* 2 */
D_ENCRYPT(l, r, 4); /* 3 */
@ -199,14 +172,7 @@ void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
D_ENCRYPT(r, l, 26); /* 14 */
D_ENCRYPT(l, r, 28); /* 15 */
D_ENCRYPT(r, l, 30); /* 16 */
#else
for (i = 0; i < 32; i += 4) {
D_ENCRYPT(l, r, i + 0); /* 1 */
D_ENCRYPT(r, l, i + 2); /* 2 */
}
#endif
} else {
#ifdef DES_UNROLL
D_ENCRYPT(l, r, 30); /* 16 */
D_ENCRYPT(r, l, 28); /* 15 */
D_ENCRYPT(l, r, 26); /* 14 */
@ -223,12 +189,6 @@ void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
D_ENCRYPT(r, l, 4); /* 3 */
D_ENCRYPT(l, r, 2); /* 2 */
D_ENCRYPT(r, l, 0); /* 1 */
#else
for (i = 30; i > 0; i -= 4) {
D_ENCRYPT(l, r, i - 0); /* 16 */
D_ENCRYPT(r, l, i - 2); /* 15 */
}
#endif
}
/* rotate and clear the top bits on machines with 8byte longs */
data[0] = ROTATE(l, 3) & 0xffffffffL;

View file

@ -60,8 +60,6 @@
# include <openssl/e_os2.h>
# include "internal/des_conf.h"
# if defined(OPENSSL_SYS_WIN32)
# ifndef OPENSSL_SYS_MSDOS
# define OPENSSL_SYS_MSDOS
@ -204,158 +202,12 @@
t=R^s[S+1]
# endif
/*
* The changes to this macro may help or hinder, depending on the compiler
* and the architecture. gcc2 always seems to do well :-). Inspired by Dana
* How <how@isl.stanford.edu> DO NOT use the alternative version on machines
* with 8 byte longs. It does not seem to work on the Alpha, even when
* DES_LONG is 4 bytes, probably an issue of accessing non-word aligned
* objects :-(
*/
# ifdef DES_PTR
/*
* It recently occurred to me that 0^0^0^0^0^0^0 == 0, so there is no reason
* to not xor all the sub items together. This potentially saves a register
* since things can be xored directly into L
*/
# if defined(DES_RISC1) || defined(DES_RISC2)
# ifdef DES_RISC1
# define D_ENCRYPT(LL,R,S) { \
unsigned int u1,u2,u3; \
LOAD_DATA(R,S,u,t,E0,E1,u1); \
u2=(int)u>>8L; \
u1=(int)u&0xfc; \
u2&=0xfc; \
t=ROTATE(t,4); \
u>>=16L; \
LL^= *(const DES_LONG *)(des_SP +u1); \
LL^= *(const DES_LONG *)(des_SP+0x200+u2); \
u3=(int)(u>>8L); \
u1=(int)u&0xfc; \
u3&=0xfc; \
LL^= *(const DES_LONG *)(des_SP+0x400+u1); \
LL^= *(const DES_LONG *)(des_SP+0x600+u3); \
u2=(int)t>>8L; \
u1=(int)t&0xfc; \
u2&=0xfc; \
t>>=16L; \
LL^= *(const DES_LONG *)(des_SP+0x100+u1); \
LL^= *(const DES_LONG *)(des_SP+0x300+u2); \
u3=(int)t>>8L; \
u1=(int)t&0xfc; \
u3&=0xfc; \
LL^= *(const DES_LONG *)(des_SP+0x500+u1); \
LL^= *(const DES_LONG *)(des_SP+0x700+u3); }
# endif
# ifdef DES_RISC2
# define D_ENCRYPT(LL,R,S) { \
unsigned int u1,u2,s1,s2; \
LOAD_DATA(R,S,u,t,E0,E1,u1); \
u2=(int)u>>8L; \
u1=(int)u&0xfc; \
u2&=0xfc; \
t=ROTATE(t,4); \
LL^= *(const DES_LONG *)(des_SP +u1); \
LL^= *(const DES_LONG *)(des_SP+0x200+u2); \
s1=(int)(u>>16L); \
s2=(int)(u>>24L); \
s1&=0xfc; \
s2&=0xfc; \
LL^= *(const DES_LONG *)(des_SP+0x400+s1); \
LL^= *(const DES_LONG *)(des_SP+0x600+s2); \
u2=(int)t>>8L; \
u1=(int)t&0xfc; \
u2&=0xfc; \
LL^= *(const DES_LONG *)(des_SP+0x100+u1); \
LL^= *(const DES_LONG *)(des_SP+0x300+u2); \
s1=(int)(t>>16L); \
s2=(int)(t>>24L); \
s1&=0xfc; \
s2&=0xfc; \
LL^= *(const DES_LONG *)(des_SP+0x500+s1); \
LL^= *(const DES_LONG *)(des_SP+0x700+s2); }
# endif
# else
# define D_ENCRYPT(LL,R,S) { \
LOAD_DATA_tmp(R,S,u,t,E0,E1); \
t=ROTATE(t,4); \
LL^= \
*(const DES_LONG *)(des_SP +((u )&0xfc))^ \
*(const DES_LONG *)(des_SP+0x200+((u>> 8L)&0xfc))^ \
*(const DES_LONG *)(des_SP+0x400+((u>>16L)&0xfc))^ \
*(const DES_LONG *)(des_SP+0x600+((u>>24L)&0xfc))^ \
*(const DES_LONG *)(des_SP+0x100+((t )&0xfc))^ \
*(const DES_LONG *)(des_SP+0x300+((t>> 8L)&0xfc))^ \
*(const DES_LONG *)(des_SP+0x500+((t>>16L)&0xfc))^ \
*(const DES_LONG *)(des_SP+0x700+((t>>24L)&0xfc)); }
# endif
# else /* original version */
# if defined(DES_RISC1) || defined(DES_RISC2)
# ifdef DES_RISC1
# define D_ENCRYPT(LL,R,S) {\
unsigned int u1,u2,u3; \
LOAD_DATA(R,S,u,t,E0,E1,u1); \
u>>=2L; \
t=ROTATE(t,6); \
u2=(int)u>>8L; \
u1=(int)u&0x3f; \
u2&=0x3f; \
u>>=16L; \
LL^=DES_SPtrans[0][u1]; \
LL^=DES_SPtrans[2][u2]; \
u3=(int)u>>8L; \
u1=(int)u&0x3f; \
u3&=0x3f; \
LL^=DES_SPtrans[4][u1]; \
LL^=DES_SPtrans[6][u3]; \
u2=(int)t>>8L; \
u1=(int)t&0x3f; \
u2&=0x3f; \
t>>=16L; \
LL^=DES_SPtrans[1][u1]; \
LL^=DES_SPtrans[3][u2]; \
u3=(int)t>>8L; \
u1=(int)t&0x3f; \
u3&=0x3f; \
LL^=DES_SPtrans[5][u1]; \
LL^=DES_SPtrans[7][u3]; }
# endif
# ifdef DES_RISC2
# define D_ENCRYPT(LL,R,S) {\
unsigned int u1,u2,s1,s2; \
LOAD_DATA(R,S,u,t,E0,E1,u1); \
u>>=2L; \
t=ROTATE(t,6); \
u2=(int)u>>8L; \
u1=(int)u&0x3f; \
u2&=0x3f; \
LL^=DES_SPtrans[0][u1]; \
LL^=DES_SPtrans[2][u2]; \
s1=(int)u>>16L; \
s2=(int)u>>24L; \
s1&=0x3f; \
s2&=0x3f; \
LL^=DES_SPtrans[4][s1]; \
LL^=DES_SPtrans[6][s2]; \
u2=(int)t>>8L; \
u1=(int)t&0x3f; \
u2&=0x3f; \
LL^=DES_SPtrans[1][u1]; \
LL^=DES_SPtrans[3][u2]; \
s1=(int)t>>16; \
s2=(int)t>>24L; \
s1&=0x3f; \
s2&=0x3f; \
LL^=DES_SPtrans[5][s1]; \
LL^=DES_SPtrans[7][s2]; }
# endif
# else
# define D_ENCRYPT(LL,R,S) { \
LOAD_DATA_tmp(R,S,u,t,E0,E1); \
t=ROTATE(t,4); \
@ -368,8 +220,6 @@
DES_SPtrans[3][(t>>10L)&0x3f]^ \
DES_SPtrans[5][(t>>18L)&0x3f]^ \
DES_SPtrans[7][(t>>26L)&0x3f]; }
# endif
# endif
/*-
* IP and FP
@ -438,7 +288,4 @@ extern const DES_LONG DES_SPtrans[8][64];
void fcrypt_body(DES_LONG *out, DES_key_schedule *ks,
DES_LONG Eswap0, DES_LONG Eswap1);
# ifdef OPENSSL_SMALL_FOOTPRINT
# undef DES_UNROLL
# endif
#endif

View file

@ -66,34 +66,13 @@ const char *DES_options(void)
static char buf[32];
if (init) {
const char *ptr, *unroll, *risc, *size;
const char *size;
#ifdef DES_PTR
ptr = "ptr";
#else
ptr = "idx";
#endif
#if defined(DES_RISC1) || defined(DES_RISC2)
# ifdef DES_RISC1
risc = "risc1";
# endif
# ifdef DES_RISC2
risc = "risc2";
# endif
#else
risc = "cisc";
#endif
#ifdef DES_UNROLL
unroll = "16";
#else
unroll = "2";
#endif
if (sizeof(DES_LONG) != sizeof(long))
size = "int";
else
size = "long";
BIO_snprintf(buf, sizeof buf, "des(%s,%s,%s,%s)", ptr, risc, unroll,
size);
BIO_snprintf(buf, sizeof buf, "des(%s)", size);
init = 0;
}
return (buf);

View file

@ -80,9 +80,6 @@ void fcrypt_body(DES_LONG *out, DES_key_schedule *ks, DES_LONG Eswap0,
DES_LONG Eswap1)
{
register DES_LONG l, r, t, u;
#ifdef DES_PTR
register const unsigned char *des_SP = (const unsigned char *)DES_SPtrans;
#endif
register DES_LONG *s;
register int j;
register DES_LONG E0, E1;
@ -95,14 +92,6 @@ void fcrypt_body(DES_LONG *out, DES_key_schedule *ks, DES_LONG Eswap0,
E1 = Eswap1;
for (j = 0; j < 25; j++) {
#ifndef DES_UNROLL
register int i;
for (i = 0; i < 32; i += 4) {
D_ENCRYPT(l, r, i + 0); /* 1 */
D_ENCRYPT(r, l, i + 2); /* 2 */
}
#else
D_ENCRYPT(l, r, 0); /* 1 */
D_ENCRYPT(r, l, 2); /* 2 */
D_ENCRYPT(l, r, 4); /* 3 */
@ -119,8 +108,6 @@ void fcrypt_body(DES_LONG *out, DES_key_schedule *ks, DES_LONG Eswap0,
D_ENCRYPT(r, l, 26); /* 14 */
D_ENCRYPT(l, r, 28); /* 15 */
D_ENCRYPT(r, l, 30); /* 16 */
#endif
t = l;
l = r;
r = t;

View file

@ -61,10 +61,7 @@
const char *idea_options(void)
{
if (sizeof(short) != sizeof(IDEA_INT))
return ("idea(int)");
else
return ("idea(short)");
}
void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,

View file

@ -1,69 +0,0 @@
{- join("\n",map { "/* $_ */" } @autowarntext) -}
/* ====================================================================
* Copyright (c) 2016 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#ifndef HEADER_BF_CONF_H
# define HEADER_BF_CONF_H
{-
if ($config{bf_ptr} == 0) {
"#undef BF_PTR";
} elsif ($config{bf_ptr} == 1) {
"#define BF_PTR";
} elsif ($config{bf_ptr} == 2) {
"#define BF_PTR2";
}
-}
#endif

View file

@ -1,130 +0,0 @@
{- join("\n",map { "/* $_ */" } @autowarntext) -}
/* ====================================================================
* Copyright (c) 2016 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#ifndef HEADER_DES_CONF_H
# define HEADER_DES_CONF_H
/* the following is tweaked from a config script, that is why it is a
* protected undef/define */
# ifndef DES_PTR
{- $config{des_ptr} ? "#define" : "#undef" -} DES_PTR
# endif
/* This helps C compiler generate the correct code for multiple functional
* units. It reduces register dependancies at the expense of 2 more
* registers */
# ifndef DES_RISC1
{- $config{des_risc1} ? "#define" : "#undef" -} DES_RISC1
# endif
# ifndef DES_RISC2
{- $config{des_risc2} ? "#define" : "#undef" -} DES_RISC2
# endif
# if defined(DES_RISC1) && defined(DES_RISC2)
# error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
# endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
* Very mucy CPU dependant */
# ifndef DES_UNROLL
{- $config{des_unroll} ? "#define" : "#undef" -} DES_UNROLL
# endif
/*
* These default values were supplied by
* Peter Gutman <pgut001@cs.auckland.ac.nz>
* They are only used if nothing else has been defined
*/
# if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)
/*
* Special defines which change the way the code is built depending on the
* CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find
* even newer MIPS CPU's, but at the moment one size fits all for
* optimization options. Older Sparc's work better with only UNROLL, but
* there's no way to tell at compile time what it is you're running on.
*/
# if defined(sparc) || defined(__sparc__) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
# elif defined( __ultrix ) /* Older MIPS */
# define DES_PTR
# define DES_RISC2
# define DES_UNROLL
# elif defined( __osf1__ ) /* Alpha */
# define DES_PTR
# define DES_RISC2
# elif defined ( _AIX ) /* RS6000 */
/* Unknown */
# elif defined( __hpux ) /* HP-PA */
/* Unknown */
# elif defined( __aux ) /* 68K */
/* Unknown */
# elif defined( __sgi ) /* Newer MIPS */
# define DES_PTR
# define DES_RISC2
# define DES_UNROLL
# elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
# endif
# endif
#endif

View file

@ -1,75 +0,0 @@
{- join("\n",map { "/* $_ */" } @autowarntext) -}
/* ====================================================================
* Copyright (c) 2016 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#ifndef HEADER_RC4_CONF_H
# define HEADER_RC4_CONF_H
# if !defined(RC4_CHUNK)
/*
* This enables code handling data aligned at natural CPU word
* boundary. See crypto/rc4/rc4_enc.c for further details.
*/
{-
$config{rc4_chunk}
? "#define RC4_CHUNK ".$config{rc4_chunk}
: "#undef RC4_CHUNK";
-}
# endif
/* if this is defined data[i] is used instead of *data, this is a %20
* speedup on x86 */
{- $config{rc4_idx} ? "#define" : "#undef" -} RC4_INDEX
#endif

View file

@ -78,197 +78,6 @@ void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
y = key->y;
d = key->data;
#if defined(RC4_CHUNK) && !defined(PEDANTIC)
/*-
* The original reason for implementing this(*) was the fact that
* pre-21164a Alpha CPUs don't have byte load/store instructions
* and e.g. a byte store has to be done with 64-bit load, shift,
* and, or and finally 64-bit store. Peaking data and operating
* at natural word size made it possible to reduce amount of
* instructions as well as to perform early read-ahead without
* suffering from RAW (read-after-write) hazard. This resulted
* in ~40%(**) performance improvement on 21064 box with gcc.
* But it's not only Alpha users who win here:-) Thanks to the
* early-n-wide read-ahead this implementation also exhibits
* >40% speed-up on SPARC and 20-30% on 64-bit MIPS (depending
* on sizeof(RC4_INT)).
*
* (*) "this" means code which recognizes the case when input
* and output pointers appear to be aligned at natural CPU
* word boundary
* (**) i.e. according to 'apps/openssl speed rc4' benchmark,
* crypto/rc4/rc4speed.c exhibits almost 70% speed-up...
*
* Cavets.
*
* - RC4_CHUNK="unsigned long long" should be a #1 choice for
* UltraSPARC. Unfortunately gcc generates very slow code
* (2.5-3 times slower than one generated by Sun's WorkShop
* C) and therefore gcc (at least 2.95 and earlier) should
* always be told that RC4_CHUNK="unsigned long".
*
* <appro@fy.chalmers.se>
*/
# define RC4_STEP ( \
x=(x+1) &0xff, \
tx=d[x], \
y=(tx+y)&0xff, \
ty=d[y], \
d[y]=tx, \
d[x]=ty, \
(RC4_CHUNK)d[(tx+ty)&0xff]\
)
if ((((size_t)indata & (sizeof(RC4_CHUNK) - 1)) |
((size_t)outdata & (sizeof(RC4_CHUNK) - 1))) == 0) {
RC4_CHUNK ichunk, otp;
const union {
long one;
char little;
} is_endian = {
1
};
/*-
* I reckon we can afford to implement both endian
* cases and to decide which way to take at run-time
* because the machine code appears to be very compact
* and redundant 1-2KB is perfectly tolerable (i.e.
* in case the compiler fails to eliminate it:-). By
* suggestion from Terrel Larson <terr@terralogic.net>
* who also stands for the is_endian union:-)
*
* Special notes.
*
* - is_endian is declared automatic as doing otherwise
* (declaring static) prevents gcc from eliminating
* the redundant code;
* - compilers (those I've tried) don't seem to have
* problems eliminating either the operators guarded
* by "if (sizeof(RC4_CHUNK)==8)" or the condition
* expressions themselves so I've got 'em to replace
* corresponding #ifdefs from the previous version;
* - I chose to let the redundant switch cases when
* sizeof(RC4_CHUNK)!=8 be (were also #ifdefed
* before);
* - in case you wonder "&(sizeof(RC4_CHUNK)*8-1)" in
* [LB]ESHFT guards against "shift is out of range"
* warnings when sizeof(RC4_CHUNK)!=8
*
* <appro@fy.chalmers.se>
*/
if (!is_endian.little) { /* BIG-ENDIAN CASE */
# define BESHFT(c) (((sizeof(RC4_CHUNK)-(c)-1)*8)&(sizeof(RC4_CHUNK)*8-1))
for (; len & (0 - sizeof(RC4_CHUNK)); len -= sizeof(RC4_CHUNK)) {
ichunk = *(RC4_CHUNK *) indata;
otp = RC4_STEP << BESHFT(0);
otp |= RC4_STEP << BESHFT(1);
otp |= RC4_STEP << BESHFT(2);
otp |= RC4_STEP << BESHFT(3);
if (sizeof(RC4_CHUNK) == 8) {
otp |= RC4_STEP << BESHFT(4);
otp |= RC4_STEP << BESHFT(5);
otp |= RC4_STEP << BESHFT(6);
otp |= RC4_STEP << BESHFT(7);
}
*(RC4_CHUNK *) outdata = otp ^ ichunk;
indata += sizeof(RC4_CHUNK);
outdata += sizeof(RC4_CHUNK);
}
if (len) {
RC4_CHUNK mask = (RC4_CHUNK) - 1, ochunk;
ichunk = *(RC4_CHUNK *) indata;
ochunk = *(RC4_CHUNK *) outdata;
otp = 0;
i = BESHFT(0);
mask <<= (sizeof(RC4_CHUNK) - len) << 3;
switch (len & (sizeof(RC4_CHUNK) - 1)) {
case 7:
otp = RC4_STEP << i, i -= 8;
case 6:
otp |= RC4_STEP << i, i -= 8;
case 5:
otp |= RC4_STEP << i, i -= 8;
case 4:
otp |= RC4_STEP << i, i -= 8;
case 3:
otp |= RC4_STEP << i, i -= 8;
case 2:
otp |= RC4_STEP << i, i -= 8;
case 1:
otp |= RC4_STEP << i, i -= 8;
case 0:; /*
* it's never the case,
* but it has to be here
* for ultrix?
*/
}
ochunk &= ~mask;
ochunk |= (otp ^ ichunk) & mask;
*(RC4_CHUNK *) outdata = ochunk;
}
key->x = x;
key->y = y;
return;
} else { /* LITTLE-ENDIAN CASE */
# define LESHFT(c) (((c)*8)&(sizeof(RC4_CHUNK)*8-1))
for (; len & (0 - sizeof(RC4_CHUNK)); len -= sizeof(RC4_CHUNK)) {
ichunk = *(RC4_CHUNK *) indata;
otp = RC4_STEP;
otp |= RC4_STEP << 8;
otp |= RC4_STEP << 16;
otp |= RC4_STEP << 24;
if (sizeof(RC4_CHUNK) == 8) {
otp |= RC4_STEP << LESHFT(4);
otp |= RC4_STEP << LESHFT(5);
otp |= RC4_STEP << LESHFT(6);
otp |= RC4_STEP << LESHFT(7);
}
*(RC4_CHUNK *) outdata = otp ^ ichunk;
indata += sizeof(RC4_CHUNK);
outdata += sizeof(RC4_CHUNK);
}
if (len) {
RC4_CHUNK mask = (RC4_CHUNK) - 1, ochunk;
ichunk = *(RC4_CHUNK *) indata;
ochunk = *(RC4_CHUNK *) outdata;
otp = 0;
i = 0;
mask >>= (sizeof(RC4_CHUNK) - len) << 3;
switch (len & (sizeof(RC4_CHUNK) - 1)) {
case 7:
otp = RC4_STEP, i += 8;
case 6:
otp |= RC4_STEP << i, i += 8;
case 5:
otp |= RC4_STEP << i, i += 8;
case 4:
otp |= RC4_STEP << i, i += 8;
case 3:
otp |= RC4_STEP << i, i += 8;
case 2:
otp |= RC4_STEP << i, i += 8;
case 1:
otp |= RC4_STEP << i, i += 8;
case 0:; /*
* it's never the case,
* but it has to be here
* for ultrix?
*/
}
ochunk &= ~mask;
ochunk |= (otp ^ ichunk) & mask;
*(RC4_CHUNK *) outdata = ochunk;
}
key->x = x;
key->y = y;
return;
}
}
#endif
#define LOOP(in,out) \
x=((x+1)&0xff); \
tx=d[x]; \
@ -277,27 +86,19 @@ void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
d[y]=tx; \
(out) = d[(tx+ty)&0xff]^ (in);
#ifndef RC4_INDEX
# define RC4_LOOP(a,b,i) LOOP(*((a)++),*((b)++))
#else
# define RC4_LOOP(a,b,i) LOOP(a[i],b[i])
#endif
i = len >> 3;
if (i) {
for (;;) {
RC4_LOOP(indata, outdata, 0);
RC4_LOOP(indata, outdata, 1);
RC4_LOOP(indata, outdata, 2);
RC4_LOOP(indata, outdata, 3);
RC4_LOOP(indata, outdata, 4);
RC4_LOOP(indata, outdata, 5);
RC4_LOOP(indata, outdata, 6);
RC4_LOOP(indata, outdata, 7);
#ifdef RC4_INDEX
LOOP(indata[0], outdata[0]);
LOOP(indata[1], outdata[1]);
LOOP(indata[2], outdata[2]);
LOOP(indata[3], outdata[3]);
LOOP(indata[4], outdata[4]);
LOOP(indata[5], outdata[5]);
LOOP(indata[6], outdata[6]);
LOOP(indata[7], outdata[7]);
indata += 8;
outdata += 8;
#endif
if (--i == 0)
break;
}
@ -305,25 +106,25 @@ void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
i = len & 0x07;
if (i) {
for (;;) {
RC4_LOOP(indata, outdata, 0);
LOOP(indata[0], outdata[0]);
if (--i == 0)
break;
RC4_LOOP(indata, outdata, 1);
LOOP(indata[1], outdata[1]);
if (--i == 0)
break;
RC4_LOOP(indata, outdata, 2);
LOOP(indata[2], outdata[2]);
if (--i == 0)
break;
RC4_LOOP(indata, outdata, 3);
LOOP(indata[3], outdata[3]);
if (--i == 0)
break;
RC4_LOOP(indata, outdata, 4);
LOOP(indata[4], outdata[4]);
if (--i == 0)
break;
RC4_LOOP(indata, outdata, 5);
LOOP(indata[5], outdata[5]);
if (--i == 0)
break;
RC4_LOOP(indata, outdata, 6);
LOOP(indata[6], outdata[6]);
if (--i == 0)
break;
}

View file

@ -1,6 +1,7 @@
#ifndef HEADER_RC4_LOCL_H
# define HEADER_RC4_LOCL_H
# include <openssl/opensslconf.h>
# include "internal/cryptlib.h"
# include "internal/rc4_conf.h"
#endif

View file

@ -61,17 +61,10 @@
const char *RC4_options(void)
{
#ifdef RC4_INDEX
if (sizeof(RC4_INT) == 1)
return ("rc4(idx,char)");
return ("rc4(char)");
else
return ("rc4(idx,int)");
#else
if (sizeof(RC4_INT) == 1)
return ("rc4(ptr,char)");
else
return ("rc4(ptr,int)");
#endif
return ("rc4(int)");
}
/*-

View file

@ -58,14 +58,13 @@
#ifndef HEADER_NEW_DES_H
# define HEADER_NEW_DES_H
# include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG
* (via openssl/opensslconf.h */
# include <openssl/e_os2.h>
# ifdef OPENSSL_NO_DES
# error DES is disabled.
# endif
# define DES_LONG OSSL_DES_LONG
typedef unsigned int DES_LONG;
# ifdef OPENSSL_BUILD_SHLIBCRYPTO
# undef OPENSSL_EXTERN

View file

@ -58,12 +58,14 @@
#ifndef HEADER_IDEA_H
# define HEADER_IDEA_H
# include <openssl/opensslconf.h>/* IDEA_INT, OPENSSL_NO_IDEA */
# include <openssl/opensslconf.h>
# ifdef OPENSSL_NO_IDEA
# error IDEA is disabled.
# endif
typedef unsigned int IDEA_INT;
# define IDEA_ENCRYPT 1
# define IDEA_DECRYPT 0

View file

@ -58,12 +58,14 @@
#ifndef HEADER_MD2_H
# define HEADER_MD2_H
# include <openssl/opensslconf.h>/* OPENSSL_NO_MD2, MD2_INT */
# include <openssl/opensslconf.h>
# ifdef OPENSSL_NO_MD2
# error MD2 is disabled.
# endif
# include <stddef.h>
typdef unsigned char MD2_INT;
# define MD2_DIGEST_LENGTH 16
# define MD2_BLOCK 16

View file

@ -151,8 +151,6 @@ extern "C" {
* The following are cipher-specific, but are part of the public API.
*/
#define OSSL_DES_LONG {- $config{des_int} -}
#if !defined(OPENSSL_SYS_UEFI)
{- $config{bn_ll} ? "#define" : "#undef" -} BN_LLONG
@ -162,9 +160,6 @@ extern "C" {
{- $config{b32} ? "#define" : "#undef" -} THIRTY_TWO_BIT
#endif
# define RC2_INT {- $config{rc2_int} -}
# define IDEA_INT {- $config{idea_int} -}
# define MD2_INT {- $config{md2_int} -}
# define RC4_INT {- $config{rc4_int} -}
#ifdef __cplusplus

View file

@ -58,11 +58,13 @@
#ifndef HEADER_RC2_H
# define HEADER_RC2_H
# include <openssl/opensslconf.h>/* OPENSSL_NO_RC2, RC2_INT */
# include <openssl/opensslconf.h>
# ifdef OPENSSL_NO_RC2
# error RC2 is disabled.
# endif
typedef unsigned int RC2_INT;
# define RC2_ENCRYPT 1
# define RC2_DECRYPT 0

View file

@ -580,20 +580,10 @@ $!
$ WRITE H_FILE "#if defined(HEADER_RC4_H)"
$ WRITE H_FILE "#undef RC4_INT"
$ WRITE H_FILE "#define RC4_INT unsigned int"
$ WRITE H_FILE "#undef RC4_CHUNK"
$ WRITE H_FILE "#define RC4_CHUNK unsigned long long"
$ WRITE H_FILE "#endif"
$!
$ WRITE H_FILE "#if defined(HEADER_DES_LOCL_H)"
$ WRITE H_FILE "#undef OSSL_DES_LONG"
$ WRITE H_FILE "#define OSSL_DES_LONG unsigned int"
$ WRITE H_FILE "#undef DES_PTR"
$ WRITE H_FILE "#define DES_PTR"
$ WRITE H_FILE "#undef DES_RISC1"
$ WRITE H_FILE "#undef DES_RISC2"
$ WRITE H_FILE "#define DES_RISC1"
$ WRITE H_FILE "#undef DES_UNROLL"
$ WRITE H_FILE "#define DES_UNROLL"
$ WRITE H_FILE "typedef unsigned int OSSL_DES_LONG;"
$ WRITE H_FILE "#endif"
$!
$ WRITE H_FILE "#if defined(HEADER_BN_H)"
@ -617,18 +607,10 @@ $!
$ WRITE H_FILE "#if defined(HEADER_RC4_H)"
$ WRITE H_FILE "#undef RC4_INT"
$ WRITE H_FILE "#define RC4_INT unsigned char"
$ WRITE H_FILE "#undef RC4_CHUNK"
$ WRITE H_FILE "#define RC4_CHUNK unsigned long"
$ WRITE H_FILE "#endif"
$!
$ WRITE H_FILE "#if defined(HEADER_DES_LOCL_H)"
$ WRITE H_FILE "#undef OSSL_DES_LONG"
$ WRITE H_FILE "#define OSSL_DES_LONG unsigned long"
$ WRITE H_FILE "#undef DES_PTR"
$ WRITE H_FILE "#define DES_PTR"
$ WRITE H_FILE "#undef DES_RISC1"
$ WRITE H_FILE "#undef DES_RISC2"
$ WRITE H_FILE "#undef DES_UNROLL"
$ WRITE H_FILE "typedef unsigned int OSSL_DES_LONG;"
$ WRITE H_FILE "#endif"
$!
$ WRITE H_FILE "#if defined(HEADER_BN_H)"