aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-11-29 13:14:33 +0000
committerlloyd <[email protected]>2009-11-29 13:14:33 +0000
commit70ba49797c45db0c28a803341570f7d832c16e7d (patch)
tree246070d469b4df6528e85e61b05a9b892ba08736
parent68500fd6d481ebbb2474ca20d233cae80ec1a8eb (diff)
parent4a94c35f8c9b73666a53a14a9b0a2ee50a742e89 (diff)
propagate from branch 'net.randombit.botan' (head ac4d8fecb28374d06094da3457aa1e23f77dfa52)
to branch 'net.randombit.botan.c++0x' (head 00f0eecf3374a14b6ab907bd235488f902608de4)
-rw-r--r--.mtn-ignore14
-rwxr-xr-xconfigure.py60
-rw-r--r--doc/examples/read_ssh.cpp119
-rw-r--r--doc/log.txt4
-rw-r--r--readme.txt28
-rw-r--r--src/build-data/cc/msvc.txt18
-rw-r--r--src/build-data/innosetup.in61
-rw-r--r--src/build-data/makefile/nmake.in17
-rw-r--r--src/build-data/makefile/unix.in32
-rw-r--r--src/build-data/makefile/unix_shr.in32
-rw-r--r--src/engine/simd_engine/simd_engine.cpp4
-rw-r--r--src/hash/sha1_sse2/sha1_sse2.h2
-rw-r--r--src/utils/simd_32/simd_altivec.h2
-rw-r--r--src/utils/simd_32/simd_scalar.h2
-rw-r--r--src/utils/simd_32/simd_sse.h2
15 files changed, 272 insertions, 125 deletions
diff --git a/.mtn-ignore b/.mtn-ignore
index 9472cff88..24a7f4f88 100644
--- a/.mtn-ignore
+++ b/.mtn-ignore
@@ -2,14 +2,6 @@
^botan-config$
^botan.pc$
^build$
-^build/build\.h$
-^build/checks$
-^build/checks/.*\.o$
-^build/include$
-^build/include/botan$
-^build/include/botan/.*\.h$
-^build/lib$
-^build/lib/.*\.o$
callgrind.out.*
^check$
^checks/ecc_testdata/dompar_private.pkcs8.pem$
@@ -18,10 +10,10 @@ callgrind.out.*
^checks/nist_tests/x509test$
^doc/botan.doxy$
^doc/doxygen$
-^doc/.*\.pdf$
-^doc/.*\.log$
-^doc/.*\.toc$
+^doc/[a-z]+\.(pdf|log|toc)$
^doc/examples/.*\.pem$
^src/wrap/perl-xs/Botan.(bs|c)$
^src/wrap/perl-xs/Makefile(\.old)?$
^src/wrap/perl-xs/.*blib$
+^[a-z]+\.(exe|dll)(\.manifest)?$
+^[a-z]+\.(exp|lib)$
diff --git a/configure.py b/configure.py
index 956fdb333..f44b106ab 100755
--- a/configure.py
+++ b/configure.py
@@ -37,9 +37,9 @@ class BuildConfigurationInformation(object):
"""
version_major = 1
version_minor = 9
- version_patch = 3
- version_so_patch = 3
- version_suffix = ''
+ version_patch = 4
+ version_so_patch = 4
+ version_suffix = '-dev'
version_string = '%d.%d.%d%s' % (
version_major, version_minor, version_patch, version_suffix)
@@ -551,10 +551,15 @@ class CompilerInfo(object):
"""
Return the machine specific ABI flags
"""
- def mach_abi_link_flags(self, osname, arch, submodel):
+ def mach_abi_link_flags(self, osname, arch, submodel, debug_p):
+
+ def all():
+ if debug_p:
+ return 'all-debug'
+ return 'all'
abi_link = set()
- for what in ['all', osname, arch, submodel]:
+ for what in [all(), osname, arch, submodel]:
if self.mach_abi_linking.get(what) != None:
abi_link.add(self.mach_abi_linking.get(what))
@@ -768,6 +773,11 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo):
return os.path.join(options.with_build_dir, path)
return path
+ def only_if_shared(option):
+ if options.build_shared_lib:
+ return option
+ return ''
+
return {
'version_major': build_config.version_major,
'version_minor': build_config.version_minor,
@@ -798,17 +808,17 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo):
'mp_bits': choose_mp_bits(),
- 'cc': cc.binary_name + cc.mach_abi_link_flags(options.os,
- options.arch,
- options.cpu),
+ 'cc': cc.binary_name + cc.mach_abi_link_flags(
+ options.os, options.arch, options.cpu, options.debug_build),
'lib_opt': cc.library_opt_flags(options.debug_build),
'mach_opt': cc.mach_opts(options.arch, options.cpu),
'check_opt': cc.check_opt_flags,
'lang_flags': cc.lang_flags + options.extra_flags,
'warn_flags': cc.warning_flags,
- 'shared_flags': cc.shared_flags,
- 'dll_import_flags': cc.dll_import_flags,
+
+ 'shared_flags': only_if_shared(cc.shared_flags),
+ 'dll_import_flags': only_if_shared(cc.dll_import_flags),
'so_link': cc.so_link_command_for(osinfo.basename),
@@ -1074,17 +1084,25 @@ def setup_build(build_config, options, template_vars):
makefile_template: template_vars['makefile_path']
}
- for (template, sink) in [('buildh.in', 'build.h'),
- ('botan-config.in', 'botan-config'),
- ('botan.pc.in', build_config.pkg_config_file()),
- ('botan.doxy.in', 'botan.doxy'),
- ('innosetup.in', 'botan.iss')]:
- templates_to_proc[os.path.join(options.build_data, template)] = \
- os.path.join(build_config.build_dir, sink)
-
- if options.boost_python:
- template = os.path.join(options.makefile_dir, 'python.in')
- templates_to_proc[template] = 'Makefile.python'
+ def templates_to_use():
+ yield (options.build_data, 'buildh.in', 'build.h')
+ yield (options.build_data, 'botan.doxy.in', 'botan.doxy')
+
+ if options.os != 'windows':
+ yield (options.build_data, 'botan.pc.in', build_config.pkg_config_file())
+ yield (options.build_data, 'botan-config.in', 'botan-config')
+
+ if options.os == 'windows':
+ yield (options.build_data, 'innosetup.in', 'botan.iss')
+
+ if options.boost_python:
+ yield (options.makefile_dir, 'python.in', 'Makefile.python')
+
+ for (template_dir, template, sink) in templates_to_use():
+ source = os.path.join(template_dir, template)
+ if template_dir == options.build_data:
+ sink = os.path.join(build_config.build_dir, sink)
+ templates_to_proc[source] = sink
for (template, sink) in templates_to_proc.items():
try:
diff --git a/doc/examples/read_ssh.cpp b/doc/examples/read_ssh.cpp
new file mode 100644
index 000000000..a88306caa
--- /dev/null
+++ b/doc/examples/read_ssh.cpp
@@ -0,0 +1,119 @@
+/*
+* Example of reading SSH2 format public keys (see RFC 4716)
+*/
+
+#include <fstream>
+#include <botan/x509_key.h>
+#include <botan/filters.h>
+#include <botan/loadstor.h>
+#include <botan/rsa.h>
+#include <botan/dsa.h>
+
+using namespace Botan;
+
+u32bit read_u32bit(Pipe& pipe)
+ {
+ byte out[4] = { 0 };
+ pipe.read(out, 4);
+ u32bit len = load_be<u32bit>(out, 0);
+ if(len > 10000)
+ throw Decoding_Error("Huge size in read_u32bit, something went wrong");
+ return len;
+ }
+
+std::string read_string(Pipe& pipe)
+ {
+ u32bit len = read_u32bit(pipe);
+
+ std::string out(len, 'X');
+ pipe.read(reinterpret_cast<byte*>(&out[0]), len);
+ return out;
+ }
+
+BigInt read_bigint(Pipe& pipe)
+ {
+ u32bit len = read_u32bit(pipe);
+
+ SecureVector<byte> buf(len);
+ pipe.read(&buf[0], len);
+ return BigInt::decode(buf);
+ }
+
+Public_Key* read_ssh_pubkey(const std::string& file)
+ {
+ std::ifstream in(file.c_str());
+
+ const std::string ssh_header = "---- BEGIN SSH2 PUBLIC KEY ----";
+ const std::string ssh_trailer = "---- END SSH2 PUBLIC KEY ----";
+
+ std::string hex_bits;
+
+ std::string line;
+ std::getline(in, line);
+
+ if(line != ssh_header)
+ return 0;
+
+ while(in.good())
+ {
+ std::getline(in, line);
+
+ if(line.find("Comment: ") == 0)
+ {
+ while(line[line.size()-1] == '\\')
+ std::getline(in, line);
+ std::getline(in, line);
+ }
+
+ if(line == ssh_trailer)
+ break;
+
+ hex_bits += line;
+ }
+
+ Pipe pipe(new Base64_Decoder);
+ pipe.process_msg(hex_bits);
+
+ std::string key_type = read_string(pipe);
+
+ if(key_type != "ssh-rsa" && key_type != "ssh-dss")
+ return 0;
+
+ if(key_type == "ssh-rsa")
+ {
+ BigInt e = read_bigint(pipe);
+ BigInt n = read_bigint(pipe);
+ return new RSA_PublicKey(n, e);
+ }
+ else if(key_type == "ssh-dss")
+ {
+ BigInt p = read_bigint(pipe);
+ BigInt q = read_bigint(pipe);
+ BigInt g = read_bigint(pipe);
+ BigInt y = read_bigint(pipe);
+
+ return new DSA_PublicKey(DL_Group(p, q, g), y);
+ }
+
+ return 0;
+ }
+
+#include <botan/init.h>
+#include <iostream>
+
+int main()
+ {
+ LibraryInitializer init;
+
+ Public_Key* key = read_ssh_pubkey("dsa.ssh");
+
+ if(key == 0)
+ {
+ std::cout << "Failed\n";
+ return 1;
+ }
+
+ std::cout << X509::PEM_encode(*key);
+
+ return 0;
+ }
diff --git a/doc/log.txt b/doc/log.txt
index 57c1a22a1..c0c87028c 100644
--- a/doc/log.txt
+++ b/doc/log.txt
@@ -1,4 +1,8 @@
+* 1.9.4-dev, ????-??-??
+ - Greatly improve the Win32 installer
+ - Several fixes for Visual C++ debug builds
+
* 1.9.3, 2009-11-19
- Add new AES implementation using Intel's AES instruction intrinsics
- Add an implementation of format preserving encryption
diff --git a/readme.txt b/readme.txt
index 4d13f7f1a..55c5452ea 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,21 +1,15 @@
-Botan 1.9.3, 2009-11-19
+Botan 1.9.4-dev, ????-??-??
Botan is a C++ class library for performing a wide variety of
cryptographic operations.
-I consider this release the best version available, and recommend all
-users upgrade from 1.6 or earlier versions as soon as possible. Some
-APIs have changed incompatibly since the 1.6 release series, but most
-applications should work as-is or with only simple modifications.
+Botan is released under the BSD license. See license.txt for the
+specifics. More information about the authors and contributors can be
+found in credits.txt and thanks.txt. All of these files are included
+in the doc/ directory of the source distribution.
-Botan is under a BSD-like license, the details of which can be found
-in license.txt. More information about the authors and contributors
-can be found in credits.txt and thanks.txt. All of these files are
-included in the doc/ directory of the source distribution.
-
-You can file bugs in Bugzilla, which can be accessed at
- http://www.randombit.net/bugzilla/
-or by sending a report to the botan-devel mailing list
+You can file bugs at http://bugs.randombit.net/ or by sending a report
+to the botan-devel mailing list:
http://lists.randombit.net/mailman/listinfo/botan-devel/
In the doc directory, there should be a set of PDFs, including
@@ -34,10 +28,10 @@ Botan in:
- Ajisai (SSLv3/TLSv1)
http://www.randombit.net/code/ajisai/
-Check the project's website at http://botan.randombit.net/ for
-announcements and new releases. If you'll be developing code using
-this library, consider joining the mailing lists to keep up to date
-with changes and new releases.
+Check http://botan.randombit.net/ for announcements and new
+releases. If you'll be developing code using this library, consider
+joining the mailing lists to keep up to date with changes and new
+releases.
As always, feel free to contact me with any questions or comments.
diff --git a/src/build-data/cc/msvc.txt b/src/build-data/cc/msvc.txt
index 278aaadf4..892e80c4b 100644
--- a/src/build-data/cc/msvc.txt
+++ b/src/build-data/cc/msvc.txt
@@ -1,6 +1,6 @@
macro_name MSVC
-binary_name cl.exe
+binary_name cl
compile_option "/nologo /c "
output_to_option "/Fo"
@@ -8,17 +8,16 @@ add_include_dir_option "/I"
add_lib_dir_option -L
add_lib_option ""
-lib_opt_flags "/O2"
-shared_flags "/DBOTAN_DLL=__declspec(dllexport)"
-check_opt_flags "/O2"
-debug_flags "/Zi"
-no_debug_flags ""
-lang_flags "/EHsc /GR /D_CONSOLE"
+no_debug_flags "/O2"
+debug_flags "/Od /Zi /DDEBUG"
+check_opt_flags "/O2 /D_CONSOLE"
+lang_flags "/EHsc /GR"
warning_flags ""
+shared_flags "/DBOTAN_DLL=__declspec(dllexport)"
dll_import_flags "__declspec(dllimport)"
-ar_command "lib"
+ar_command lib
makefile_style nmake
@@ -27,5 +26,6 @@ default -> "$(CXX) /LD"
</so_link_flags>
<mach_abi_linking>
-all -> "/MD"
+all -> "/MD"
+all-debug -> "/MDd"
</mach_abi_linking>
diff --git a/src/build-data/innosetup.in b/src/build-data/innosetup.in
index ffe780979..228ab4e97 100644
--- a/src/build-data/innosetup.in
+++ b/src/build-data/innosetup.in
@@ -5,10 +5,15 @@ AppName=Botan
AppVerName=Botan %{version}
AppPublisher=Jack Lloyd
-AppCopyright=Copyright (C) 1999-2009 Jack Lloyd and others
AppPublisherURL=http://botan.randombit.net/
AppVersion=%{version}
+VersionInfoCopyright=Copyright (C) 1999-2009 Jack Lloyd and others
+VersionInfoVersion=%{version}.0
+
+; Require at least Windows 98 or 2000
+MinVersion=4.1,5.0
+
DefaultDirName={pf}\botan
DefaultGroupName=botan
@@ -17,9 +22,53 @@ SolidCompression=yes
OutputDir=.
OutputBaseFilename=botan-%{version}
+[Types]
+Name: "user"; Description: "User"
+Name: "devel"; Description: "Developer"
+Name: "custom"; Description: "Custom"; Flags: iscustom
+
+[Components]
+name: "dll"; Description: "Runtime DLLs"; Types: user devel custom; Flags: fixed
+name: "implib"; Description: "Import Library"; Types: devel
+name: "includes"; Description: "Include Files"; Types: devel
+name: "docs"; Description: "Developer Documentation"; Types: devel
+
[Files]
-Source: "..\botan.dll"; DestDir: "{app}"
-Source: "..\botan.dll.manifest"; DestDir: "{app}"
-Source: "..\botan.exp"; DestDir: "{app}"
-Source: "..\botan.lib"; DestDir: "{app}"
-Source: "include\botan\*"; DestDir: "{app}\include\botan"
+; DLL and license file is always included
+Source: "..\doc\license.txt"; DestDir: "{app}"; Components: dll; AfterInstall: ConvertLineEndings
+Source: "..\botan.dll"; DestDir: "{app}"; Components: dll
+Source: "..\botan.dll.manifest"; DestDir: "{app}"; Components: dll
+
+Source: "include\botan\*"; DestDir: "{app}\include\botan"; Components: includes; AfterInstall: ConvertLineEndings
+
+Source: "..\readme.txt"; DestDir: "{app}\doc"; Components: docs; AfterInstall: ConvertLineEndings
+Source: "..\doc\log.txt"; DestDir: "{app}\doc"; Components: docs; AfterInstall: ConvertLineEndings
+
+Source: "..\doc\examples\*.cpp"; DestDir: "{app}\doc\examples"; Components: docs; AfterInstall: ConvertLineEndings
+
+Source: "..\botan.exp"; DestDir: "{app}"; Components: implib
+Source: "..\botan.lib"; DestDir: "{app}"; Components: implib
+
+Source: "..\doc\api.pdf"; DestDir: "{app}\doc"; Components: docs; Flags: skipifsourcedoesntexist
+Source: "..\doc\tutorial.pdf"; DestDir: "{app}\doc"; Components: docs; Flags: skipifsourcedoesntexist
+
+[Code]
+const
+ LF = #10;
+ CR = #13;
+ CRLF = CR + LF;
+
+procedure ConvertLineEndings();
+ var
+ FilePath : String;
+ FileContents : String;
+begin
+ FilePath := ExpandConstant(CurrentFileName)
+
+ if ExtractFileName(CurrentFileName) <> 'build.h' then
+ begin
+ LoadStringFromFile(FilePath, FileContents);
+ StringChangeEx(FileContents, LF, CRLF, False);
+ SaveStringToFile(FilePath, FileContents, False);
+ end;
+end;
diff --git a/src/build-data/makefile/nmake.in b/src/build-data/makefile/nmake.in
index 2604a3459..79b80745c 100644
--- a/src/build-data/makefile/nmake.in
+++ b/src/build-data/makefile/nmake.in
@@ -6,7 +6,7 @@ MACH_OPT = %{mach_opt}
LANG_FLAGS = %{lang_flags}
WARN_FLAGS = %{warn_flags}
SO_OBJ_FLAGS = %{shared_flags}
-SO_LINK_CMD = %{so_link}
+LIB_LINK_CMD = %{so_link}
LINK_TO = %{link_to}
### Version Numbers
@@ -45,11 +45,12 @@ CHECKOBJS = %{check_objs}
LIB_FLAGS = $(LIB_OPT) $(MACH_OPT) $(LANG_FLAGS) $(WARN_FLAGS) $(SO_OBJ_FLAGS)
CHECK_FLAGS = $(CHECK_OPT) $(LANG_FLAGS) $(WARN_FLAGS)
-LIBRARIES = $(DLL)
-
LIBNAME = botan
-DLL = $(LIBNAME).%{so_suffix}
-STATIC_LIB = $(LIBNAME).%{static_suffix}
+
+LIBRARIES = $(BOTAN_LIB)
+
+# This will be either a static lib or the DLL import lib
+BOTAN_LIB = $(LIBNAME).%{static_suffix}
all: $(LIBRARIES)
@@ -60,10 +61,10 @@ all: $(LIBRARIES)
### Link Commands
$(CHECK): $(LIBRARIES) $(CHECKOBJS)
- $(CXX) /Fe$@ $(CHECKOBJS) $(STATIC_LIB) $(LINK_TO)
+ $(CXX) /Fe$@ $(CHECKOBJS) $(BOTAN_LIB) $(LINK_TO)
-$(DLL): $(LIBOBJS)
- $(SO_LINK_CMD) /Febotan $(LIBOBJS) $(LINK_TO)
+$(BOTAN_LIB): $(LIBOBJS)
+ $(LIB_LINK_CMD) /Fe$(LIBNAME) $(LIBOBJS) $(LINK_TO)
### Fake Targets
clean:
diff --git a/src/build-data/makefile/unix.in b/src/build-data/makefile/unix.in
index 8e0e35b87..22ff919cc 100644
--- a/src/build-data/makefile/unix.in
+++ b/src/build-data/makefile/unix.in
@@ -1,6 +1,4 @@
-##################################################
-# Compiler Options #
-##################################################
+# Compiler Options
CXX = %{cc}
LIB_OPT = %{lib_opt}
CHECK_OPT = %{check_opt}
@@ -9,14 +7,10 @@ LANG_FLAGS = %{lang_flags}
WARN_FLAGS = %{warn_flags}
LINK_TO = %{link_to}
-##################################################
-# Version Numbers #
-##################################################
+# Version Numbers
VERSION = %{version}
-##################################################
-# Installation Settings #
-##################################################
+# Installation Settings
DESTDIR = %{prefix}
BINDIR = $(DESTDIR)/bin
@@ -28,9 +22,7 @@ PKGCONF_DIR = $(LIBDIR)/pkgconfig
CONFIG_SCRIPT = %{botan_config}
PKGCONFIG = %{botan_pkgconfig}
-##################################################
-# Aliases for Common Programs #
-##################################################
+# Aliases for Common Programs
AR = %{ar_command}
CD = @cd
ECHO = @echo
@@ -43,9 +35,7 @@ RANLIB = %{ranlib_command}
RM = @rm -f
RM_R = @rm -rf
-##################################################
-# File Lists #
-##################################################
+# File Lists
CHECK = %{check_prefix}check
DOCS = %{doc_files}
@@ -66,16 +56,12 @@ STATIC_LIB = $(LIBNAME).a
all: $(LIBRARIES)
-##################################################
-# Build Commands #
-##################################################
+# Build Commands
%{lib_build_cmds}
%{check_build_cmds}
-##################################################
-# Link Commands #
-##################################################
+# Link Commands
$(CHECK): $(LIBRARIES) $(CHECKOBJS)
$(CXX) $(CHECKOBJS) -L. libbotan.a $(LINK_TO) -o $(CHECK)
@@ -84,9 +70,7 @@ $(STATIC_LIB): $(LIBOBJS)
$(AR) $(STATIC_LIB) $(LIBOBJS)
$(RANLIB) $(STATIC_LIB)
-##################################################
-# Fake Targets #
-##################################################
+# Fake Targets
.PHONY = doxygen clean distclean install static
static: $(STATIC_LIB)
diff --git a/src/build-data/makefile/unix_shr.in b/src/build-data/makefile/unix_shr.in
index cfc8e3223..499b7eb92 100644
--- a/src/build-data/makefile/unix_shr.in
+++ b/src/build-data/makefile/unix_shr.in
@@ -1,6 +1,4 @@
-##################################################
-# Compiler Options #
-##################################################
+# Compiler Options
CXX = %{cc}
LIB_OPT = %{lib_opt}
CHECK_OPT = %{check_opt}
@@ -11,15 +9,11 @@ SO_OBJ_FLAGS = %{shared_flags}
SO_LINK_CMD = %{so_link}
LINK_TO = %{link_to}
-##################################################
-# Version Numbers #
-##################################################
+# Version Numbers
VERSION = %{version}
SO_VERSION = %{so_version}
-##################################################
-# Installation Settings #
-##################################################
+# Installation Settings
DESTDIR = %{prefix}
BINDIR = $(DESTDIR)/bin
@@ -31,9 +25,7 @@ PKGCONF_DIR = $(LIBDIR)/pkgconfig
CONFIG_SCRIPT = %{botan_config}
PKGCONFIG = %{botan_pkgconfig}
-##################################################
-# Aliases for Common Programs #
-##################################################
+# Aliases for Common Programs
AR = %{ar_command}
CD = @cd
ECHO = @echo
@@ -46,9 +38,7 @@ RANLIB = %{ranlib_command}
RM = @rm -f
RM_R = @rm -rf
-##################################################
-# File Lists #
-##################################################
+# File Lists
CHECK = %{check_prefix}check
DOCS = %{doc_files}
@@ -74,16 +64,12 @@ SYMLINK = libbotan.%{so_suffix}
all: $(LIBRARIES)
-##################################################
-# Build Commands #
-##################################################
+# Build Commands
%{lib_build_cmds}
%{check_build_cmds}
-##################################################
-# Link Commands #
-##################################################
+# Link Commands
$(CHECK): $(LIBRARIES) $(CHECKOBJS)
$(CXX) $(LDFLAGS) $(CHECKOBJS) -o $(CHECK) -L. -lbotan-%{so_version} $(LINK_TO)
@@ -96,9 +82,7 @@ $(SHARED_LIB): $(LIBOBJS)
$(SO_LINK_CMD) $(LDFLAGS) $(LIBOBJS) -o $(SHARED_LIB) $(LINK_TO)
$(LN) $(SHARED_LIB) $(SYMLINK)
-##################################################
-# Fake Targets #
-##################################################
+# Fake Targets
.PHONY = doxygen clean distclean install static shared
static: $(STATIC_LIB)
diff --git a/src/engine/simd_engine/simd_engine.cpp b/src/engine/simd_engine/simd_engine.cpp
index 7e15f9ec1..fdb1644d0 100644
--- a/src/engine/simd_engine/simd_engine.cpp
+++ b/src/engine/simd_engine/simd_engine.cpp
@@ -6,6 +6,7 @@
*/
#include <botan/simd_engine.h>
+#include <botan/simd_32.h>
#include <botan/cpuid.h>
#if defined(BOTAN_HAS_SERPENT_SIMD)
@@ -26,6 +27,9 @@ BlockCipher*
SIMD_Engine::find_block_cipher(const SCAN_Name& request,
Algorithm_Factory&) const
{
+ if(!SIMD_32::enabled())
+ return 0;
+
#if defined(BOTAN_HAS_SERPENT_SIMD)
if(request.algo_name() == "Serpent")
return new Serpent_SIMD;
diff --git a/src/hash/sha1_sse2/sha1_sse2.h b/src/hash/sha1_sse2/sha1_sse2.h
index 0f8eebee9..1c4b4cca7 100644
--- a/src/hash/sha1_sse2/sha1_sse2.h
+++ b/src/hash/sha1_sse2/sha1_sse2.h
@@ -24,8 +24,6 @@ class BOTAN_DLL SHA_160_SSE2 : public SHA_160
void compress_n(const byte[], u32bit blocks);
};
-extern "C" void botan_sha1_sse2_compress(u32bit[5], const u32bit*);
-
}
#endif
diff --git a/src/utils/simd_32/simd_altivec.h b/src/utils/simd_32/simd_altivec.h
index 3e784a8c4..e1704e76c 100644
--- a/src/utils/simd_32/simd_altivec.h
+++ b/src/utils/simd_32/simd_altivec.h
@@ -20,7 +20,7 @@ namespace Botan {
class SIMD_Altivec
{
public:
- bool enabled() const { return CPUID::has_altivec(); }
+ static bool enabled() { return CPUID::has_altivec(); }
SIMD_Altivec(const u32bit B[4])
{
diff --git a/src/utils/simd_32/simd_scalar.h b/src/utils/simd_32/simd_scalar.h
index 398503d33..148b76c35 100644
--- a/src/utils/simd_32/simd_scalar.h
+++ b/src/utils/simd_32/simd_scalar.h
@@ -16,7 +16,7 @@ namespace Botan {
class SIMD_Scalar
{
public:
- bool enabled() const { return true; }
+ static bool enabled() { return true; }
SIMD_Scalar(const u32bit B[4])
{
diff --git a/src/utils/simd_32/simd_sse.h b/src/utils/simd_32/simd_sse.h
index 81d8afe75..9f03b3733 100644
--- a/src/utils/simd_32/simd_sse.h
+++ b/src/utils/simd_32/simd_sse.h
@@ -17,7 +17,7 @@ namespace Botan {
class SIMD_SSE2
{
public:
- bool enabled() const { return CPUID::has_sse2(); }
+ static bool enabled() { return CPUID::has_sse2(); }
SIMD_SSE2(const u32bit B[4])
{