Repository: randombit/botan
Pull request #2098 (2019-09-05 18:50:27)

Add configure parameter --build-targets=
As a first step towards #2086, this introduces `--build-extra-targets=`. It allows to select additional build targets (apart from the actual library) during `./configure.py`. A minimal build of only the library, would be configured like so:

```
./configure.py --build-extra-targets="" --minimized-build
```

Todo:

- [x] sanity checks
- [x] dealing with `static` and `shared` library builds?
- [ ] ~~how to deal with fuzzer build targets? -- e.g. one target per fuzzer-type (i.e. `afl_fuzzer`, `libfuzzer`, `klee_fuzzer`, ...)~~
- [x] CI integration?


Patch:
diff --git a/configure.py b/configure.py
index 94b7b9460..797a07f3c 100755
--- a/configure.py
+++ b/configure.py
@@ -276,6 +276,8 @@ class BuildPaths(object): # pylint: disable=too-many-instance-attributes
         else:
             raise InternalError("Unknown src info type '%s'" % (typ))
 
+ACCEPTABLE_BUILD_TARGETS = ["static", "shared", "cli", "tests", "bogo_shim"]
+
 def process_command_line(args): # pylint: disable=too-many-locals,too-many-statements
     """
     Handle command line options
@@ -487,8 +489,8 @@ def process_command_line(args): # pylint: disable=too-many-locals,too-many-state
     build_group.add_option('--with-debug-asserts', action='store_true', default=False,
                            help=optparse.SUPPRESS_HELP)
 
-    build_group.add_option('--build-bogo-shim', action='store_true', default=False,
-                           help=optparse.SUPPRESS_HELP)
+    build_group.add_option('--build-targets', default=None, dest="build_targets", action='append',
+                           help="build specific targets and tools (%s)" % ', '.join(ACCEPTABLE_BUILD_TARGETS))
 
     build_group.add_option('--with-pkg-config', action='store_true', default=None,
                            help=optparse.SUPPRESS_HELP)
@@ -799,8 +801,7 @@ class ModuleInfo(InfoObject):
              'os_features', 'arch', 'isa', 'cc', 'comment', 'warning'],
             ['defines', 'libs', 'frameworks'],
             {
-                'load_on': 'auto',
-                'endian': 'any',
+                'load_on': 'auto'
             })
 
         def check_header_duplicates(header_list_public, header_list_internal):
@@ -853,7 +854,6 @@ class ModuleInfo(InfoObject):
         self.os_features = lex.os_features
         self.requires = lex.requires
         self.warning = combine_lines(lex.warning)
-        self.endian = lex.endian
 
         # Modify members
         self.source = [normalize_source_path(os.path.join(self.lives_in, s)) for s in self.source]
@@ -946,10 +946,6 @@ class ModuleInfo(InfoObject):
         arch_name = archinfo.basename
         cpu_name = options.cpu
 
-        if self.endian != 'any':
-            if self.endian != options.with_endian:
-                return False
-
         for isa in self.isa:
             if isa.find(':') > 0:
                 (arch, isa) = isa.split(':')
@@ -1941,6 +1937,19 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch,
 
         return osinfo.ar_command
 
+    def choose_endian(arch_info, options):
+        if options.with_endian is not None:
+            return options.with_endian
+
+        if options.cpu.endswith('eb') or options.cpu.endswith('be'):
+            return 'big'
+        elif options.cpu.endswith('el') or options.cpu.endswith('le'):
+            return 'little'
+
+        if arch_info.endian:
+            logging.info('Defaulting to assuming %s endian', arch_info.endian)
+        return arch_info.endian
+
     build_dir = options.with_build_dir or os.path.curdir
     program_suffix = options.program_suffix or osinfo.program_suffix
 
@@ -1950,15 +1959,17 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch,
             return path
         return os.path.join(build_dir, path)
 
-    def all_targets():
+    def all_targets(options):
         yield 'libs'
-        yield 'cli'
-        yield 'tests'
-        yield 'docs'
+        if 'cli' in options.build_targets:
+            yield 'cli'
+        if 'tests' in options.build_targets:
+            yield 'tests'
         if options.build_fuzzers:
             yield 'fuzzers'
-        if options.build_bogo_shim:
+        if 'bogo_shim' in options.build_targets:
             yield 'bogo_shim'
+        yield 'docs'
 
     variables = {
         'version_major':  Version.major(),
@@ -1976,7 +1987,7 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch,
         'macos_so_compat_ver': '%s.%s.0' % (Version.packed(), Version.so_rev()),
         'macos_so_current_ver': '%s.%s.%s' % (Version.packed(), Version.so_rev(), Version.patch()),
 
-        'all_targets': ' '.join(all_targets()),
+        'all_targets': ' '.join(all_targets(options)),
 
         'base_dir': source_paths.base_dir,
         'src_dir': source_paths.src_dir,
@@ -2043,7 +2054,7 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch,
         'os': options.os,
         'arch': options.arch,
         'cpu_family': arch.family,
-        'endian': options.with_endian,
+        'endian': choose_endian(arch, options),
         'cpu_is_64bit': arch.wordsize == 64,
 
         'bakefile_arch': 'x86' if options.arch == 'x86_32' else 'x86_64',
@@ -2108,7 +2119,7 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch,
         'include_paths': build_paths.format_include_paths(cc, options.with_external_includedir),
         'module_defines': sorted(flatten([m.defines() for m in modules])),
 
-        'build_bogo_shim': options.build_bogo_shim,
+        'build_bogo_shim': bool('bogo_shim' in options.build_targets),
         'bogo_shim_src': os.path.join(source_paths.src_dir, 'bogo_shim', 'bogo_shim.cpp'),
 
         'os_features': osinfo.enabled_features(options),
@@ -2975,6 +2986,36 @@ def canonicalize_options(options, info_os, info_arch):
     if options.cpu != options.arch:
         logging.info('Canonicalized CPU target %s to %s', options.cpu, options.arch)
 
+    # select and sanity check build targets
+    def canonicalize_build_targets(options):
+        # --build-targets was not provided: build default targets
+        if options.build_targets is None:
+            return ["cli", "tests"]
+
+        # flatten the list of multiple --build-targets="" and comma separation
+        build_targets = [t.strip().lower() for ts in options.build_targets for t in ts.split(",")]
+
+        # validate that all requested build targets are available
+        for build_target in build_targets:
+            if build_target not in ACCEPTABLE_BUILD_TARGETS:
+                raise UserError("unknown build target: %s" % build_target)
+
+        # building the shared lib desired and without contradiction?
+        if options.build_shared_lib is None:
+            options.build_shared_lib = "shared" in build_targets
+        elif bool(options.build_shared_lib) != bool("shared" in build_targets):
+            raise UserError("inconsistent usage of --enable/disable-shared-library and --build-targets")
+
+        # building the static lib desired and without contradiction?
+        if options.build_static_lib is None:
+            options.build_static_lib = "static" in build_targets
+        elif bool(options.build_static_lib) != bool("static" in build_targets):
+            raise UserError("inconsistent usage of --enable/disable-static-library and --build-targets")
+
+        return build_targets
+
+    options.build_targets = canonicalize_build_targets(options)
+
     shared_libs_supported = options.os in info_os and info_os[options.os].building_shared_supported()
 
     if not shared_libs_supported:
@@ -3293,7 +3334,7 @@ def main(argv):
     Main driver
     """
 
-    # pylint: disable=too-many-locals,too-many-statements
+    # pylint: disable=too-many-locals
 
     options = process_command_line(argv[1:])
 
@@ -3362,21 +3403,6 @@ def main(argv):
     logging.info('Target is %s:%s-%s-%s' % (
         options.compiler, cc_min_version, options.os, options.arch))
 
-    def choose_endian(arch_info, options):
-        if options.with_endian is not None:
-            return options.with_endian
-
-        if options.cpu.endswith('eb') or options.cpu.endswith('be'):
-            return 'big'
-        elif options.cpu.endswith('el') or options.cpu.endswith('le'):
-            return 'little'
-
-        if arch_info.endian:
-            logging.info('Assuming target %s is %s endian', arch_info.basename, arch_info.endian)
-        return arch_info.endian
-
-    options.with_endian = choose_endian(arch, options)
-
     chooser = ModulesChooser(info_modules, module_policy, arch, osinfo, cc, cc_min_version, options)
     loaded_module_names = chooser.choose()
     using_mods = [info_modules[modname] for modname in loaded_module_names]
diff --git a/doc/deprecated.rst b/doc/deprecated.rst
index 8f81bd719..57fa9957c 100644
--- a/doc/deprecated.rst
+++ b/doc/deprecated.rst
@@ -1,61 +1,74 @@
 Deprecated Features
 ========================
 
-Certain functionality is deprecated and is likely to be removed in
-a future major release.
+The following functionality is currently deprecated, and will likely
+be removed in a future release. If you think you have a good reason to
+be using one of the following, contact the developers to explain your
+use case if you want to make sure your code continues to work.
 
-To help warn users, macros are used to annotate deprecated functions
-and headers. These warnings are enabled by default, but can be
-disabled by defining the macro ``BOTAN_NO_DEPRECATED_WARNINGS`` prior
-to including any Botan headers.
+This is in addition to specific API calls marked with BOTAN_DEPRECATED
+in the source.
 
-.. warning::
-    Not all of the functionality which is currently deprecated has an
-    associated warning.
-
-If you are using something which is currently deprecated and there
-doesn't seem to be an obvious alternative, contact the developers to
-explain your use case if you want to make sure your code continues to
-work.
-
-TLS Protocol Deprecations
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The following TLS protocol features are deprecated and will be removed
-in a future major release:
-
-- Support for TLSv1.0/v1.1 and DTLS v1.0
-
-- All support for DSA ciphersuites/certificates
-
-- Support for point compression in TLS. This is supported in v1.2 but
-  removed in v1.3. For simplicity it will be removed in v1.2 also.
-
-- Support for using SHA-1 to sign TLS v1.2 ServerKeyExchange.
+- Configuring a build (with ``configure.py``) using Python2. In a future
+  major release, Python3 will be required.
 
-- All CBC mode ciphersuites. This includes all available 3DES and SEED
-  ciphersuites. This implies also removing Encrypt-then-MAC extension.
+- Using the Python wrapper with Python2.
+
+- Directly using an algorithm class like ``AES_128`` or ``SHA_256``. Instead
+  create the objects via a ``T::create`` call. A future major release may
+  make such declarations private.
+
+- Directly accessing the member variables of types calendar_point, ASN1_Attribute,
+  AlgorithmIdentifier, and BER_Object
+
+- The following headers are currently public, but will be completely
+  removed in a future major release: ``botan.h``, ``init.h``,
+  ``lookup.h``, ``threefish.h``, ``sm2_enc.h``, ``datastor.h``,
+  ``basefilt.h``, ``hex_filt.h``, ``b64_filt.h``, ``comp_filter.h``,
+  ``key_filt.h``, ``buf_filt.h``, ``cipher_filter.h``,
+  ``tls_blocking.h``, ``pbkdf1.h``, ``xmss_key_pair.h``,
+
+- The following headers are currently public, but will be made
+  internal in a future major release, and no longer usable by
+  applications: ``rotate.h``, ``loadstor.h``, ``mul128.h``,
+  ``dyn_load.h``, ``atomic.h``, ``blinding.h``, ``gf2m_small_m.h``,
+  ``locking_allocator.h``, ``polyn_gf2m.h`,, ``parsing.h``,
+  ``rfc6979.h``, ``divide.h``, ``charset.h``, ``secqueue.h``,
+  ``keypair.h``, ``http_util.h``, ``scan_name.h``, ``ghash.h``,
+  ``tls_extensions.h``, ``tls_messages.h``, ``tls_algos.h``,
+  ``tls_magic.h``, ``oids.h``, ``stl_compatability.h``, ``bswap.h``,
+  ``calendar.h``, ``curve_nistp.h``, ``curve_gfp.h``, ``eme.h``,
+  ``eme_pkcs.h``, ``eme_raw.h``, ``oaep.h``, ``emsa1.h``, ``emsa.h``,
+  ``emsa_pkcs1.h``, ``emsa_raw.h``, ``emsa_x931.h``, ``hash_id.h``,
+  ``iso9796.h``, ``pssr.h``, ``kdf1.h``, ``kdf1_iso18033.h``,
+  ``kdf2.h``, ``sp800_108.h``, ``sp800_56a.h``, ``sp800_56c.h``,
+  ``prf_tls.h``, ``prf_x942.h``, ``mode_pad.h``, ``monty.h``,
+  ``mul128.h``, ``pbes2.h``, ``pbkdf2.h``, ``pk_ops.h``,
+  ``pow_mod.h``, ``reducer.h``, ``stream_mode.h``, ``workfactor.h``,
+  ``xmss_common_ops.h``, ``xmss_tools.h``, ``xmss_hash.h``,
+  ``xmss_tools.h``,
 
-- All ciphersuites using DH key exchange (DHE-DSS, DHE-RSA, DHE-PSK, anon DH)
+- Using a default output length for "SHAKE-128" and "SHAKE-256". Instead,
+  always specify the desired output length.
 
-- All ciphersuites using static RSA key exchange
+- All or nothing package transform (``package.h``)
 
-- All anonymous (DH/ECDH) ciphersuites. This does not include PSK and
-  ECDHE-PSK, which will be retained.
+- The TLS constructors taking `std::function` for callbacks. Instead
+  use the TLS::Callbacks interface.
 
-- SRP ciphersuites. This is implied by the removal of CBC mode, since
-  all available SRP ciphersuites use CBC. To avoid use of obsolete
-  ciphers, it would be better to instead perform a standard TLS
-  negotiation, then a PAKE authentication within (and bound to) the
-  TLS channel.
+- Using ``X509_Certificate::subject_info`` and ``issuer_info`` to access any
+  information that is not included in the DN or subject alternative name. Prefer
+  using the specific assessor functions for other data, eg instead of
+  ``cert.subject_info("X509.Certificate.serial")`` use ``cert.serial_number()``.
 
-- OCB ciphersuites using 128-bit keys
+- The Buffered_Computation base class. In a future release the class will be
+  removed, and all of member functions instead declared directly on
+  MessageAuthenticationCode and HashFunction. So this only affects you if you
+  are directly referencing `Botan::Buffered_Computation` in some way.
 
-Deprecated Functionality
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+- Platform support for Google Native Client
 
-This section lists cryptographic functionality which will be removed
-in a future major release.
+- Support for PathScale and HP compilers
 
 - Block ciphers CAST-256, Kasumi, MISTY1, and DESX.
 
@@ -76,184 +89,35 @@ in a future major release.
 
 - All pre-created DSA groups
 
-- All or nothing package transform (``package.h``)
-
+TLS Protocol Deprecations
+---------------------------
 
-Deprecated Headers
-^^^^^^^^^^^^^^^^^^^^^^
-
-* The following headers and all functionality contained within them
-  are outright deprecated, and will be removed entirely in a future
-  major release. Most are either simply forwarding includes to another
-  (still public) header, or contain functionality which is entirely
-  deprecated. Consult the relevent file for more information.
-  ``basefilt.h``, ``botan.h``, ``buf_filt.h``, ``cipher_filter.h``, ``comp_filter.h``,
-  ``compiler.h``, ``init.h``, ``key_filt.h``, ``lookup.h``, ``sm2_enc.h``, ``threefish.h``,
-  ``xmss_key_pair.h``
-
-* The following headers have useful functionality but which we wish to
-  hide from applications to allow easier library evolution. They will
-  be made internal in a future major release, and will only be
-  available to the library itself. In most cases, there is an
-  alternative available. For example instead of using algorithm
-  specific interfaces, use X::create to create the object dynamically.
-  ``adler32.h``,
-  ``aes.h``,
-  ``aria.h``,
-  ``atomic.h``,
-  ``bcrypt_pbkdf.h``,
-  ``blake2b.h``,
-  ``blinding.h``,
-  ``blowfish.h``,
-  ``bswap.h``,
-  ``camellia.h``,
-  ``cascade.h``,
-  ``cast128.h``,
-  ``cast256.h``,
-  ``cbc.h``,
-  ``cbc_mac.h``,
-  ``ccm.h``,
-  ``cfb.h``,
-  ``chacha20poly1305.h``,
-  ``chacha.h``,
-  ``charset.h``,
-  ``cmac.h``,
-  ``comb4p.h``,
-  ``compiler.h``,
-  ``cpuid.h``,
-  ``crc24.h``,
-  ``crc32.h``,
-  ``ctr.h``,
-  ``curve_gfp.h``,
-  ``curve_nistp.h``,
-  ``datastor.h``,
-  ``des.h``,
-  ``desx.h``,
-  ``divide.h``,
-  ``eax.h``,
-  ``eme.h``,
-  ``eme_pkcs.h``,
-  ``eme_raw.h``,
-  ``emsa1.h``,
-  ``emsa.h``,
-  ``emsa_pkcs1.h``,
-  ``emsa_raw.h``,
-  ``emsa_x931.h``,
-  ``gcm.h``,
-  ``gf2m_small_m.h``,
-  ``ghash.h``,
-  ``gmac.h``,
-  ``gost_28147.h``,
-  ``gost_3411.h``,
-  ``hash_id.h``,
-  ``hkdf.h``,
-  ``hmac.h``,
-  ``http_util.h``,
-  ``idea.h``,
-  ``iso9796.h``,
-  ``kasumi.h``,
-  ``kdf1.h``,
-  ``kdf1_iso18033.h``,
-  ``kdf2.h``,
-  ``keccak.h``,
-  ``keypair.h``,
-  ``lion.h``,
-  ``loadstor.h``,
-  ``locking_allocator.h``,
-  ``md4.h``,
-  ``md5.h``,
-  ``mdx_hash.h``,
-  ``misty1.h``,
-  ``mode_pad.h``,
-  ``mul128.h``,
-  ``noekeon.h``,
-  ``oaep.h``,
-  ``ocb.h``,
-  ``ofb.h``,
-  ``par_hash.h``,
-  ``parsing.h``,
-  ``pbes2.h``,
-  ``pbkdf1.h``,
-  ``pbkdf2.h``,
-  ``pgp_s2k.h``,
-  ``poly1305.h``,
-  ``polyn_gf2m.h``,
-  ``pow_mod.h``,
-  ``prf_tls.h``,
-  ``prf_x942.h``,
-  ``pssr.h``,
-  ``rc4.h``,
-  ``rfc6979.h``,
-  ``rmd160.h``,
-  ``rotate.h``,
-  ``salsa20.h``,
-  ``scan_name.h``,
-  ``scrypt.h``,
-  ``secqueue.h``,
-  ``seed.h``,
-  ``serpent.h``,
-  ``sha160.h``,
-  ``sha2_32.h``,
-  ``sha2_64.h``,
-  ``sha3.h``,
-  ``shacal2.h``,
-  ``shake_cipher.h``,
-  ``shake.h``,
-  ``siphash.h``,
-  ``siv.h``,
-  ``skein_512.h``,
-  ``sm3.h``,
-  ``sm4.h``,
-  ``sp800_108.h``,
-  ``sp800_56a.h``,
-  ``sp800_56c.h``,
-  ``stl_compatibility.h``,
-  ``stream_mode.h``,
-  ``streebog.h``,
-  ``threefish_512.h``,
-  ``tiger.h``,
-  ``tls_algos.h``,
-  ``tls_magic.h``,
-  ``twofish.h``,
-  ``uuid.h``,
-  ``whrlpool.h``,
-  ``x919_mac.h``,
-  ``xmss_common_ops.h``,
-  ``xmss_hash.h``,
-  ``xmss_index_registry.h``,
-  ``xmss_tools.h``,
-  ``xtea.h``,
-  ``xts.h``,
+The following TLS protocol features are deprecated and will be removed
+in a future major release:
 
-Other API deprecations
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+- Support for TLSv1.0/v1.1 and DTLS v1.0
 
-- Directly accessing the member variables of types ``calendar_point``,
-  ``ASN1_Attribute``, ``AlgorithmIdentifier``, and ``BER_Object``
+- All support for DSA ciphersuites/certificates
 
-- Using a default output length for "SHAKE-128" and "SHAKE-256". Instead,
-  always specify the desired output length.
+- Support for point compression in TLS. This is supported in v1.2 but
+  removed in v1.3. For simplicity it will be removed in v1.2 also.
 
-- The TLS constructors taking ``std::function`` for callbacks. Instead
-  use the ``TLS::Callbacks`` interface.
+- Support for using SHA-1 to sign TLS v1.2 ServerKeyExchange.
 
-- Using ``X509_Certificate::subject_info`` and ``issuer_info`` to access any
-  information that is not included in the DN or subject alternative name. Prefer
-  using the specific assessor functions for other data, eg instead of
-  ``cert.subject_info("X509.Certificate.serial")`` use ``cert.serial_number()``.
+- All CBC mode ciphersuites. This includes all available 3DES and SEED
+  ciphersuites. This implies also removing Encrypt-then-MAC extension.
 
-- The ``Buffered_Computation`` base class. In a future release the
-  class will be removed, and all of member functions instead declared
-  directly on ``MessageAuthenticationCode`` and ``HashFunction``. So
-  this only affects you if you are directly referencing
-  ``Botan::Buffered_Computation`` in some way.
+- All ciphersuites using DH key exchange (DHE-DSS, DHE-RSA, DHE-PSK, anon DH)
 
-Deprecated Build Targets
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+- All ciphersuites using static RSA key exchange
 
-- Configuring a build (with ``configure.py``) using Python2. In a future
-  major release, Python3 will be required.
+- All anonymous (DH/ECDH) ciphersuites. This does not include PSK and
+  ECDHE-PSK, which will be retained.
 
-- Platform support for Google Native Client
+- SRP ciphersuites. This is implied by the removal of CBC mode, since
+  all available SRP ciphersuites use CBC. To avoid use of obsolete
+  ciphers, it would be better to instead perform a standard TLS
+  negotiation, then a PAKE authentication within (and bound to) the
+  TLS channel.
 
-- Support for PathScale and HP compilers
+- OCB ciphersuites using 128-bit keys
diff --git a/doc/side_channels.rst b/doc/side_channels.rst
index fa42d94ac..5fe660171 100644
--- a/doc/side_channels.rst
+++ b/doc/side_channels.rst
@@ -333,8 +333,7 @@ Hash Functions
 
 Most hash functions included in Botan such as MD5, SHA-1, SHA-2, SHA-3, Skein,
 and BLAKE2 do not require any input-dependent memory lookups, and so seem to not be
-affected by common CPU side channels. However the implementations of Whirlpool
-and Streebog use table lookups and probably can be attacked by side channels.
+affected by common CPU side channels.
 
 Memory comparisons
 ----------------------
diff --git a/news.rst b/news.rst
index 7502c0b1a..205c334e2 100644
--- a/news.rst
+++ b/news.rst
@@ -4,11 +4,7 @@ Release Notes
 Version 2.12.0, Not Yet Released
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-* Many currently public headers are being deprecated. Currently this means
-  a warning is issued if they are used by applications. In a future major
-  release they will be made internal. (GH #2061)
-
-* GCM performance improvements (GH #2024 #2099)
+* GCM performance improvements (GH #2024)
 
 * RSA signature performance improvements (GH #2068 #2070)
 
@@ -39,7 +35,7 @@ Version 2.12.0, Not Yet Released
 
 * Modifications to support GOST 34.10-2012 signatures (GH #2055 #2056 #1860 #1897)
 
-* Add support for constant time AES using NEON and AltiVec (GH #2093 #2095 #2100)
+* Add support for constant time AES using NEON (GH #2093 #2095)
 
 * Improve performance of POWER8 AES instructions (GH #2096)
 
diff --git a/src/build-data/makefile.in b/src/build-data/makefile.in
index 242c7b95f..1bd3c83aa 100644
--- a/src/build-data/makefile.in
+++ b/src/build-data/makefile.in
@@ -13,7 +13,7 @@ PYTHON_EXE     = %{python_exe}
 
 ABI_FLAGS      = %{cc_sysroot} %{cxx_abi_flags}
 LANG_FLAGS     = %{cc_lang_flags} %{os_feature_macros}
-CXXFLAGS       = %{cc_compile_flags} -DBOTAN_IS_BEING_BUILT
+CXXFLAGS       = %{cc_compile_flags}
 WARN_FLAGS     = %{cc_warning_flags}
 LIB_FLAGS      = %{lib_flags}
 LDFLAGS        = %{ldflags}
diff --git a/src/cli/cli_rng.cpp b/src/cli/cli_rng.cpp
index 8f1cb750b..2fea7ec65 100644
--- a/src/cli/cli_rng.cpp
+++ b/src/cli/cli_rng.cpp
@@ -7,6 +7,7 @@
 #include "cli.h"
 #include <botan/rng.h>
 #include <botan/entropy_src.h>
+#include <botan/cpuid.h>
 #include <botan/hex.h>
 #include <botan/parsing.h>
 
@@ -76,7 +77,7 @@ cli_make_rng(const std::string& rng_type, const std::string& hex_drbg_seed)
 #if defined(BOTAN_HAS_RDRAND_RNG)
    if(rng_type == "rdrand" || rng_type.empty())
       {
-      if(Botan::RDRAND_RNG::available())
+      if(Botan::CPUID::has_rdrand())
          return std::unique_ptr<Botan::RandomNumberGenerator>(new Botan::RDRAND_RNG);
       else if(rng_type.empty() == false)
          throw CLI_Error("RDRAND instruction not supported on this processor");
diff --git a/src/cli/math.cpp b/src/cli/math.cpp
index 1268cd3e5..0ba709f36 100644
--- a/src/cli/math.cpp
+++ b/src/cli/math.cpp
@@ -8,6 +8,7 @@
 
 #if defined(BOTAN_HAS_NUMBERTHEORY)
 
+#include <botan/reducer.h>
 #include <botan/numthry.h>
 #include <botan/monty.h>
 #include <iterator>
diff --git a/src/cli/tls_utils.cpp b/src/cli/tls_utils.cpp
index e275ea9c1..648975250 100644
--- a/src/cli/tls_utils.cpp
+++ b/src/cli/tls_utils.cpp
@@ -11,7 +11,6 @@
 #include <botan/tls_policy.h>
 #include <botan/tls_version.h>
 #include <botan/tls_messages.h>
-#include <botan/loadstor.h>
 #include <botan/hex.h>
 #include <sstream>
 
diff --git a/src/configs/pylint.rc b/src/configs/pylint.rc
index ae9d2e24c..aea9463e6 100644
--- a/src/configs/pylint.rc
+++ b/src/configs/pylint.rc
@@ -360,7 +360,7 @@ max-statements=50
 max-parents=7
 
 # Maximum number of attributes for a class (see R0902).
-max-attributes=32
+max-attributes=15
 
 # Minimum number of public methods for a class (see R0903).
 min-public-methods=0
diff --git a/src/lib/asn1/oids.h b/src/lib/asn1/oids.h
index 1f8f88905..480e4f982 100644
--- a/src/lib/asn1/oids.h
+++ b/src/lib/asn1/oids.h
@@ -65,18 +65,12 @@ inline bool BOTAN_DEPRECATED("Use oid == OID::from_string(name)") name_of(const
    return (oid == str2oid_or_empty(name));
    }
 
-/**
-* Prefer oid2str_or_empty
-*/
-inline std::string lookup(const OID& oid)
+inline std::string BOTAN_DEPRECATED("Use oid2str_or_empty") lookup(const OID& oid)
    {
    return oid2str_or_empty(oid);
    }
 
-/**
-* Prefer str2oid_or_empty
-*/
-inline OID lookup(const std::string& name)
+inline OID BOTAN_DEPRECATED("Use str2oid_or_empty") lookup(const std::string& name)
    {
    return str2oid_or_empty(name);
    }
diff --git a/src/lib/base/buf_comp.cpp b/src/lib/base/buf_comp.cpp
deleted file mode 100644
index e9a33c9d7..000000000
--- a/src/lib/base/buf_comp.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-* (C) 2019 Jack Lloyd
-*
-* Botan is released under the Simplified BSD License (see license.txt)
-*/
-
-#include <botan/buf_comp.h>
-#include <botan/loadstor.h>
-
-namespace Botan {
-
-void Buffered_Computation::update_be(uint16_t val)
-   {
-   uint8_t inb[sizeof(val)];
-   store_be(val, inb);
-   add_data(inb, sizeof(inb));
-   }
-
-void Buffered_Computation::update_be(uint32_t val)
-   {
-   uint8_t inb[sizeof(val)];
-   store_be(val, inb);
-   add_data(inb, sizeof(inb));
-   }
-
-void Buffered_Computation::update_be(uint64_t val)
-   {
-   uint8_t inb[sizeof(val)];
-   store_be(val, inb);
-   add_data(inb, sizeof(inb));
-   }
-
-void Buffered_Computation::update_le(uint16_t val)
-   {
-   uint8_t inb[sizeof(val)];
-   store_le(val, inb);
-   add_data(inb, sizeof(inb));
-   }
-
-void Buffered_Computation::update_le(uint32_t val)
-   {
-   uint8_t inb[sizeof(val)];
-   store_le(val, inb);
-   add_data(inb, sizeof(inb));
-   }
-
-void Buffered_Computation::update_le(uint64_t val)
-   {
-   uint8_t inb[sizeof(val)];
-   store_le(val, inb);
-   add_data(inb, sizeof(inb));
-   }
-
-}
diff --git a/src/lib/base/buf_comp.h b/src/lib/base/buf_comp.h
index 31bf48529..e1971c458 100644
--- a/src/lib/base/buf_comp.h
+++ b/src/lib/base/buf_comp.h
@@ -9,6 +9,7 @@
 #define BOTAN_BUFFERED_COMPUTATION_H_
 
 #include <botan/secmem.h>
+#include <botan/loadstor.h>
 #include <string>
 
 namespace Botan {
@@ -50,13 +51,27 @@ class BOTAN_PUBLIC_API(2,0) Buffered_Computation
          add_data(in.data(), in.size());
          }
 
-      void update_be(uint16_t val);
-      void update_be(uint32_t val);
-      void update_be(uint64_t val);
+      /**
+      * Add an integer in big-endian order
+      * @param in the value
+      */
+      template<typename T> void update_be(const T in)
+         {
+         uint8_t inb[sizeof(T)];
+         store_be(in, inb);
+         add_data(inb, sizeof(inb));
+         }
 
-      void update_le(uint16_t val);
-      void update_le(uint32_t val);
-      void update_le(uint64_t val);
+      /**
+      * Add an integer in little-endian order
+      * @param in the value
+      */
+      template<typename T> void update_le(const T in)
+         {
+         uint8_t inb[sizeof(T)];
+         store_le(in, inb);
+         add_data(inb, sizeof(inb));
+         }
 
       /**
       * Add new input to process.
diff --git a/src/lib/base/scan_name.h b/src/lib/base/scan_name.h
index 069783d1b..4028ce9ab 100644
--- a/src/lib/base/scan_name.h
+++ b/src/lib/base/scan_name.h
@@ -12,8 +12,6 @@
 #include <string>
 #include <vector>
 
-BOTAN_FUTURE_INTERNAL_HEADER(scan_name.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/aes/aes.h b/src/lib/block/aes/aes.h
index 84d997d05..6083467b6 100644
--- a/src/lib/block/aes/aes.h
+++ b/src/lib/block/aes/aes.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(aes.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/aes/aes_vperm/aes_vperm.cpp b/src/lib/block/aes/aes_vperm/aes_vperm.cpp
index 811dc10b5..b7e82876c 100644
--- a/src/lib/block/aes/aes_vperm/aes_vperm.cpp
+++ b/src/lib/block/aes/aes_vperm/aes_vperm.cpp
@@ -41,15 +41,6 @@ inline SIMD_4x32 shuffle(SIMD_4x32 a, SIMD_4x32 b)
    return SIMD_4x32(vreinterpretq_u32_u8(vqtbl1q_u8(tbl, idx)));
 #endif
 
-#elif defined(BOTAN_SIMD_USE_ALTIVEC)
-   __vector unsigned char bv = (__vector unsigned char)b.raw();
-
-   const auto high_bit = vec_sl(vec_sr(bv, vec_splat_u8(7)), vec_splat_u8(4));
-   bv = vec_and(bv, vec_splat_u8(0x0F));
-   bv = vec_add(bv, high_bit);
-
-   const __vector unsigned int zero = vec_splat_u32(0);
-   return SIMD_4x32(vec_perm(a.raw(), zero, bv));
 #else
    #error "No shuffle implementation available"
 #endif
@@ -62,16 +53,6 @@ inline SIMD_4x32 shift_elems_left(SIMD_4x32 x)
    return SIMD_4x32(_mm_slli_si128(x.raw(), 4*I));
 #elif defined(BOTAN_SIMD_USE_NEON)
    return SIMD_4x32(vreinterpretq_u32_u8(vextq_u8(vdupq_n_u8(0), vreinterpretq_u8_u32(x.raw()), 16 - 4*I)));
-#elif defined(BOTAN_SIMD_USE_ALTIVEC)
-   const __vector unsigned int zero = vec_splat_u32(0);
-
-   const __vector unsigned char shuf[3] = {
-     { 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },
-     { 16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7 },
-     { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 0, 1, 2, 3 },
-   };
-
-   return SIMD_4x32(vec_perm(x.raw(), zero, shuf[I-1]));
 #else
    #error "No shift_elems_left implementation available"
 #endif
@@ -83,9 +64,6 @@ inline SIMD_4x32 alignr8(SIMD_4x32 a, SIMD_4x32 b)
    return SIMD_4x32(_mm_alignr_epi8(a.raw(), b.raw(), 8));
 #elif defined(BOTAN_SIMD_USE_NEON)
    return SIMD_4x32(vreinterpretq_u32_u8(vextq_u8(vreinterpretq_u8_u32(b.raw()), vreinterpretq_u8_u32(a.raw()), 8)));
-#elif defined(BOTAN_SIMD_USE_ALTIVEC)
-   const __vector unsigned char mask = {8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23};
-   return SIMD_4x32(vec_perm(b.raw(), a.raw(), mask));
 #else
    #error "No alignr8 implementation available"
 #endif
@@ -127,15 +105,17 @@ const SIMD_4x32 rcon[10] = {
    SIMD_4x32(0x00000083, 0x00000000, 0x00000000, 0x00000000),
 };
 
+const SIMD_4x32 lo_nibs_mask = SIMD_4x32::splat_u8(0x0F);
+const SIMD_4x32 hi_nibs_mask = SIMD_4x32::splat_u8(0xF0);
+const SIMD_4x32 xor_5B = SIMD_4x32::splat_u8(0x5B);
+
 inline SIMD_4x32 low_nibs(SIMD_4x32 x)
    {
-   const SIMD_4x32 lo_nibs_mask = SIMD_4x32::splat_u8(0x0F);
    return lo_nibs_mask & x;
    }
 
 inline SIMD_4x32 high_nibs(SIMD_4x32 x)
    {
-   const SIMD_4x32 hi_nibs_mask = SIMD_4x32::splat_u8(0xF0);
    return (hi_nibs_mask & x).shr<4>();
    }
 
@@ -438,7 +418,7 @@ SIMD_4x32 aes_schedule_mangle(SIMD_4x32 k, uint8_t round_no)
    const SIMD_4x32 mc_forward0(0x00030201, 0x04070605, 0x080B0A09, 0x0C0F0E0D);
    const SIMD_4x32 srx(sr[round_no % 4]);
 
-   SIMD_4x32 t = shuffle(k ^ SIMD_4x32::splat_u8(0x5B), mc_forward0);
+   SIMD_4x32 t = shuffle(k ^ xor_5B, mc_forward0);
    SIMD_4x32 t2 = t;
    t = shuffle(t, mc_forward0);
    t2 = t ^ t2 ^ shuffle(t, mc_forward0);
@@ -481,7 +461,7 @@ SIMD_4x32 aes_schedule_mangle_last(SIMD_4x32 k, uint8_t round_no)
    const SIMD_4x32 out_tr2(0x50BCEC00, 0x01EDBD51, 0xB05C0CE0, 0xE10D5DB1);
 
    k = shuffle(k, sr[round_no % 4]);
-   k ^= SIMD_4x32::splat_u8(0x5B);
+   k ^= xor_5B;
    return aes_schedule_transform(k, out_tr1, out_tr2);
    }
 
@@ -490,7 +470,7 @@ SIMD_4x32 aes_schedule_mangle_last_dec(SIMD_4x32 k)
    const SIMD_4x32 deskew1(0x47A4E300, 0x07E4A340, 0x5DBEF91A, 0x1DFEB95A);
    const SIMD_4x32 deskew2(0x83EA6900, 0x5F36B5DC, 0xF49D1E77, 0x2841C2AB);
 
-   k ^= SIMD_4x32::splat_u8(0x5B);
+   k ^= xor_5B;
    return aes_schedule_transform(k, deskew1, deskew2);
    }
 
@@ -498,17 +478,20 @@ SIMD_4x32 aes_schedule_round(SIMD_4x32 input1, SIMD_4x32 input2)
    {
    SIMD_4x32 smeared = input2 ^ shift_elems_left<1>(input2);
    smeared ^= shift_elems_left<2>(smeared);
-   smeared ^= SIMD_4x32::splat_u8(0x5B);
+   smeared ^= xor_5B;
 
-   const SIMD_4x32 Bh = high_nibs(input1);
-   SIMD_4x32 Bl = low_nibs(input1);
+   SIMD_4x32 t = high_nibs(input1);
+   input1 = low_nibs(input1);
 
-   const SIMD_4x32 t2 = shuffle(k_inv2, Bl);
+   SIMD_4x32 t2 = shuffle(k_inv2, input1);
 
-   Bl ^= Bh;
+   input1 ^= t;
+
+   SIMD_4x32 t3 = t2 ^ shuffle(k_inv1, t);
+   SIMD_4x32 t4 = t2 ^ shuffle(k_inv1, input1);
 
-   SIMD_4x32 t5 = Bl ^ shuffle(k_inv1, t2 ^ shuffle(k_inv1, Bh));
-   SIMD_4x32 t6 = Bh ^ shuffle(k_inv1, t2 ^ shuffle(k_inv1, Bl));
+   SIMD_4x32 t5 = input1 ^ shuffle(k_inv1, t3);
+   SIMD_4x32 t6 = t ^ shuffle(k_inv1, t4);
 
    return smeared ^ shuffle(sb1u, t5) ^ shuffle(sb1t, t6);
    }
diff --git a/src/lib/block/aes/aes_vperm/info.txt b/src/lib/block/aes/aes_vperm/info.txt
index 0b7eabaac..f771ca2c3 100644
--- a/src/lib/block/aes/aes_vperm/info.txt
+++ b/src/lib/block/aes/aes_vperm/info.txt
@@ -2,8 +2,6 @@
 AES_VPERM -> 20190901
 </defines>
 
-endian little
-
 <isa>
 x86_32:sse2
 x86_64:sse2
@@ -11,8 +9,6 @@ x86_32:ssse3
 x86_64:ssse3
 arm32:neon
 arm64:neon
-ppc32:altivec
-ppc64:altivec
 </isa>
 
 <arch>
@@ -20,8 +16,6 @@ x86_32
 x86_64
 arm32
 arm64
-ppc32
-ppc64
 </arch>
 
 <requires>
diff --git a/src/lib/block/aria/aria.h b/src/lib/block/aria/aria.h
index 507226b7d..374277686 100644
--- a/src/lib/block/aria/aria.h
+++ b/src/lib/block/aria/aria.h
@@ -18,8 +18,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(aria.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/blowfish/blowfish.h b/src/lib/block/blowfish/blowfish.h
index 3ba39cbdb..97a1b841c 100644
--- a/src/lib/block/blowfish/blowfish.h
+++ b/src/lib/block/blowfish/blowfish.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(blowfish.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/camellia/camellia.h b/src/lib/block/camellia/camellia.h
index 4995eb0c9..3d639bf77 100644
--- a/src/lib/block/camellia/camellia.h
+++ b/src/lib/block/camellia/camellia.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(camellia.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/cascade/cascade.h b/src/lib/block/cascade/cascade.h
index 26f513381..8a641fc2f 100644
--- a/src/lib/block/cascade/cascade.h
+++ b/src/lib/block/cascade/cascade.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(cascade.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/cast128/cast128.h b/src/lib/block/cast128/cast128.h
index a5f2a6401..3a1740777 100644
--- a/src/lib/block/cast128/cast128.h
+++ b/src/lib/block/cast128/cast128.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(cast128.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/cast256/cast256.h b/src/lib/block/cast256/cast256.h
index 3c3016937..798649ef7 100644
--- a/src/lib/block/cast256/cast256.h
+++ b/src/lib/block/cast256/cast256.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(cast256.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/des/des.h b/src/lib/block/des/des.h
index d8bbcfdd1..7ba563545 100644
--- a/src/lib/block/des/des.h
+++ b/src/lib/block/des/des.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(des.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/des/desx.h b/src/lib/block/des/desx.h
index 0189a9982..fa9a99663 100644
--- a/src/lib/block/des/desx.h
+++ b/src/lib/block/des/desx.h
@@ -10,8 +10,6 @@
 
 #include <botan/des.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(desx.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/gost_28147/gost_28147.h b/src/lib/block/gost_28147/gost_28147.h
index f71bb28bd..34e45779b 100644
--- a/src/lib/block/gost_28147/gost_28147.h
+++ b/src/lib/block/gost_28147/gost_28147.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(gost_28147.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/idea/idea.h b/src/lib/block/idea/idea.h
index e5e51606b..4c45a3aaa 100644
--- a/src/lib/block/idea/idea.h
+++ b/src/lib/block/idea/idea.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(idea.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/kasumi/kasumi.h b/src/lib/block/kasumi/kasumi.h
index 9ea09a103..4a3712cd2 100644
--- a/src/lib/block/kasumi/kasumi.h
+++ b/src/lib/block/kasumi/kasumi.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(kasumi.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/lion/lion.h b/src/lib/block/lion/lion.h
index fa8e9f414..846c3cd30 100644
--- a/src/lib/block/lion/lion.h
+++ b/src/lib/block/lion/lion.h
@@ -12,8 +12,6 @@
 #include <botan/stream_cipher.h>
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(lion.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/misty1/misty1.h b/src/lib/block/misty1/misty1.h
index b6c4abbd5..c63e3713e 100644
--- a/src/lib/block/misty1/misty1.h
+++ b/src/lib/block/misty1/misty1.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(misty1.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/noekeon/noekeon.h b/src/lib/block/noekeon/noekeon.h
index 9e7e4a5ff..a93266309 100644
--- a/src/lib/block/noekeon/noekeon.h
+++ b/src/lib/block/noekeon/noekeon.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(noekeon.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/seed/seed.h b/src/lib/block/seed/seed.h
index a61624313..e30293645 100644
--- a/src/lib/block/seed/seed.h
+++ b/src/lib/block/seed/seed.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(seed.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/serpent/serpent.h b/src/lib/block/serpent/serpent.h
index 64eb8a8b0..641ee0b9c 100644
--- a/src/lib/block/serpent/serpent.h
+++ b/src/lib/block/serpent/serpent.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(serpent.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/shacal2/shacal2.h b/src/lib/block/shacal2/shacal2.h
index 9a1ccff03..c4a8f2073 100644
--- a/src/lib/block/shacal2/shacal2.h
+++ b/src/lib/block/shacal2/shacal2.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(shacal2.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/sm4/sm4.h b/src/lib/block/sm4/sm4.h
index 637ffd4be..7d1d8ba98 100644
--- a/src/lib/block/sm4/sm4.h
+++ b/src/lib/block/sm4/sm4.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(sm4.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/threefish_512/threefish_512.h b/src/lib/block/threefish_512/threefish_512.h
index f3adf71a9..2e936b25f 100644
--- a/src/lib/block/threefish_512/threefish_512.h
+++ b/src/lib/block/threefish_512/threefish_512.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(threefish_512.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/twofish/twofish.h b/src/lib/block/twofish/twofish.h
index 027e2c701..8201ede76 100644
--- a/src/lib/block/twofish/twofish.h
+++ b/src/lib/block/twofish/twofish.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(twofish.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/block/xtea/xtea.h b/src/lib/block/xtea/xtea.h
index bae0bc7e6..5ec94fd05 100644
--- a/src/lib/block/xtea/xtea.h
+++ b/src/lib/block/xtea/xtea.h
@@ -10,8 +10,6 @@
 
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(xtea.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/filters/secqueue.h b/src/lib/filters/secqueue.h
index 42d2f09e2..00616f5cf 100644
--- a/src/lib/filters/secqueue.h
+++ b/src/lib/filters/secqueue.h
@@ -12,8 +12,6 @@
 #include <botan/data_src.h>
 #include <botan/filter.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(secqueue.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/blake2/blake2b.h b/src/lib/hash/blake2/blake2b.h
index 9b0b655f2..1c47e32cc 100644
--- a/src/lib/hash/blake2/blake2b.h
+++ b/src/lib/hash/blake2/blake2b.h
@@ -12,8 +12,6 @@
 #include <string>
 #include <memory>
 
-BOTAN_FUTURE_INTERNAL_HEADER(blake2b.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/checksum/adler32/adler32.h b/src/lib/hash/checksum/adler32/adler32.h
index cd84a7597..f0aac72b5 100644
--- a/src/lib/hash/checksum/adler32/adler32.h
+++ b/src/lib/hash/checksum/adler32/adler32.h
@@ -10,8 +10,6 @@
 
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(adler32.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/checksum/crc24/crc24.h b/src/lib/hash/checksum/crc24/crc24.h
index 1809740a4..cebb171f6 100644
--- a/src/lib/hash/checksum/crc24/crc24.h
+++ b/src/lib/hash/checksum/crc24/crc24.h
@@ -11,8 +11,6 @@
 
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(crc24.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/checksum/crc32/crc32.h b/src/lib/hash/checksum/crc32/crc32.h
index f712b42ca..2c24acf04 100644
--- a/src/lib/hash/checksum/crc32/crc32.h
+++ b/src/lib/hash/checksum/crc32/crc32.h
@@ -10,8 +10,6 @@
 
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(crc32.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/comb4p/comb4p.h b/src/lib/hash/comb4p/comb4p.h
index 518314c17..6e47151bd 100644
--- a/src/lib/hash/comb4p/comb4p.h
+++ b/src/lib/hash/comb4p/comb4p.h
@@ -10,8 +10,6 @@
 
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(comb4p.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/gost_3411/gost_3411.cpp b/src/lib/hash/gost_3411/gost_3411.cpp
index e3bcd2110..27773c795 100644
--- a/src/lib/hash/gost_3411/gost_3411.cpp
+++ b/src/lib/hash/gost_3411/gost_3411.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/gost_3411.h>
-#include <botan/loadstor.h>
 
 namespace Botan {
 
diff --git a/src/lib/hash/gost_3411/gost_3411.h b/src/lib/hash/gost_3411/gost_3411.h
index 51d7aa477..9bafa6828 100644
--- a/src/lib/hash/gost_3411/gost_3411.h
+++ b/src/lib/hash/gost_3411/gost_3411.h
@@ -11,8 +11,6 @@
 #include <botan/hash.h>
 #include <botan/gost_28147.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(gost_3411.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/keccak/keccak.cpp b/src/lib/hash/keccak/keccak.cpp
index b8196495c..f79a7f3ce 100644
--- a/src/lib/hash/keccak/keccak.cpp
+++ b/src/lib/hash/keccak/keccak.cpp
@@ -8,7 +8,6 @@
 #include <botan/keccak.h>
 #include <botan/sha3.h>
 #include <botan/exceptn.h>
-#include <botan/loadstor.h>
 
 namespace Botan {
 
diff --git a/src/lib/hash/keccak/keccak.h b/src/lib/hash/keccak/keccak.h
index 083d7fc5a..b6a50fb6d 100644
--- a/src/lib/hash/keccak/keccak.h
+++ b/src/lib/hash/keccak/keccak.h
@@ -14,8 +14,6 @@
 
 namespace Botan {
 
-BOTAN_FUTURE_INTERNAL_HEADER(keccak.h)
-
 /**
 * Keccak[1600], a SHA-3 candidate
 */
diff --git a/src/lib/hash/md4/md4.cpp b/src/lib/hash/md4/md4.cpp
index 9cc92e1e3..c0c3472de 100644
--- a/src/lib/hash/md4/md4.cpp
+++ b/src/lib/hash/md4/md4.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/md4.h>
-#include <botan/loadstor.h>
 #include <botan/rotate.h>
 
 namespace Botan {
diff --git a/src/lib/hash/md4/md4.h b/src/lib/hash/md4/md4.h
index 0e6f5dc08..1dd857bce 100644
--- a/src/lib/hash/md4/md4.h
+++ b/src/lib/hash/md4/md4.h
@@ -10,8 +10,6 @@
 
 #include <botan/mdx_hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(md4.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/md5/md5.cpp b/src/lib/hash/md5/md5.cpp
index 590af4641..3b9b4d281 100644
--- a/src/lib/hash/md5/md5.cpp
+++ b/src/lib/hash/md5/md5.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/md5.h>
-#include <botan/loadstor.h>
 #include <botan/rotate.h>
 
 namespace Botan {
diff --git a/src/lib/hash/md5/md5.h b/src/lib/hash/md5/md5.h
index 182145523..07d10fb7a 100644
--- a/src/lib/hash/md5/md5.h
+++ b/src/lib/hash/md5/md5.h
@@ -10,8 +10,6 @@
 
 #include <botan/mdx_hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(md5.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/mdx_hash/mdx_hash.h b/src/lib/hash/mdx_hash/mdx_hash.h
index a061e9c8a..b18c2e270 100644
--- a/src/lib/hash/mdx_hash/mdx_hash.h
+++ b/src/lib/hash/mdx_hash/mdx_hash.h
@@ -10,8 +10,6 @@
 
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(mdx_hash.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/par_hash/par_hash.h b/src/lib/hash/par_hash/par_hash.h
index 8942cfe4d..78077cc61 100644
--- a/src/lib/hash/par_hash/par_hash.h
+++ b/src/lib/hash/par_hash/par_hash.h
@@ -11,8 +11,6 @@
 #include <botan/hash.h>
 #include <vector>
 
-BOTAN_FUTURE_INTERNAL_HEADER(par_hash.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/rmd160/rmd160.cpp b/src/lib/hash/rmd160/rmd160.cpp
index 2fa8f84d0..e85feec08 100644
--- a/src/lib/hash/rmd160/rmd160.cpp
+++ b/src/lib/hash/rmd160/rmd160.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/rmd160.h>
-#include <botan/loadstor.h>
 #include <botan/rotate.h>
 
 namespace Botan {
diff --git a/src/lib/hash/rmd160/rmd160.h b/src/lib/hash/rmd160/rmd160.h
index 2ee311680..daba812d9 100644
--- a/src/lib/hash/rmd160/rmd160.h
+++ b/src/lib/hash/rmd160/rmd160.h
@@ -10,8 +10,6 @@
 
 #include <botan/mdx_hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(rmd160.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/sha1/sha160.cpp b/src/lib/hash/sha1/sha160.cpp
index 5893c5dc7..4170722b1 100644
--- a/src/lib/hash/sha1/sha160.cpp
+++ b/src/lib/hash/sha1/sha160.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/sha160.h>
-#include <botan/loadstor.h>
 #include <botan/rotate.h>
 #include <botan/cpuid.h>
 
diff --git a/src/lib/hash/sha1/sha160.h b/src/lib/hash/sha1/sha160.h
index bbab2e853..9f7035ee6 100644
--- a/src/lib/hash/sha1/sha160.h
+++ b/src/lib/hash/sha1/sha160.h
@@ -10,8 +10,6 @@
 
 #include <botan/mdx_hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(sha160.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/sha2_32/sha2_32.cpp b/src/lib/hash/sha2_32/sha2_32.cpp
index 61e98d22f..1f1ab69f4 100644
--- a/src/lib/hash/sha2_32/sha2_32.cpp
+++ b/src/lib/hash/sha2_32/sha2_32.cpp
@@ -7,7 +7,6 @@
 */
 
 #include <botan/sha2_32.h>
-#include <botan/loadstor.h>
 #include <botan/rotate.h>
 #include <botan/cpuid.h>
 
diff --git a/src/lib/hash/sha2_32/sha2_32.h b/src/lib/hash/sha2_32/sha2_32.h
index 90a059721..7a3fce9d2 100644
--- a/src/lib/hash/sha2_32/sha2_32.h
+++ b/src/lib/hash/sha2_32/sha2_32.h
@@ -11,8 +11,6 @@
 
 #include <botan/mdx_hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(sha2_32.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/sha2_32/sha2_32_bmi2/sha2_32_bmi2.cpp b/src/lib/hash/sha2_32/sha2_32_bmi2/sha2_32_bmi2.cpp
index e3194e4af..12ceb11c4 100644
--- a/src/lib/hash/sha2_32/sha2_32_bmi2/sha2_32_bmi2.cpp
+++ b/src/lib/hash/sha2_32/sha2_32_bmi2/sha2_32_bmi2.cpp
@@ -5,7 +5,6 @@
 */
 
 #include <botan/sha2_32.h>
-#include <botan/loadstor.h>
 #include <botan/rotate.h>
 
 namespace Botan {
diff --git a/src/lib/hash/sha2_64/sha2_64.cpp b/src/lib/hash/sha2_64/sha2_64.cpp
index 01abb4f00..e554b3aa5 100644
--- a/src/lib/hash/sha2_64/sha2_64.cpp
+++ b/src/lib/hash/sha2_64/sha2_64.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/sha2_64.h>
-#include <botan/loadstor.h>
 #include <botan/rotate.h>
 #include <botan/cpuid.h>
 
diff --git a/src/lib/hash/sha2_64/sha2_64.h b/src/lib/hash/sha2_64/sha2_64.h
index dc5f0dd18..ec3512dfc 100644
--- a/src/lib/hash/sha2_64/sha2_64.h
+++ b/src/lib/hash/sha2_64/sha2_64.h
@@ -10,8 +10,6 @@
 
 #include <botan/mdx_hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(sha2_64.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/sha2_64/sha2_64_bmi2/sha2_64_bmi2.cpp b/src/lib/hash/sha2_64/sha2_64_bmi2/sha2_64_bmi2.cpp
index 1ef0ecc56..202dadbbe 100644
--- a/src/lib/hash/sha2_64/sha2_64_bmi2/sha2_64_bmi2.cpp
+++ b/src/lib/hash/sha2_64/sha2_64_bmi2/sha2_64_bmi2.cpp
@@ -5,7 +5,6 @@
 */
 
 #include <botan/sha2_64.h>
-#include <botan/loadstor.h>
 #include <botan/rotate.h>
 
 namespace Botan {
diff --git a/src/lib/hash/sha3/sha3.cpp b/src/lib/hash/sha3/sha3.cpp
index 690c2b264..d01d33635 100644
--- a/src/lib/hash/sha3/sha3.cpp
+++ b/src/lib/hash/sha3/sha3.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/sha3.h>
-#include <botan/loadstor.h>
 #include <botan/rotate.h>
 #include <botan/exceptn.h>
 #include <botan/cpuid.h>
diff --git a/src/lib/hash/sha3/sha3.h b/src/lib/hash/sha3/sha3.h
index e290e60a2..310468599 100644
--- a/src/lib/hash/sha3/sha3.h
+++ b/src/lib/hash/sha3/sha3.h
@@ -12,8 +12,6 @@
 #include <botan/secmem.h>
 #include <string>
 
-BOTAN_FUTURE_INTERNAL_HEADER(sha3.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/shake/shake.h b/src/lib/hash/shake/shake.h
index c52df136b..72b8e123e 100644
--- a/src/lib/hash/shake/shake.h
+++ b/src/lib/hash/shake/shake.h
@@ -12,8 +12,6 @@
 #include <botan/secmem.h>
 #include <string>
 
-BOTAN_FUTURE_INTERNAL_HEADER(shake.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/skein/skein_512.cpp b/src/lib/hash/skein/skein_512.cpp
index edf95d596..67b02e5c1 100644
--- a/src/lib/hash/skein/skein_512.cpp
+++ b/src/lib/hash/skein/skein_512.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/skein_512.h>
-#include <botan/loadstor.h>
 #include <botan/exceptn.h>
 #include <algorithm>
 
diff --git a/src/lib/hash/skein/skein_512.h b/src/lib/hash/skein/skein_512.h
index 0bf173ceb..8bf6e3e7a 100644
--- a/src/lib/hash/skein/skein_512.h
+++ b/src/lib/hash/skein/skein_512.h
@@ -13,8 +13,6 @@
 #include <string>
 #include <memory>
 
-BOTAN_FUTURE_INTERNAL_HEADER(skin_512.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/sm3/sm3.cpp b/src/lib/hash/sm3/sm3.cpp
index cfd1409cd..4c746ce2f 100644
--- a/src/lib/hash/sm3/sm3.cpp
+++ b/src/lib/hash/sm3/sm3.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/sm3.h>
-#include <botan/loadstor.h>
 #include <botan/rotate.h>
 
 namespace Botan {
diff --git a/src/lib/hash/sm3/sm3.h b/src/lib/hash/sm3/sm3.h
index 268bd87fb..56471e7d1 100644
--- a/src/lib/hash/sm3/sm3.h
+++ b/src/lib/hash/sm3/sm3.h
@@ -10,8 +10,6 @@
 
 #include <botan/mdx_hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(sm3.h)
-
 namespace Botan {
 
 enum {
diff --git a/src/lib/hash/streebog/streebog.cpp b/src/lib/hash/streebog/streebog.cpp
index 0134daded..0e2a43b78 100644
--- a/src/lib/hash/streebog/streebog.cpp
+++ b/src/lib/hash/streebog/streebog.cpp
@@ -7,7 +7,6 @@
 */
 
 #include <botan/streebog.h>
-#include <botan/loadstor.h>
 #include <botan/exceptn.h>
 
 namespace Botan {
diff --git a/src/lib/hash/streebog/streebog.h b/src/lib/hash/streebog/streebog.h
index a573964d8..2a98beb4e 100644
--- a/src/lib/hash/streebog/streebog.h
+++ b/src/lib/hash/streebog/streebog.h
@@ -10,8 +10,6 @@
 
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(streebog.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/tiger/tiger.cpp b/src/lib/hash/tiger/tiger.cpp
index ac2038a0f..13ae4a792 100644
--- a/src/lib/hash/tiger/tiger.cpp
+++ b/src/lib/hash/tiger/tiger.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/tiger.h>
-#include <botan/loadstor.h>
 #include <botan/exceptn.h>
 
 namespace Botan {
diff --git a/src/lib/hash/tiger/tiger.h b/src/lib/hash/tiger/tiger.h
index 6e17ce83c..ef15fb16e 100644
--- a/src/lib/hash/tiger/tiger.h
+++ b/src/lib/hash/tiger/tiger.h
@@ -10,8 +10,6 @@
 
 #include <botan/mdx_hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(tiger.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/hash/whirlpool/whirlpool.cpp b/src/lib/hash/whirlpool/whirlpool.cpp
index e1ffa4f20..f78cc7572 100644
--- a/src/lib/hash/whirlpool/whirlpool.cpp
+++ b/src/lib/hash/whirlpool/whirlpool.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/whrlpool.h>
-#include <botan/loadstor.h>
 
 namespace Botan {
 
diff --git a/src/lib/hash/whirlpool/whrlpool.h b/src/lib/hash/whirlpool/whrlpool.h
index 26ee7f775..3a07ea5c5 100644
--- a/src/lib/hash/whirlpool/whrlpool.h
+++ b/src/lib/hash/whirlpool/whrlpool.h
@@ -10,8 +10,6 @@
 
 #include <botan/mdx_hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(whrlpool.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/kdf/hkdf/hkdf.cpp b/src/lib/kdf/hkdf/hkdf.cpp
index 679a2ed42..4b2ee1b3d 100644
--- a/src/lib/kdf/hkdf/hkdf.cpp
+++ b/src/lib/kdf/hkdf/hkdf.cpp
@@ -7,7 +7,6 @@
 */
 
 #include <botan/hkdf.h>
-#include <botan/loadstor.h>
 
 namespace Botan {
 
diff --git a/src/lib/kdf/hkdf/hkdf.h b/src/lib/kdf/hkdf/hkdf.h
index 4b1ed2922..cd2b13dd8 100644
--- a/src/lib/kdf/hkdf/hkdf.h
+++ b/src/lib/kdf/hkdf/hkdf.h
@@ -12,12 +12,6 @@
 #include <botan/mac.h>
 #include <botan/kdf.h>
 
-/*
-* The definitions of HKDF, HKDF_Extract, HKDF_Expand will be made internal
-* in the future. However the function hkdf_expand_label will still be defined.
-*/
-//BOTAN_FUTURE_INTERNAL_HEADER(hkdf.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/kdf/kdf1/kdf1.h b/src/lib/kdf/kdf1/kdf1.h
index 388b55251..803aae300 100644
--- a/src/lib/kdf/kdf1/kdf1.h
+++ b/src/lib/kdf/kdf1/kdf1.h
@@ -11,8 +11,6 @@
 #include <botan/kdf.h>
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(kdf1.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h b/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h
index 5f913057e..7a95a093b 100644
--- a/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h
+++ b/src/lib/kdf/kdf1_iso18033/kdf1_iso18033.h
@@ -11,8 +11,6 @@
 #include <botan/kdf.h>
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(kdf1_iso18033.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/kdf/kdf2/kdf2.h b/src/lib/kdf/kdf2/kdf2.h
index 43abbf087..2fd40e736 100644
--- a/src/lib/kdf/kdf2/kdf2.h
+++ b/src/lib/kdf/kdf2/kdf2.h
@@ -11,8 +11,6 @@
 #include <botan/kdf.h>
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(kdf2.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/kdf/prf_tls/prf_tls.h b/src/lib/kdf/prf_tls/prf_tls.h
index a8a30ee2c..3ed8db247 100644
--- a/src/lib/kdf/prf_tls/prf_tls.h
+++ b/src/lib/kdf/prf_tls/prf_tls.h
@@ -11,8 +11,6 @@
 #include <botan/kdf.h>
 #include <botan/mac.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(prf_tls.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/kdf/prf_x942/prf_x942.h b/src/lib/kdf/prf_x942/prf_x942.h
index 1987b9bc3..4b93d5966 100644
--- a/src/lib/kdf/prf_x942/prf_x942.h
+++ b/src/lib/kdf/prf_x942/prf_x942.h
@@ -11,8 +11,6 @@
 #include <botan/kdf.h>
 #include <botan/asn1_oid.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(prf_x942.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/kdf/sp800_108/sp800_108.cpp b/src/lib/kdf/sp800_108/sp800_108.cpp
index fbeae23cd..990e10386 100644
--- a/src/lib/kdf/sp800_108/sp800_108.cpp
+++ b/src/lib/kdf/sp800_108/sp800_108.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/sp800_108.h>
-#include <botan/loadstor.h>
 #include <botan/exceptn.h>
 #include <iterator>
 
diff --git a/src/lib/kdf/sp800_108/sp800_108.h b/src/lib/kdf/sp800_108/sp800_108.h
index 46f734e8e..25802f69e 100644
--- a/src/lib/kdf/sp800_108/sp800_108.h
+++ b/src/lib/kdf/sp800_108/sp800_108.h
@@ -11,8 +11,6 @@
 #include <botan/kdf.h>
 #include <botan/mac.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(sp800_108.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/kdf/sp800_56a/sp800_56a.h b/src/lib/kdf/sp800_56a/sp800_56a.h
index e83f117e2..17fd3a84b 100644
--- a/src/lib/kdf/sp800_56a/sp800_56a.h
+++ b/src/lib/kdf/sp800_56a/sp800_56a.h
@@ -13,8 +13,6 @@
 #include <botan/hash.h>
 #include <botan/mac.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(sp800_56a.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/kdf/sp800_56c/sp800_56c.h b/src/lib/kdf/sp800_56c/sp800_56c.h
index bdbdfcd9e..a6db91658 100644
--- a/src/lib/kdf/sp800_56c/sp800_56c.h
+++ b/src/lib/kdf/sp800_56c/sp800_56c.h
@@ -11,8 +11,6 @@
 #include <botan/kdf.h>
 #include <botan/mac.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(sp800_56c.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/mac/cbc_mac/cbc_mac.h b/src/lib/mac/cbc_mac/cbc_mac.h
index ed4eb2bd1..aed3a8caf 100644
--- a/src/lib/mac/cbc_mac/cbc_mac.h
+++ b/src/lib/mac/cbc_mac/cbc_mac.h
@@ -11,8 +11,6 @@
 #include <botan/mac.h>
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(cbc_mac.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/mac/cmac/cmac.h b/src/lib/mac/cmac/cmac.h
index f73167590..7f155c6bf 100644
--- a/src/lib/mac/cmac/cmac.h
+++ b/src/lib/mac/cmac/cmac.h
@@ -11,8 +11,6 @@
 #include <botan/mac.h>
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(cmac.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/mac/gmac/gmac.h b/src/lib/mac/gmac/gmac.h
index b78aeec6f..4b02ebf85 100644
--- a/src/lib/mac/gmac/gmac.h
+++ b/src/lib/mac/gmac/gmac.h
@@ -11,8 +11,6 @@
 
 #include <botan/mac.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(gmac.h)
-
 namespace Botan {
 
 class BlockCipher;
diff --git a/src/lib/mac/hmac/hmac.h b/src/lib/mac/hmac/hmac.h
index 1f2f4227d..1a6bcd6a0 100644
--- a/src/lib/mac/hmac/hmac.h
+++ b/src/lib/mac/hmac/hmac.h
@@ -11,8 +11,6 @@
 #include <botan/mac.h>
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(hmac.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/mac/poly1305/poly1305.h b/src/lib/mac/poly1305/poly1305.h
index fdd01ecd1..aa94b5807 100644
--- a/src/lib/mac/poly1305/poly1305.h
+++ b/src/lib/mac/poly1305/poly1305.h
@@ -11,8 +11,6 @@
 #include <botan/mac.h>
 #include <memory>
 
-BOTAN_FUTURE_INTERNAL_HEADER(poly1305.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/mac/siphash/siphash.cpp b/src/lib/mac/siphash/siphash.cpp
index 566d5d5de..30fe354b7 100644
--- a/src/lib/mac/siphash/siphash.cpp
+++ b/src/lib/mac/siphash/siphash.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/siphash.h>
-#include <botan/loadstor.h>
 #include <botan/rotate.h>
 
 namespace Botan {
diff --git a/src/lib/mac/siphash/siphash.h b/src/lib/mac/siphash/siphash.h
index d60df8dfc..0e05c8407 100644
--- a/src/lib/mac/siphash/siphash.h
+++ b/src/lib/mac/siphash/siphash.h
@@ -10,8 +10,6 @@
 
 #include <botan/mac.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(siphash.h)
-
 namespace Botan {
 
 class BOTAN_PUBLIC_API(2,0) SipHash final : public MessageAuthenticationCode
diff --git a/src/lib/mac/x919_mac/x919_mac.h b/src/lib/mac/x919_mac/x919_mac.h
index 3df38b9aa..3da8048e4 100644
--- a/src/lib/mac/x919_mac/x919_mac.h
+++ b/src/lib/mac/x919_mac/x919_mac.h
@@ -11,8 +11,6 @@
 #include <botan/mac.h>
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(x919_mac.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/math/bigint/bigint.cpp b/src/lib/math/bigint/bigint.cpp
index bdb0f4214..6f5f1f473 100644
--- a/src/lib/math/bigint/bigint.cpp
+++ b/src/lib/math/bigint/bigint.cpp
@@ -10,7 +10,6 @@
 #include <botan/internal/rounding.h>
 #include <botan/internal/bit_ops.h>
 #include <botan/internal/ct_utils.h>
-#include <botan/loadstor.h>
 
 namespace Botan {
 
@@ -107,12 +106,6 @@ BigInt::BigInt(RandomNumberGenerator& rng, size_t bits, bool set_high_bit)
    randomize(rng, bits, set_high_bit);
    }
 
-uint8_t BigInt::byte_at(size_t n) const
-   {
-   return get_byte(sizeof(word) - (n % sizeof(word)) - 1,
-                   word_at(n / sizeof(word)));
-   }
-
 int32_t BigInt::cmp_word(word other) const
    {
    if(is_negative())
diff --git a/src/lib/math/bigint/bigint.h b/src/lib/math/bigint/bigint.h
index ac0a57038..505bacde0 100644
--- a/src/lib/math/bigint/bigint.h
+++ b/src/lib/math/bigint/bigint.h
@@ -12,6 +12,7 @@
 #include <botan/types.h>
 #include <botan/secmem.h>
 #include <botan/exceptn.h>
+#include <botan/loadstor.h>
 #include <iosfwd>
 
 namespace Botan {
@@ -496,7 +497,11 @@ class BOTAN_PUBLIC_API(2,0) BigInt final
      * @param n the offset to get a byte from
      * @result byte at offset n
      */
-     uint8_t byte_at(size_t n) const;
+     uint8_t byte_at(size_t n) const
+        {
+        return get_byte(sizeof(word) - (n % sizeof(word)) - 1,
+                        word_at(n / sizeof(word)));
+        }
 
      /**
      * Return the word at a specified position of the internal register
diff --git a/src/lib/math/bigint/divide.h b/src/lib/math/bigint/divide.h
index deb6ffdbb..e365dabb3 100644
--- a/src/lib/math/bigint/divide.h
+++ b/src/lib/math/bigint/divide.h
@@ -10,8 +10,6 @@
 
 #include <botan/bigint.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(divide.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/math/numbertheory/curve_nistp.h b/src/lib/math/numbertheory/curve_nistp.h
index 19d1bd256..963526d5a 100644
--- a/src/lib/math/numbertheory/curve_nistp.h
+++ b/src/lib/math/numbertheory/curve_nistp.h
@@ -10,8 +10,6 @@
 
 #include <botan/bigint.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(curve_nistp.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/math/numbertheory/make_prm.cpp b/src/lib/math/numbertheory/make_prm.cpp
index 67bdcd678..7455a0049 100644
--- a/src/lib/math/numbertheory/make_prm.cpp
+++ b/src/lib/math/numbertheory/make_prm.cpp
@@ -8,7 +8,6 @@
 #include <botan/numthry.h>
 #include <botan/rng.h>
 #include <botan/internal/bit_ops.h>
-#include <botan/loadstor.h>
 #include <algorithm>
 
 namespace Botan {
diff --git a/src/lib/math/numbertheory/pow_mod.h b/src/lib/math/numbertheory/pow_mod.h
index b465013e5..d179d8c85 100644
--- a/src/lib/math/numbertheory/pow_mod.h
+++ b/src/lib/math/numbertheory/pow_mod.h
@@ -10,8 +10,6 @@
 
 #include <botan/bigint.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(pow_mod.h)
-
 namespace Botan {
 
 class Modular_Exponentiator;
diff --git a/src/lib/misc/fpe_fe1/fpe_fe1.cpp b/src/lib/misc/fpe_fe1/fpe_fe1.cpp
index 7e3dac502..98ada495a 100644
--- a/src/lib/misc/fpe_fe1/fpe_fe1.cpp
+++ b/src/lib/misc/fpe_fe1/fpe_fe1.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/fpe_fe1.h>
-#include <botan/loadstor.h>
 #include <botan/numthry.h>
 #include <botan/divide.h>
 #include <botan/reducer.h>
diff --git a/src/lib/misc/hotp/hotp.cpp b/src/lib/misc/hotp/hotp.cpp
index b92528492..9ca37c101 100644
--- a/src/lib/misc/hotp/hotp.cpp
+++ b/src/lib/misc/hotp/hotp.cpp
@@ -6,7 +6,6 @@
 */
 
 #include <botan/hotp.h>
-#include <botan/loadstor.h>
 #include <botan/exceptn.h>
 
 namespace Botan {
diff --git a/src/lib/modes/aead/ccm/ccm.h b/src/lib/modes/aead/ccm/ccm.h
index 9b4bcecbf..37d3c0c04 100644
--- a/src/lib/modes/aead/ccm/ccm.h
+++ b/src/lib/modes/aead/ccm/ccm.h
@@ -12,8 +12,6 @@
 #include <botan/aead.h>
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(ccm.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp b/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp
index 2e1d913ef..ca0c55184 100644
--- a/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp
+++ b/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp
@@ -7,7 +7,6 @@
 */
 
 #include <botan/chacha20poly1305.h>
-#include <botan/loadstor.h>
 
 namespace Botan {
 
diff --git a/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.h b/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.h
index dbba58cc9..c7ed615d6 100644
--- a/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.h
+++ b/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.h
@@ -13,8 +13,6 @@
 #include <botan/stream_cipher.h>
 #include <botan/mac.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(chacha20poly1305.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/modes/aead/eax/eax.h b/src/lib/modes/aead/eax/eax.h
index b9b02c192..84a4f3f92 100644
--- a/src/lib/modes/aead/eax/eax.h
+++ b/src/lib/modes/aead/eax/eax.h
@@ -14,8 +14,6 @@
 #include <botan/stream_cipher.h>
 #include <botan/mac.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(eax.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/modes/aead/gcm/gcm.h b/src/lib/modes/aead/gcm/gcm.h
index fe3c40572..8f27c3679 100644
--- a/src/lib/modes/aead/gcm/gcm.h
+++ b/src/lib/modes/aead/gcm/gcm.h
@@ -12,8 +12,6 @@
 #include <botan/aead.h>
 #include <botan/sym_algo.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(gcm.h)
-
 namespace Botan {
 
 class BlockCipher;
diff --git a/src/lib/modes/aead/gcm/ghash.h b/src/lib/modes/aead/gcm/ghash.h
index db4500133..fb7565134 100644
--- a/src/lib/modes/aead/gcm/ghash.h
+++ b/src/lib/modes/aead/gcm/ghash.h
@@ -10,8 +10,6 @@
 
 #include <botan/sym_algo.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(ghash.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/modes/aead/ocb/ocb.h b/src/lib/modes/aead/ocb/ocb.h
index d38122593..173af3704 100644
--- a/src/lib/modes/aead/ocb/ocb.h
+++ b/src/lib/modes/aead/ocb/ocb.h
@@ -11,8 +11,6 @@
 
 #include <botan/aead.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(ocb.h)
-
 namespace Botan {
 
 class BlockCipher;
diff --git a/src/lib/modes/aead/siv/siv.h b/src/lib/modes/aead/siv/siv.h
index 44e0a6bf9..4d9a30222 100644
--- a/src/lib/modes/aead/siv/siv.h
+++ b/src/lib/modes/aead/siv/siv.h
@@ -12,8 +12,6 @@
 #include <botan/aead.h>
 #include <botan/stream_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(siv.h)
-
 namespace Botan {
 
 class BlockCipher;
diff --git a/src/lib/modes/cbc/cbc.h b/src/lib/modes/cbc/cbc.h
index 7a488dbd5..aaa425712 100644
--- a/src/lib/modes/cbc/cbc.h
+++ b/src/lib/modes/cbc/cbc.h
@@ -13,8 +13,6 @@
 #include <botan/block_cipher.h>
 #include <botan/mode_pad.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(cbc.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/modes/cfb/cfb.h b/src/lib/modes/cfb/cfb.h
index 1f9e55487..eddc2a121 100644
--- a/src/lib/modes/cfb/cfb.h
+++ b/src/lib/modes/cfb/cfb.h
@@ -12,8 +12,6 @@
 #include <botan/cipher_mode.h>
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(cfb.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/modes/mode_pad/mode_pad.h b/src/lib/modes/mode_pad/mode_pad.h
index b0e4a3cfa..25e4221af 100644
--- a/src/lib/modes/mode_pad/mode_pad.h
+++ b/src/lib/modes/mode_pad/mode_pad.h
@@ -12,8 +12,6 @@
 #include <botan/secmem.h>
 #include <string>
 
-BOTAN_FUTURE_INTERNAL_HEADER(mode_pad.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/modes/stream_mode.h b/src/lib/modes/stream_mode.h
index da3fc38cf..3bce01731 100644
--- a/src/lib/modes/stream_mode.h
+++ b/src/lib/modes/stream_mode.h
@@ -14,8 +14,6 @@
    #include <botan/stream_cipher.h>
 #endif
 
-BOTAN_FUTURE_INTERNAL_HEADER(stream_mode.h)
-
 namespace Botan {
 
 #if defined(BOTAN_HAS_STREAM_CIPHER)
diff --git a/src/lib/modes/xts/xts.h b/src/lib/modes/xts/xts.h
index e64a6de9f..1fd86b2f4 100644
--- a/src/lib/modes/xts/xts.h
+++ b/src/lib/modes/xts/xts.h
@@ -12,8 +12,6 @@
 #include <botan/cipher_mode.h>
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(xts.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pbkdf/argon2/argon2.cpp b/src/lib/pbkdf/argon2/argon2.cpp
index 0d767e04e..05b1e9c48 100644
--- a/src/lib/pbkdf/argon2/argon2.cpp
+++ b/src/lib/pbkdf/argon2/argon2.cpp
@@ -5,7 +5,6 @@
 */
 
 #include <botan/argon2.h>
-#include <botan/loadstor.h>
 #include <botan/hash.h>
 #include <botan/mem_ops.h>
 #include <botan/rotate.h>
@@ -27,23 +26,23 @@ secure_vector<uint8_t> argon2_H0(HashFunction& blake2b,
    {
    const uint8_t v = 19; // Argon2 version code
 
-   blake2b.update_le(static_cast<uint32_t>(p));
-   blake2b.update_le(static_cast<uint32_t>(output_len));
-   blake2b.update_le(static_cast<uint32_t>(M));
-   blake2b.update_le(static_cast<uint32_t>(t));
-   blake2b.update_le(static_cast<uint32_t>(v));
-   blake2b.update_le(static_cast<uint32_t>(y));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(p));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(output_len));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(M));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(t));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(v));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(y));
 
-   blake2b.update_le(static_cast<uint32_t>(password_len));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(password_len));
    blake2b.update(cast_char_ptr_to_uint8(password), password_len);
 
-   blake2b.update_le(static_cast<uint32_t>(salt_len));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(salt_len));
    blake2b.update(salt, salt_len);
 
-   blake2b.update_le(static_cast<uint32_t>(key_len));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(key_len));
    blake2b.update(key, key_len);
 
-   blake2b.update_le(static_cast<uint32_t>(ad_len));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(ad_len));
    blake2b.update(ad, ad_len);
 
    return blake2b.final();
@@ -58,10 +57,10 @@ void Htick(secure_vector<uint8_t>& T,
    {
    BOTAN_ASSERT_NOMSG(output_len % 64 == 0);
 
-   blake2b.update_le(static_cast<uint32_t>(output_len));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(output_len));
    blake2b.update(H0);
-   blake2b.update_le(static_cast<uint32_t>(p0));
-   blake2b.update_le(static_cast<uint32_t>(p1));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(p0));
+   blake2b.update_le<uint32_t>(static_cast<uint32_t>(p1));
 
    blake2b.final(&T[0]);
 
diff --git a/src/lib/pbkdf/argon2/argon2.h b/src/lib/pbkdf/argon2/argon2.h
index 468a44f94..a6fa03314 100644
--- a/src/lib/pbkdf/argon2/argon2.h
+++ b/src/lib/pbkdf/argon2/argon2.h
@@ -11,8 +11,6 @@
 
 namespace Botan {
 
-BOTAN_FUTURE_INTERNAL_HEADER(argon2.h)
-
 class RandomNumberGenerator;
 
 /**
diff --git a/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.cpp b/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.cpp
index 2f2c77025..36501b4cb 100644
--- a/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.cpp
+++ b/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.cpp
@@ -5,7 +5,6 @@
 */
 
 #include <botan/bcrypt_pbkdf.h>
-#include <botan/loadstor.h>
 #include <botan/blowfish.h>
 #include <botan/hash.h>
 #include <botan/internal/timer.h>
diff --git a/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.h b/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.h
index 0d459e8db..5f0f9e80f 100644
--- a/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.h
+++ b/src/lib/pbkdf/bcrypt_pbkdf/bcrypt_pbkdf.h
@@ -9,8 +9,6 @@
 
 #include <botan/pwdhash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(bcrypt_pbkdf.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pbkdf/pbkdf1/pbkdf1.h b/src/lib/pbkdf/pbkdf1/pbkdf1.h
index f5e95b836..74b2644f6 100644
--- a/src/lib/pbkdf/pbkdf1/pbkdf1.h
+++ b/src/lib/pbkdf/pbkdf1/pbkdf1.h
@@ -11,8 +11,6 @@
 #include <botan/pbkdf.h>
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(pbkdf1.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pbkdf/pbkdf2/pbkdf2.h b/src/lib/pbkdf/pbkdf2/pbkdf2.h
index 9f90799c4..65955eb28 100644
--- a/src/lib/pbkdf/pbkdf2/pbkdf2.h
+++ b/src/lib/pbkdf/pbkdf2/pbkdf2.h
@@ -13,8 +13,6 @@
 #include <botan/pwdhash.h>
 #include <botan/mac.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(pbkdf2.h)
-
 namespace Botan {
 
 BOTAN_PUBLIC_API(2,0) size_t pbkdf2(MessageAuthenticationCode& prf,
diff --git a/src/lib/pbkdf/pgp_s2k/pgp_s2k.h b/src/lib/pbkdf/pgp_s2k/pgp_s2k.h
index 7fda724c2..4ce934a2b 100644
--- a/src/lib/pbkdf/pgp_s2k/pgp_s2k.h
+++ b/src/lib/pbkdf/pgp_s2k/pgp_s2k.h
@@ -13,14 +13,6 @@
 #include <botan/pwdhash.h>
 #include <botan/hash.h>
 
-/*
-This header will not be fully internal - the RFC4880 count
-encoding functions will remain here. But the definition of
-OpenPGP_S2K will be made internal
-*/
-
-//BOTAN_FUTURE_INTERNAL_HEADER(pgp_s2k.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pbkdf/scrypt/scrypt.h b/src/lib/pbkdf/scrypt/scrypt.h
index 1af59b6a5..83a3b0cca 100644
--- a/src/lib/pbkdf/scrypt/scrypt.h
+++ b/src/lib/pbkdf/scrypt/scrypt.h
@@ -10,8 +10,6 @@
 
 #include <botan/pwdhash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(scrypt.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pk_pad/eme.h b/src/lib/pk_pad/eme.h
index 38cce4b09..659d2ecc9 100644
--- a/src/lib/pk_pad/eme.h
+++ b/src/lib/pk_pad/eme.h
@@ -11,8 +11,6 @@
 #include <botan/secmem.h>
 #include <string>
 
-BOTAN_FUTURE_INTERNAL_HEADER(eme.h)
-
 namespace Botan {
 
 class RandomNumberGenerator;
diff --git a/src/lib/pk_pad/eme_oaep/oaep.h b/src/lib/pk_pad/eme_oaep/oaep.h
index 383617b82..4bb12d27e 100644
--- a/src/lib/pk_pad/eme_oaep/oaep.h
+++ b/src/lib/pk_pad/eme_oaep/oaep.h
@@ -11,8 +11,6 @@
 #include <botan/eme.h>
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(oaep.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pk_pad/eme_pkcs1/eme_pkcs.h b/src/lib/pk_pad/eme_pkcs1/eme_pkcs.h
index fb7cf1419..26b03e47a 100644
--- a/src/lib/pk_pad/eme_pkcs1/eme_pkcs.h
+++ b/src/lib/pk_pad/eme_pkcs1/eme_pkcs.h
@@ -10,8 +10,6 @@
 
 #include <botan/eme.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(eme_pkcs.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pk_pad/eme_raw/eme_raw.h b/src/lib/pk_pad/eme_raw/eme_raw.h
index 840448c55..d736a80bb 100644
--- a/src/lib/pk_pad/eme_raw/eme_raw.h
+++ b/src/lib/pk_pad/eme_raw/eme_raw.h
@@ -9,8 +9,6 @@
 
 #include <botan/eme.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(eme_raw.h)
-
 namespace Botan {
 
 class BOTAN_PUBLIC_API(2,0) EME_Raw final : public EME
diff --git a/src/lib/pk_pad/emsa.h b/src/lib/pk_pad/emsa.h
index 06c18a488..019047045 100644
--- a/src/lib/pk_pad/emsa.h
+++ b/src/lib/pk_pad/emsa.h
@@ -12,8 +12,6 @@
 #include <botan/alg_id.h>
 #include <string>
 
-BOTAN_FUTURE_INTERNAL_HEADER(emsa.h)
-
 namespace Botan {
 
 class Private_Key;
diff --git a/src/lib/pk_pad/emsa1/emsa1.h b/src/lib/pk_pad/emsa1/emsa1.h
index 76736bc27..7b4d027da 100644
--- a/src/lib/pk_pad/emsa1/emsa1.h
+++ b/src/lib/pk_pad/emsa1/emsa1.h
@@ -11,8 +11,6 @@
 #include <botan/emsa.h>
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(emsa1.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pk_pad/emsa_pkcs1/emsa_pkcs1.h b/src/lib/pk_pad/emsa_pkcs1/emsa_pkcs1.h
index 5b9cf7aea..31032320e 100644
--- a/src/lib/pk_pad/emsa_pkcs1/emsa_pkcs1.h
+++ b/src/lib/pk_pad/emsa_pkcs1/emsa_pkcs1.h
@@ -11,8 +11,6 @@
 #include <botan/emsa.h>
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(emsa_pkcs1.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pk_pad/emsa_pssr/pssr.h b/src/lib/pk_pad/emsa_pssr/pssr.h
index 47efacb51..fa0ae1228 100644
--- a/src/lib/pk_pad/emsa_pssr/pssr.h
+++ b/src/lib/pk_pad/emsa_pssr/pssr.h
@@ -11,8 +11,6 @@
 #include <botan/emsa.h>
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(pssr.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pk_pad/emsa_raw/emsa_raw.h b/src/lib/pk_pad/emsa_raw/emsa_raw.h
index dc01b94a2..3bac4ef67 100644
--- a/src/lib/pk_pad/emsa_raw/emsa_raw.h
+++ b/src/lib/pk_pad/emsa_raw/emsa_raw.h
@@ -10,8 +10,6 @@
 
 #include <botan/emsa.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(emsa_raw.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pk_pad/emsa_x931/emsa_x931.h b/src/lib/pk_pad/emsa_x931/emsa_x931.h
index a2fef0468..e20d303b6 100644
--- a/src/lib/pk_pad/emsa_x931/emsa_x931.h
+++ b/src/lib/pk_pad/emsa_x931/emsa_x931.h
@@ -11,8 +11,6 @@
 #include <botan/emsa.h>
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(emsa_x931.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pk_pad/hash_id/hash_id.h b/src/lib/pk_pad/hash_id/hash_id.h
index 3c2eba791..75c86c0c6 100644
--- a/src/lib/pk_pad/hash_id/hash_id.h
+++ b/src/lib/pk_pad/hash_id/hash_id.h
@@ -11,8 +11,6 @@
 #include <botan/secmem.h>
 #include <string>
 
-BOTAN_FUTURE_INTERNAL_HEADER(hash_id)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pk_pad/iso9796/iso9796.h b/src/lib/pk_pad/iso9796/iso9796.h
index 9782e53b2..7af9a269b 100644
--- a/src/lib/pk_pad/iso9796/iso9796.h
+++ b/src/lib/pk_pad/iso9796/iso9796.h
@@ -11,8 +11,6 @@
 #include <botan/emsa.h>
 #include <botan/hash.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(iso9796.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pubkey/blinding.h b/src/lib/pubkey/blinding.h
index 988a41a35..1bdd235f0 100644
--- a/src/lib/pubkey/blinding.h
+++ b/src/lib/pubkey/blinding.h
@@ -12,8 +12,6 @@
 #include <botan/reducer.h>
 #include <functional>
 
-BOTAN_FUTURE_INTERNAL_HEADER(blinding.h)
-
 namespace Botan {
 
 class RandomNumberGenerator;
diff --git a/src/lib/pubkey/ec_group/curve_gfp.h b/src/lib/pubkey/ec_group/curve_gfp.h
index 158f7f8c8..fe7a0a54d 100644
--- a/src/lib/pubkey/ec_group/curve_gfp.h
+++ b/src/lib/pubkey/ec_group/curve_gfp.h
@@ -13,9 +13,6 @@
 #include <botan/bigint.h>
 #include <memory>
 
-// Currently exposed in PointGFp
-//BOTAN_FUTURE_INTERNAL_HEADER(curve_gfp.h)
-
 namespace Botan {
 
 class BOTAN_UNSTABLE_API CurveGFp_Repr
diff --git a/src/lib/pubkey/keypair/keypair.h b/src/lib/pubkey/keypair/keypair.h
index 6900faa35..4f28f325f 100644
--- a/src/lib/pubkey/keypair/keypair.h
+++ b/src/lib/pubkey/keypair/keypair.h
@@ -10,8 +10,6 @@
 
 #include <botan/pk_keys.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(keypair.h)
-
 namespace Botan {
 
 namespace KeyPair {
diff --git a/src/lib/pubkey/mce/gf2m_small_m.h b/src/lib/pubkey/mce/gf2m_small_m.h
index 9acc50c72..a74094930 100644
--- a/src/lib/pubkey/mce/gf2m_small_m.h
+++ b/src/lib/pubkey/mce/gf2m_small_m.h
@@ -12,11 +12,8 @@
 #ifndef BOTAN_GF2M_SMALL_M_H_
 #define BOTAN_GF2M_SMALL_M_H_
 
-#include <botan/types.h>
 #include <vector>
-
-// fixme - still used in mceliece.h
-//BOTAN_FUTURE_INTERNAL_HEADER(gf2m_small_m.h)
+#include <botan/types.h>
 
 namespace Botan {
 
diff --git a/src/lib/pubkey/mce/polyn_gf2m.h b/src/lib/pubkey/mce/polyn_gf2m.h
index e4d3d4d1c..f2d3ac53c 100644
--- a/src/lib/pubkey/mce/polyn_gf2m.h
+++ b/src/lib/pubkey/mce/polyn_gf2m.h
@@ -17,8 +17,6 @@
 #include <utility>
 #include <string>
 
-//BOTAN_FUTURE_INTERNAL_HEADER(polyn_gf2m.h)
-
 namespace Botan {
 
 class RandomNumberGenerator;
diff --git a/src/lib/pubkey/pbes2/pbes2.h b/src/lib/pubkey/pbes2/pbes2.h
index daa9ac580..bc56abd97 100644
--- a/src/lib/pubkey/pbes2/pbes2.h
+++ b/src/lib/pubkey/pbes2/pbes2.h
@@ -11,8 +11,6 @@
 #include <botan/alg_id.h>
 #include <chrono>
 
-BOTAN_FUTURE_INTERNAL_HEADER(pbes2.h)
-
 namespace Botan {
 
 class RandomNumberGenerator;
diff --git a/src/lib/pubkey/rfc6979/rfc6979.h b/src/lib/pubkey/rfc6979/rfc6979.h
index 54134a682..d78effc26 100644
--- a/src/lib/pubkey/rfc6979/rfc6979.h
+++ b/src/lib/pubkey/rfc6979/rfc6979.h
@@ -12,8 +12,6 @@
 #include <string>
 #include <memory>
 
-BOTAN_FUTURE_INTERNAL_HEADER(rfc6979.h)
-
 namespace Botan {
 
 class HMAC_DRBG;
diff --git a/src/lib/pubkey/sm2/sm2.cpp b/src/lib/pubkey/sm2/sm2.cpp
index a976c097b..5ffd547cf 100644
--- a/src/lib/pubkey/sm2/sm2.cpp
+++ b/src/lib/pubkey/sm2/sm2.cpp
@@ -9,7 +9,6 @@
 #include <botan/sm2.h>
 #include <botan/internal/pk_ops_impl.h>
 #include <botan/internal/point_mul.h>
-#include <botan/loadstor.h>
 #include <botan/numthry.h>
 #include <botan/keypair.h>
 #include <botan/hash.h>
diff --git a/src/lib/pubkey/xmss/atomic.h b/src/lib/pubkey/xmss/atomic.h
index a542d4c00..d2e65c104 100644
--- a/src/lib/pubkey/xmss/atomic.h
+++ b/src/lib/pubkey/xmss/atomic.h
@@ -8,12 +8,9 @@
 #ifndef BOTAN_ATOMIC_H_
 #define BOTAN_ATOMIC_H_
 
-#include <botan/types.h>
 #include <atomic>
 #include <memory>
 
-//BOTAN_FUTURE_INTERNAL_HEADER(atomic.h)
-
 namespace Botan {
 
 template <typename T>
diff --git a/src/lib/pubkey/xmss/xmss_common_ops.h b/src/lib/pubkey/xmss/xmss_common_ops.h
index f3c59f85f..065a727d9 100644
--- a/src/lib/pubkey/xmss/xmss_common_ops.h
+++ b/src/lib/pubkey/xmss/xmss_common_ops.h
@@ -14,8 +14,6 @@
 #include <botan/xmss_address.h>
 #include <botan/xmss_hash.h>
 
-//BOTAN_FUTURE_INTERNAL_HEADER(xmss_common_ops.h)
-
 namespace Botan {
 
 typedef std::vector<secure_vector<uint8_t>> wots_keysig_t;
diff --git a/src/lib/pubkey/xmss/xmss_hash.h b/src/lib/pubkey/xmss/xmss_hash.h
index 5d8cbab53..f45432d59 100644
--- a/src/lib/pubkey/xmss/xmss_hash.h
+++ b/src/lib/pubkey/xmss/xmss_hash.h
@@ -10,8 +10,6 @@
 
 #include <botan/hash.h>
 
-//BOTAN_FUTURE_INTERNAL_HEADER(xmss_hash.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pubkey/xmss/xmss_index_registry.h b/src/lib/pubkey/xmss/xmss_index_registry.h
index 6ec9137d3..27a68631a 100644
--- a/src/lib/pubkey/xmss/xmss_index_registry.h
+++ b/src/lib/pubkey/xmss/xmss_index_registry.h
@@ -12,8 +12,6 @@
 #include <botan/atomic.h>
 #include <botan/mutex.h>
 
-//BOTAN_FUTURE_INTERNAL_HEADER(xmss_index_registry.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pubkey/xmss/xmss_key_pair.h b/src/lib/pubkey/xmss/xmss_key_pair.h
index 3b586cfd4..2e7cc06da 100644
--- a/src/lib/pubkey/xmss/xmss_key_pair.h
+++ b/src/lib/pubkey/xmss/xmss_key_pair.h
@@ -8,13 +8,12 @@
 #ifndef BOTAN_XMSS_KEY_PAIR_H_
 #define BOTAN_XMSS_KEY_PAIR_H_
 
+#include <botan/botan.h>
 #include <botan/xmss_parameters.h>
 #include <botan/xmss_wots_parameters.h>
 #include <botan/xmss_publickey.h>
 #include <botan/xmss_privatekey.h>
 
-BOTAN_DEPRECATED_HEADER(xmss_key_pair.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/pubkey/xmss/xmss_tools.h b/src/lib/pubkey/xmss/xmss_tools.h
index 81d17f5bf..bbd31fd9f 100644
--- a/src/lib/pubkey/xmss/xmss_tools.h
+++ b/src/lib/pubkey/xmss/xmss_tools.h
@@ -13,8 +13,6 @@
 #include <iterator>
 #include <type_traits>
 
-//BOTAN_FUTURE_INTERNAL_HEADER(xmss_tools.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/stream/chacha/chacha.h b/src/lib/stream/chacha/chacha.h
index 1749127f2..261d950bd 100644
--- a/src/lib/stream/chacha/chacha.h
+++ b/src/lib/stream/chacha/chacha.h
@@ -10,8 +10,6 @@
 
 #include <botan/stream_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(chacha.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/stream/ctr/ctr.cpp b/src/lib/stream/ctr/ctr.cpp
index ca187ea47..f1d8d97b8 100644
--- a/src/lib/stream/ctr/ctr.cpp
+++ b/src/lib/stream/ctr/ctr.cpp
@@ -141,27 +141,31 @@ void CTR_BE::add_counter(const uint64_t counter)
 
    if(ctr_size == 4)
       {
-      const size_t off = (BS - 4);
-      const uint32_t low32 = static_cast<uint32_t>(counter + load_be<uint32_t>(&m_counter[off], 0));
+      size_t off = (BS - 4);
+      uint32_t low32 = static_cast<uint32_t>(counter + load_be<uint32_t>(&m_counter[off], 0));
 
       for(size_t i = 0; i != ctr_blocks; ++i)
          {
-         store_be(uint32_t(low32 + i), &m_counter[i*BS+off]);
+         store_be(low32, &m_counter[off]);
+         off += BS;
+         low32 += 1;
          }
       }
    else if(ctr_size == 8)
       {
-      const size_t off = (BS - 8);
-      const uint64_t low64 = counter + load_be<uint64_t>(&m_counter[off], 0);
+      size_t off = (BS - 8);
+      uint64_t low64 = counter + load_be<uint64_t>(&m_counter[off], 0);
 
       for(size_t i = 0; i != ctr_blocks; ++i)
          {
-         store_be(uint64_t(low64 + i), &m_counter[i*BS+off]);
+         store_be(low64, &m_counter[off]);
+         off += BS;
+         low64 += 1;
          }
       }
    else if(ctr_size == 16)
       {
-      const size_t off = (BS - 16);
+      size_t off = (BS - 16);
       uint64_t b0 = load_be<uint64_t>(&m_counter[off], 0);
       uint64_t b1 = load_be<uint64_t>(&m_counter[off], 1);
       b1 += counter;
@@ -169,8 +173,9 @@ void CTR_BE::add_counter(const uint64_t counter)
 
       for(size_t i = 0; i != ctr_blocks; ++i)
          {
-         store_be(b0, &m_counter[i*BS+off]);
-         store_be(b1, &m_counter[i*BS+off+8]);
+         store_be(b0, &m_counter[off]);
+         store_be(b1, &m_counter[off+8]);
+         off += BS;
          b1 += 1;
          b0 += (b1 == 0); // carry
          }
diff --git a/src/lib/stream/ctr/ctr.h b/src/lib/stream/ctr/ctr.h
index 0687c606e..79911b2fe 100644
--- a/src/lib/stream/ctr/ctr.h
+++ b/src/lib/stream/ctr/ctr.h
@@ -11,8 +11,6 @@
 #include <botan/block_cipher.h>
 #include <botan/stream_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(ctr.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/stream/ofb/ofb.h b/src/lib/stream/ofb/ofb.h
index 994d3d198..1e9866c64 100644
--- a/src/lib/stream/ofb/ofb.h
+++ b/src/lib/stream/ofb/ofb.h
@@ -11,8 +11,6 @@
 #include <botan/stream_cipher.h>
 #include <botan/block_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(ofb.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/stream/rc4/rc4.h b/src/lib/stream/rc4/rc4.h
index eff3c568d..d59ce01f0 100644
--- a/src/lib/stream/rc4/rc4.h
+++ b/src/lib/stream/rc4/rc4.h
@@ -11,8 +11,6 @@
 #include <botan/stream_cipher.h>
 #include <botan/types.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(rc4.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/stream/salsa20/salsa20.h b/src/lib/stream/salsa20/salsa20.h
index 6ad0da770..0870c9fd2 100644
--- a/src/lib/stream/salsa20/salsa20.h
+++ b/src/lib/stream/salsa20/salsa20.h
@@ -10,8 +10,6 @@
 
 #include <botan/stream_cipher.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(salsa20.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/stream/shake_cipher/shake_cipher.h b/src/lib/stream/shake_cipher/shake_cipher.h
index 85eaec2a8..492341a7c 100644
--- a/src/lib/stream/shake_cipher/shake_cipher.h
+++ b/src/lib/stream/shake_cipher/shake_cipher.h
@@ -11,8 +11,6 @@
 #include <botan/stream_cipher.h>
 #include <botan/secmem.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(shake_cipher.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/tls/tls_algos.h b/src/lib/tls/tls_algos.h
index 3b0be8128..4852a4349 100644
--- a/src/lib/tls/tls_algos.h
+++ b/src/lib/tls/tls_algos.h
@@ -11,8 +11,6 @@
 #include <string>
 #include <vector>
 
-//BOTAN_FUTURE_INTERNAL_HEADER(tls_algos.h)
-
 namespace Botan {
 
 namespace TLS {
diff --git a/src/lib/tls/tls_cbc/tls_cbc.cpp b/src/lib/tls/tls_cbc/tls_cbc.cpp
index a23fa8595..b23718d89 100644
--- a/src/lib/tls/tls_cbc/tls_cbc.cpp
+++ b/src/lib/tls/tls_cbc/tls_cbc.cpp
@@ -13,7 +13,6 @@
 
 #include <botan/internal/rounding.h>
 #include <botan/internal/ct_utils.h>
-#include <botan/loadstor.h>
 #include <botan/tls_alert.h>
 #include <botan/tls_exceptn.h>
 
diff --git a/src/lib/tls/tls_handshake_io.cpp b/src/lib/tls/tls_handshake_io.cpp
index 7f9e2c86c..6e2bf0284 100644
--- a/src/lib/tls/tls_handshake_io.cpp
+++ b/src/lib/tls/tls_handshake_io.cpp
@@ -10,7 +10,6 @@
 #include <botan/internal/tls_seq_numbers.h>
 #include <botan/tls_messages.h>
 #include <botan/exceptn.h>
-#include <botan/loadstor.h>
 #include <chrono>
 
 namespace Botan {
diff --git a/src/lib/tls/tls_magic.h b/src/lib/tls/tls_magic.h
index 49d69c7d8..48bb34f4a 100644
--- a/src/lib/tls/tls_magic.h
+++ b/src/lib/tls/tls_magic.h
@@ -8,10 +8,6 @@
 #ifndef BOTAN_TLS_PROTOCOL_MAGIC_H_
 #define BOTAN_TLS_PROTOCOL_MAGIC_H_
 
-#include <botan/types.h>
-
-//BOTAN_FUTURE_INTERNAL_HEADER(tls_magic.h)
-
 namespace Botan {
 
 namespace TLS {
diff --git a/src/lib/tls/tls_version.h b/src/lib/tls/tls_version.h
index 18e2c0f65..4d56f94ca 100644
--- a/src/lib/tls/tls_version.h
+++ b/src/lib/tls/tls_version.h
@@ -8,7 +8,7 @@
 #ifndef BOTAN_TLS_PROTOCOL_VERSION_H_
 #define BOTAN_TLS_PROTOCOL_VERSION_H_
 
-#include <botan/types.h>
+#include <botan/loadstor.h>
 #include <string>
 
 namespace Botan {
@@ -76,12 +76,12 @@ class BOTAN_PUBLIC_API(2,0) Protocol_Version final
       /**
       * @return major version of the protocol version
       */
-      uint8_t major_version() const { return static_cast<uint8_t>(m_version >> 8); }
+      uint8_t major_version() const { return get_byte(0, m_version); }
 
       /**
       * @return minor version of the protocol version
       */
-      uint8_t minor_version() const { return static_cast<uint8_t>(m_version & 0xFF); }
+      uint8_t minor_version() const { return get_byte(1, m_version); }
 
       /**
       * @return the version code
diff --git a/src/lib/utils/bswap.h b/src/lib/utils/bswap.h
index 584fa3323..02f63c64e 100644
--- a/src/lib/utils/bswap.h
+++ b/src/lib/utils/bswap.h
@@ -15,8 +15,6 @@
   #include <stdlib.h>
 #endif
 
-BOTAN_FUTURE_INTERNAL_HEADER(bswap.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/utils/charset.h b/src/lib/utils/charset.h
index 6e7ce30c9..4913f0a5a 100644
--- a/src/lib/utils/charset.h
+++ b/src/lib/utils/charset.h
@@ -11,8 +11,6 @@
 #include <botan/types.h>
 #include <string>
 
-BOTAN_FUTURE_INTERNAL_HEADER(charset.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/utils/compiler.h b/src/lib/utils/compiler.h
index a38bffb5d..2da40b665 100644
--- a/src/lib/utils/compiler.h
+++ b/src/lib/utils/compiler.h
@@ -103,26 +103,14 @@
     #define BOTAN_DEPRECATED(msg) __attribute__ ((deprecated))
     #define BOTAN_DEPRECATED_HEADER(hdr) _Pragma("message \"this header is deprecated\"")
 
-    #if !defined(BOTAN_IS_BEING_BUILT)
-      #define BOTAN_FUTURE_INTERNAL_HEADER(hdr) _Pragma("message \"this header will be made internal in the future\"")
-    #endif
-
   #elif defined(_MSC_VER)
     #define BOTAN_DEPRECATED(msg) __declspec(deprecated(msg))
     #define BOTAN_DEPRECATED_HEADER(hdr) __pragma("message \"this header is deprecated\"")
 
-    #if !defined(BOTAN_IS_BEING_BUILT)
-      #define BOTAN_FUTURE_INTERNAL_HEADER(hdr) __pragma("message \"this header will be made internal in the future\"")
-    #endif
-
   #elif defined(__GNUC__)
     /* msg supported since GCC 4.5, earliest we support is 4.8 */
     #define BOTAN_DEPRECATED(msg) __attribute__ ((deprecated(msg)))
     #define BOTAN_DEPRECATED_HEADER(hdr) _Pragma("GCC warning \"this header is deprecated\"")
-
-    #if !defined(BOTAN_IS_BEING_BUILT)
-      #define BOTAN_FUTURE_INTERNAL_HEADER(hdr) _Pragma("GCC warning \"this header will be made internal in the future\"")
-    #endif
   #endif
 
 #endif
@@ -135,10 +123,6 @@
   #define BOTAN_DEPRECATED_HEADER(hdr)
 #endif
 
-#if !defined(BOTAN_FUTURE_INTERNAL_HEADER)
-  #define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
-#endif
-
 /*
 * Define BOTAN_NORETURN
 */
diff --git a/src/lib/utils/cpuid/cpuid.h b/src/lib/utils/cpuid/cpuid.h
index bd8c8d95f..d998d5364 100644
--- a/src/lib/utils/cpuid/cpuid.h
+++ b/src/lib/utils/cpuid/cpuid.h
@@ -13,8 +13,6 @@
 #include <string>
 #include <iosfwd>
 
-BOTAN_FUTURE_INTERNAL_HEADER(cpuid.h)
-
 namespace Botan {
 
 /**
@@ -327,8 +325,6 @@ class BOTAN_PUBLIC_API(2,1) CPUID final
          return has_ssse3();
 #elif defined(BOTAN_TARGET_CPU_IS_ARM_FAMILY)
          return has_neon();
-#elif defined(BOTAN_TARGET_CPU_IS_PPC_FAMILY)
-         return has_altivec();
 #else
          return false;
 #endif
diff --git a/src/lib/utils/http_util/http_util.h b/src/lib/utils/http_util/http_util.h
index 0eeda60f1..92a67e42b 100644
--- a/src/lib/utils/http_util/http_util.h
+++ b/src/lib/utils/http_util/http_util.h
@@ -16,8 +16,6 @@
 #include <functional>
 #include <chrono>
 
-BOTAN_FUTURE_INTERNAL_HEADER(http_util.h)
-
 namespace Botan {
 
 namespace HTTP {
diff --git a/src/lib/utils/loadstor.h b/src/lib/utils/loadstor.h
index 9a8e9d4be..0b1cebdb4 100644
--- a/src/lib/utils/loadstor.h
+++ b/src/lib/utils/loadstor.h
@@ -14,8 +14,6 @@
 #include <botan/mem_ops.h>
 #include <vector>
 
-BOTAN_FUTURE_INTERNAL_HEADER(loadstor.h)
-
 #if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
    #define BOTAN_ENDIAN_N2L(x) reverse_bytes(x)
    #define BOTAN_ENDIAN_L2N(x) reverse_bytes(x)
diff --git a/src/lib/utils/locking_allocator/locking_allocator.h b/src/lib/utils/locking_allocator/locking_allocator.h
index 8d1d24980..21baa8ec2 100644
--- a/src/lib/utils/locking_allocator/locking_allocator.h
+++ b/src/lib/utils/locking_allocator/locking_allocator.h
@@ -12,8 +12,6 @@
 #include <vector>
 #include <memory>
 
-BOTAN_FUTURE_INTERNAL_HEADER(locking_allocator.h)
-
 namespace Botan {
 
 class Memory_Pool;
diff --git a/src/lib/utils/mem_ops.h b/src/lib/utils/mem_ops.h
index 569cb409b..31a1efcc9 100644
--- a/src/lib/utils/mem_ops.h
+++ b/src/lib/utils/mem_ops.h
@@ -127,24 +127,19 @@ template<typename T> inline void copy_mem(T* out, const T* in, size_t n)
       }
    }
 
-template<typename T> inline void typecast_copy(uint8_t out[], T in[], size_t N)
+template<typename T> inline void typecast_copy(uint8_t out[], T in)
    {
-   std::memcpy(out, in, sizeof(T)*N);
+   std::memcpy(out, &in, sizeof(T));
    }
 
-template<typename T> inline void typecast_copy(T out[], const uint8_t in[], size_t N)
-   {
-   std::memcpy(out, in, sizeof(T)*N);
-   }
-
-template<typename T> inline void typecast_copy(uint8_t out[], T in)
+template<typename T> inline void typecast_copy(T& out, const uint8_t in[])
    {
-   typecast_copy(out, &in, 1);
+   std::memcpy(&out, in, sizeof(T));
    }
 
-template<typename T> inline void typecast_copy(T& out, const uint8_t in[])
+template<typename T> inline void typecast_copy(T out[], const uint8_t in[], size_t N)
    {
-   typecast_copy(&out, in, 1);
+   std::memcpy(out, in, sizeof(T)*N);
    }
 
 /**
@@ -208,27 +203,28 @@ inline void xor_buf(uint8_t out[],
                     const uint8_t in[],
                     size_t length)
    {
-   const size_t blocks = length - (length % 32);
-
-   for(size_t i = 0; i != blocks; i += 32)
+   while(length >= 16)
       {
-      uint64_t x[4];
-      uint64_t y[4];
-
-      typecast_copy(x, out + i, 4);
-      typecast_copy(y, in + i, 4);
-
-      x[0] ^= y[0];
-      x[1] ^= y[1];
-      x[2] ^= y[2];
-      x[3] ^= y[3];
-
-      typecast_copy(out + i, x, 4);
+      uint64_t x0, x1, y0, y1;
+
+      typecast_copy(x0, in);
+      typecast_copy(x1, in + 8);
+      typecast_copy(y0, out);
+      typecast_copy(y1, out + 8);
+
+      y0 ^= x0;
+      y1 ^= x1;
+      typecast_copy(out, y0);
+      typecast_copy(out + 8, y1);
+      out += 16; in += 16; length -= 16;
       }
 
-   for(size_t i = blocks; i != length; ++i)
+   while(length > 0)
       {
-      out[i] ^= in[i];
+      out[0] ^= in[0];
+      out += 1;
+      in += 1;
+      length -= 1;
       }
    }
 
@@ -244,28 +240,23 @@ inline void xor_buf(uint8_t out[],
                     const uint8_t in2[],
                     size_t length)
    {
-   const size_t blocks = length - (length % 32);
-
-   for(size_t i = 0; i != blocks; i += 32)
+   while(length >= 16)
       {
-      uint64_t x[4];
-      uint64_t y[4];
-
-      typecast_copy(x, in + i, 4);
-      typecast_copy(y, in2 + i, 4);
-
-      x[0] ^= y[0];
-      x[1] ^= y[1];
-      x[2] ^= y[2];
-      x[3] ^= y[3];
-
-      typecast_copy(out + i, x, 4);
+      uint64_t x0, x1, y0, y1;
+      typecast_copy(x0, in);
+      typecast_copy(x1, in + 8);
+      typecast_copy(y0, in2);
+      typecast_copy(y1, in2 + 8);
+
+      x0 ^= y0;
+      x1 ^= y1;
+      typecast_copy(out, x0);
+      typecast_copy(out + 8, x1);
+      out += 16; in += 16; in2 += 16; length -= 16;
       }
 
-   for(size_t i = blocks; i != length; ++i)
-      {
+   for(size_t i = 0; i != length; ++i)
       out[i] = in[i] ^ in2[i];
-      }
    }
 
 template<typename Alloc, typename Alloc2>
diff --git a/src/lib/utils/mul128.h b/src/lib/utils/mul128.h
index 8cdaae21e..ce1ef693b 100644
--- a/src/lib/utils/mul128.h
+++ b/src/lib/utils/mul128.h
@@ -10,8 +10,6 @@
 
 #include <botan/types.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(mul128.h)
-
 namespace Botan {
 
 #if defined(__SIZEOF_INT128__) && defined(BOTAN_TARGET_CPU_HAS_NATIVE_64BIT)
diff --git a/src/lib/utils/os_utils.cpp b/src/lib/utils/os_utils.cpp
index a27e9117f..843e68638 100644
--- a/src/lib/utils/os_utils.cpp
+++ b/src/lib/utils/os_utils.cpp
@@ -60,6 +60,30 @@
 #endif
 
 namespace Botan {
+namespace {
+int get_locked_fd()
+   {
+#if defined(BOTAN_TARGET_OS_IS_IOS) || defined(BOTAN_TARGET_OS_IS_MACOS)
+// On Darwin, tagging anonymous pages allows vmmap to track these.
+// Allowed from 240 to 255 for userland applications, taken an hardcoded
+// value for now even though it can possibly intersect.
+   static constexpr int default_locked_fd = 255;
+   int locked_fd = default_locked_fd;
+
+   if (size_t locked_fdl = OS::read_env_variable_sz("BOTAN_LOCKED_FD", default_locked_fd))
+      {
+      if (locked_fdl < 240 || locked_fdl > 255)
+         {
+         locked_fdl = default_locked_fd;
+         }
+         locked_fd = static_cast<int>(locked_fdl);
+      }
+   return VM_MAKE_TAG(locked_fd);
+#else
+   return -1;
+#endif
+   }
+}
 
 // Not defined in OS namespace for historical reasons
 void secure_scrub_memory(void* ptr, size_t n)
@@ -405,42 +429,8 @@ size_t OS::read_env_variable_sz(const std::string& name, size_t def)
    return def;
    }
 
-#if defined(BOTAN_TARGET_OS_HAS_POSIX1) && defined(BOTAN_TARGET_OS_HAS_POSIX_MLOCK)
-
-namespace {
-
-int get_locked_fd()
-   {
-#if defined(BOTAN_TARGET_OS_IS_IOS) || defined(BOTAN_TARGET_OS_IS_MACOS)
-   // On Darwin, tagging anonymous pages allows vmmap to track these.
-   // Allowed from 240 to 255 for userland applications
-   static constexpr int default_locked_fd = 255;
-   int locked_fd = default_locked_fd;
-
-   if(size_t locked_fdl = OS::read_env_variable_sz("BOTAN_LOCKED_FD", default_locked_fd))
-      {
-      if(locked_fdl < 240 || locked_fdl > 255)
-         {
-         locked_fdl = default_locked_fd;
-         }
-      locked_fd = static_cast<int>(locked_fdl);
-      }
-   return VM_MAKE_TAG(locked_fd);
-#else
-   return -1;
-#endif
-   }
-
-}
-
-#endif
-
 std::vector<void*> OS::allocate_locked_pages(size_t count)
    {
-#if defined(BOTAN_TARGET_OS_HAS_POSIX1) && defined(BOTAN_TARGET_OS_HAS_POSIX_MLOCK)
-   static const int locked_fd = get_locked_fd();
-#endif
-
    std::vector<void*> result;
    result.reserve(count);
 
@@ -468,6 +458,7 @@ std::vector<void*> OS::allocate_locked_pages(size_t count)
    #define PROT_MAX(p) 0
 #endif
       const int pflags = PROT_READ | PROT_WRITE;
+      static const int locked_fd = get_locked_fd();
 
       ptr = ::mmap(nullptr, 2*page_size,
                    pflags | PROT_MAX(pflags),
diff --git a/src/lib/utils/parsing.h b/src/lib/utils/parsing.h
index 216dbc822..ed42ea8f5 100644
--- a/src/lib/utils/parsing.h
+++ b/src/lib/utils/parsing.h
@@ -17,8 +17,6 @@
 #include <functional>
 #include <map>
 
-BOTAN_FUTURE_INTERNAL_HEADER(parsing.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/utils/rotate.h b/src/lib/utils/rotate.h
index 15c78ac26..16a44c71e 100644
--- a/src/lib/utils/rotate.h
+++ b/src/lib/utils/rotate.h
@@ -10,8 +10,6 @@
 
 #include <botan/types.h>
 
-BOTAN_FUTURE_INTERNAL_HEADER(rotate.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/utils/simd/info.txt b/src/lib/utils/simd/info.txt
index 4a7044afc..7784902a6 100644
--- a/src/lib/utils/simd/info.txt
+++ b/src/lib/utils/simd/info.txt
@@ -5,23 +5,3 @@ SIMD_32 -> 20131128
 <header:internal>
 simd_32.h
 </header:internal>
-
-<isa>
-x86_32:sse2
-x86_64:sse2
-x32:sse2
-arm32:neon
-arm64:neon
-ppc32:altivec
-ppc64:altivec
-</isa>
-
-<arch>
-x86_32
-x86_64
-x32
-arm32
-arm64
-ppc32
-ppc64
-</arch>
diff --git a/src/lib/utils/simd/simd_32.h b/src/lib/utils/simd/simd_32.h
index 4c1599842..de02e84f1 100644
--- a/src/lib/utils/simd/simd_32.h
+++ b/src/lib/utils/simd/simd_32.h
@@ -1,6 +1,6 @@
 /*
 * Lightweight wrappers for SIMD operations
-* (C) 2009,2011,2016,2017,2019 Jack Lloyd
+* (C) 2009,2011,2016,2017 Jack Lloyd
 *
 * Botan is released under the Simplified BSD License (see license.txt)
 */
@@ -9,26 +9,26 @@
 #define BOTAN_SIMD_32_H_
 
 #include <botan/types.h>
+#include <botan/loadstor.h>
+#include <botan/bswap.h>
+#include <botan/cpuid.h>
 
 #if defined(BOTAN_TARGET_SUPPORTS_SSE2)
   #include <emmintrin.h>
   #define BOTAN_SIMD_USE_SSE2
 
 #elif defined(BOTAN_TARGET_SUPPORTS_ALTIVEC)
-  #include <botan/bswap.h>
-  #include <botan/loadstor.h>
   #include <altivec.h>
   #undef vector
   #undef bool
   #define BOTAN_SIMD_USE_ALTIVEC
 
 #elif defined(BOTAN_TARGET_SUPPORTS_NEON)
-  #include <botan/cpuid.h>
   #include <arm_neon.h>
   #define BOTAN_SIMD_USE_NEON
 
 #else
-  #error "No SIMD instruction set enabled"
+  #include <botan/rotate.h>
 #endif
 
 namespace Botan {
@@ -39,6 +39,8 @@ namespace Botan {
    typedef __vector unsigned int native_simd_type;
 #elif defined(BOTAN_SIMD_USE_NEON)
    typedef uint32x4_t native_simd_type;
+#else
+   typedef struct { uint32_t val[4]; } native_simd_type;
 #endif
 
 /**
@@ -72,6 +74,11 @@ class SIMD_4x32 final
          m_simd = vec_splat_u32(0);
 #elif defined(BOTAN_SIMD_USE_NEON)
          m_simd = vdupq_n_u32(0);
+#else
+         m_simd.val[0] = 0;
+         m_simd.val[1] = 0;
+         m_simd.val[2] = 0;
+         m_simd.val[3] = 0;
 #endif
          }
 
@@ -87,6 +94,11 @@ class SIMD_4x32 final
          m_simd = val;
 #elif defined(BOTAN_SIMD_USE_NEON)
          m_simd = vld1q_u32(B);
+#else
+         m_simd.val[0] = B[0];
+         m_simd.val[1] = B[1];
+         m_simd.val[2] = B[2];
+         m_simd.val[3] = B[3];
 #endif
          }
 
@@ -104,6 +116,11 @@ class SIMD_4x32 final
          // Better way to do this?
          const uint32_t B[4] = { B0, B1, B2, B3 };
          m_simd = vld1q_u32(B);
+#else
+         m_simd.val[0] = B0;
+         m_simd.val[1] = B1;
+         m_simd.val[2] = B2;
+         m_simd.val[3] = B3;
 #endif
          }
 
@@ -114,7 +131,7 @@ class SIMD_4x32 final
          {
 #if defined(BOTAN_SIMD_USE_SSE2)
          return SIMD_4x32(_mm_set1_epi32(B));
-#elif defined(BOTAN_SIMD_USE_NEON)
+#elif defined(BOTAN_SIMD_USE_ARM)
          return SIMD_4x32(vdupq_n_u32(B));
 #else
          return SIMD_4x32(B, B, B, B);
@@ -128,8 +145,8 @@ class SIMD_4x32 final
          {
 #if defined(BOTAN_SIMD_USE_SSE2)
          return SIMD_4x32(_mm_set1_epi8(B));
-#elif defined(BOTAN_SIMD_USE_NEON)
-         return SIMD_4x32(vreinterpretq_u32_u8(vdupq_n_u8(B)));
+#elif defined(BOTAN_SIMD_USE_ARM)
+         return SIMD_4x32(vdupq_n_u8(B));
 #else
          const uint32_t B4 = make_uint32(B, B, B, B);
          return SIMD_4x32(B4, B4, B4, B4);
@@ -144,13 +161,28 @@ class SIMD_4x32 final
 #if defined(BOTAN_SIMD_USE_SSE2)
          return SIMD_4x32(_mm_loadu_si128(reinterpret_cast<const __m128i*>(in)));
 #elif defined(BOTAN_SIMD_USE_ALTIVEC)
+
          uint32_t R[4];
          Botan::load_le(R, static_cast<const uint8_t*>(in), 4);
          return SIMD_4x32(R);
+
 #elif defined(BOTAN_SIMD_USE_NEON)
+
          SIMD_4x32 l(vld1q_u32(static_cast<const uint32_t*>(in)));
+
+#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
+         return l.bswap();
+#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
+         return l;
+#else
          return CPUID::is_big_endian() ? l.bswap() : l;
 #endif
+
+#else
+         SIMD_4x32 out;
+         Botan::load_le(out.m_simd.val, static_cast<const uint8_t*>(in), 4);
+         return out;
+#endif
          }
 
       /**
@@ -167,9 +199,22 @@ class SIMD_4x32 final
          return SIMD_4x32(R);
 
 #elif defined(BOTAN_SIMD_USE_NEON)
+
          SIMD_4x32 l(vld1q_u32(static_cast<const uint32_t*>(in)));
+
+#if defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
+         return l.bswap();
+#elif defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
+         return l;
+#else
          return CPUID::is_little_endian() ? l.bswap() : l;
 #endif
+
+#else
+         SIMD_4x32 out;
+         Botan::load_be(out.m_simd.val, static_cast<const uint8_t*>(in), 4);
+         return out;
+#endif
          }
 
       void store_le(uint32_t out[]) const
@@ -196,6 +241,12 @@ class SIMD_4x32 final
          Botan::store_le(out, vec.R[0], vec.R[1], vec.R[2], vec.R[3]);
 
 #elif defined(BOTAN_SIMD_USE_NEON)
+
+#if defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
+         vst1q_u8(out, vreinterpretq_u8_u32(m_simd));
+#elif defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
+         vst1q_u8(out, vreinterpretq_u8_u32(bswap().m_simd));
+#else
          if(CPUID::is_little_endian())
             {
             vst1q_u8(out, vreinterpretq_u8_u32(m_simd));
@@ -205,6 +256,10 @@ class SIMD_4x32 final
             vst1q_u8(out, vreinterpretq_u8_u32(bswap().m_simd));
             }
 #endif
+
+#else
+         Botan::store_le(out, m_simd.val[0], m_simd.val[1], m_simd.val[2], m_simd.val[3]);
+#endif
          }
 
       /**
@@ -226,6 +281,12 @@ class SIMD_4x32 final
          Botan::store_be(out, vec.R[0], vec.R[1], vec.R[2], vec.R[3]);
 
 #elif defined(BOTAN_SIMD_USE_NEON)
+
+#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
+         vst1q_u8(out, vreinterpretq_u8_u32(m_simd);
+#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
+         vst1q_u8(out, vreinterpretq_u8_u32(bswap().m_simd));
+#else
          if(CPUID::is_little_endian())
             {
             vst1q_u8(out, vreinterpretq_u8_u32(bswap().m_simd));
@@ -235,6 +296,10 @@ class SIMD_4x32 final
             vst1q_u8(out, vreinterpretq_u8_u32(m_simd));
             }
 #endif
+
+#else
+         Botan::store_be(out, m_simd.val[0], m_simd.val[1], m_simd.val[2], m_simd.val[3]);
+#endif
          }
 
       /*
@@ -271,7 +336,12 @@ class SIMD_4x32 final
 
 #elif defined(BOTAN_SIMD_USE_NEON)
 
-#if defined(BOTAN_TARGET_ARCH_IS_ARM64)
+         #if defined(BOTAN_TARGET_ARCH_IS_ARM32)
+
+         return SIMD_4x32(vorrq_u32(vshlq_n_u32(m_simd, static_cast<int>(ROT)),
+                                    vshrq_n_u32(m_simd, static_cast<int>(32-ROT))));
+
+         #else
 
          BOTAN_IF_CONSTEXPR(ROT == 8)
             {
@@ -283,9 +353,19 @@ class SIMD_4x32 final
             {
             return SIMD_4x32(vreinterpretq_u32_u16(vrev32q_u16(vreinterpretq_u16_u32(m_simd))));
             }
-#endif
-         return SIMD_4x32(vorrq_u32(vshlq_n_u32(m_simd, static_cast<int>(ROT)),
-                                    vshrq_n_u32(m_simd, static_cast<int>(32-ROT))));
+         else
+            {
+            return SIMD_4x32(vorrq_u32(vshlq_n_u32(m_simd, static_cast<int>(ROT)),
+                                       vshrq_n_u32(m_simd, static_cast<int>(32-ROT))));
+            }
+
+         #endif
+
+#else
+         return SIMD_4x32(Botan::rotl<ROT>(m_simd.val[0]),
+                          Botan::rotl<ROT>(m_simd.val[1]),
+                          Botan::rotl<ROT>(m_simd.val[2]),
+                          Botan::rotl<ROT>(m_simd.val[3]));
 #endif
          }
 
@@ -356,6 +436,11 @@ class SIMD_4x32 final
          m_simd = vec_add(m_simd, other.m_simd);
 #elif defined(BOTAN_SIMD_USE_NEON)
          m_simd = vaddq_u32(m_simd, other.m_simd);
+#else
+         m_simd.val[0] += other.m_simd.val[0];
+         m_simd.val[1] += other.m_simd.val[1];
+         m_simd.val[2] += other.m_simd.val[2];
+         m_simd.val[3] += other.m_simd.val[3];
 #endif
          }
 
@@ -367,6 +452,11 @@ class SIMD_4x32 final
          m_simd = vec_sub(m_simd, other.m_simd);
 #elif defined(BOTAN_SIMD_USE_NEON)
          m_simd = vsubq_u32(m_simd, other.m_simd);
+#else
+         m_simd.val[0] -= other.m_simd.val[0];
+         m_simd.val[1] -= other.m_simd.val[1];
+         m_simd.val[2] -= other.m_simd.val[2];
+         m_simd.val[3] -= other.m_simd.val[3];
 #endif
          }
 
@@ -379,6 +469,11 @@ class SIMD_4x32 final
          m_simd = vec_xor(m_simd, other.m_simd);
 #elif defined(BOTAN_SIMD_USE_NEON)
          m_simd = veorq_u32(m_simd, other.m_simd);
+#else
+         m_simd.val[0] ^= other.m_simd.val[0];
+         m_simd.val[1] ^= other.m_simd.val[1];
+         m_simd.val[2] ^= other.m_simd.val[2];
+         m_simd.val[3] ^= other.m_simd.val[3];
 #endif
          }
 
@@ -390,6 +485,11 @@ class SIMD_4x32 final
          m_simd = vec_or(m_simd, other.m_simd);
 #elif defined(BOTAN_SIMD_USE_NEON)
          m_simd = vorrq_u32(m_simd, other.m_simd);
+#else
+         m_simd.val[0] |= other.m_simd.val[0];
+         m_simd.val[1] |= other.m_simd.val[1];
+         m_simd.val[2] |= other.m_simd.val[2];
+         m_simd.val[3] |= other.m_simd.val[3];
 #endif
          }
 
@@ -401,6 +501,11 @@ class SIMD_4x32 final
          m_simd = vec_and(m_simd, other.m_simd);
 #elif defined(BOTAN_SIMD_USE_NEON)
          m_simd = vandq_u32(m_simd, other.m_simd);
+#else
+         m_simd.val[0] &= other.m_simd.val[0];
+         m_simd.val[1] &= other.m_simd.val[1];
+         m_simd.val[2] &= other.m_simd.val[2];
+         m_simd.val[3] &= other.m_simd.val[3];
 #endif
          }
 
@@ -416,6 +521,11 @@ class SIMD_4x32 final
          return SIMD_4x32(vec_sl(m_simd, shifts));
 #elif defined(BOTAN_SIMD_USE_NEON)
          return SIMD_4x32(vshlq_n_u32(m_simd, SHIFT));
+#else
+         return SIMD_4x32(m_simd.val[0] << SHIFT,
+                          m_simd.val[1] << SHIFT,
+                          m_simd.val[2] << SHIFT,
+                          m_simd.val[3] << SHIFT);
 #endif
          }
 
@@ -430,6 +540,10 @@ class SIMD_4x32 final
          return SIMD_4x32(vec_sr(m_simd, shifts));
 #elif defined(BOTAN_SIMD_USE_NEON)
          return SIMD_4x32(vshrq_n_u32(m_simd, SHIFT));
+#else
+         return SIMD_4x32(m_simd.val[0] >> SHIFT, m_simd.val[1] >> SHIFT,
+                          m_simd.val[2] >> SHIFT, m_simd.val[3] >> SHIFT);
+
 #endif
          }
 
@@ -441,6 +555,8 @@ class SIMD_4x32 final
          return SIMD_4x32(vec_nor(m_simd, m_simd));
 #elif defined(BOTAN_SIMD_USE_NEON)
          return SIMD_4x32(vmvnq_u32(m_simd));
+#else
+         return SIMD_4x32(~m_simd.val[0], ~m_simd.val[1], ~m_simd.val[2], ~m_simd.val[3]);
 #endif
          }
 
@@ -458,6 +574,11 @@ class SIMD_4x32 final
 #elif defined(BOTAN_SIMD_USE_NEON)
          // NEON is also a & ~b
          return SIMD_4x32(vbicq_u32(other.m_simd, m_simd));
+#else
+         return SIMD_4x32((~m_simd.val[0]) & other.m_simd.val[0],
+                          (~m_simd.val[1]) & other.m_simd.val[1],
+                          (~m_simd.val[2]) & other.m_simd.val[2],
+                          (~m_simd.val[3]) & other.m_simd.val[3]);
 #endif
          }
 
@@ -485,7 +606,15 @@ class SIMD_4x32 final
          return SIMD_4x32(vec.R[0], vec.R[1], vec.R[2], vec.R[3]);
 
 #elif defined(BOTAN_SIMD_USE_NEON)
+
          return SIMD_4x32(vreinterpretq_u32_u8(vrev32q_u8(vreinterpretq_u8_u32(m_simd))));
+
+#else
+         // scalar
+         return SIMD_4x32(reverse_bytes(m_simd.val[0]),
+                          reverse_bytes(m_simd.val[1]),
+                          reverse_bytes(m_simd.val[2]),
+                          reverse_bytes(m_simd.val[3]));
 #endif
          }
 
@@ -515,8 +644,10 @@ class SIMD_4x32 final
          B1.m_simd = vec_mergel(T0, T1);
          B2.m_simd = vec_mergeh(T2, T3);
          B3.m_simd = vec_mergel(T2, T3);
+#elif defined(BOTAN_SIMD_USE_NEON)
+
+#if defined(BOTAN_TARGET_ARCH_IS_ARM32)
 
-#elif defined(BOTAN_SIMD_USE_NEON) && defined(BOTAN_TARGET_ARCH_IS_ARM32)
          const uint32x4x2_t T0 = vzipq_u32(B0.m_simd, B2.m_simd);
          const uint32x4x2_t T1 = vzipq_u32(B1.m_simd, B3.m_simd);
          const uint32x4x2_t O0 = vzipq_u32(T0.val[0], T1.val[0]);
@@ -527,17 +658,32 @@ class SIMD_4x32 final
          B2.m_simd = O1.val[0];
          B3.m_simd = O1.val[1];
 
-#elif defined(BOTAN_SIMD_USE_NEON) && defined(BOTAN_TARGET_ARCH_IS_ARM64)
+#elif defined(BOTAN_TARGET_ARCH_IS_ARM64)
          const uint32x4_t T0 = vzip1q_u32(B0.m_simd, B2.m_simd);
          const uint32x4_t T2 = vzip2q_u32(B0.m_simd, B2.m_simd);
+
          const uint32x4_t T1 = vzip1q_u32(B1.m_simd, B3.m_simd);
          const uint32x4_t T3 = vzip2q_u32(B1.m_simd, B3.m_simd);
 
          B0.m_simd = vzip1q_u32(T0, T1);
          B1.m_simd = vzip2q_u32(T0, T1);
+
          B2.m_simd = vzip1q_u32(T2, T3);
          B3.m_simd = vzip2q_u32(T2, T3);
 #endif
+
+#else
+         // scalar
+         SIMD_4x32 T0(B0.m_simd.val[0], B1.m_simd.val[0], B2.m_simd.val[0], B3.m_simd.val[0]);
+         SIMD_4x32 T1(B0.m_simd.val[1], B1.m_simd.val[1], B2.m_simd.val[1], B3.m_simd.val[1]);
+         SIMD_4x32 T2(B0.m_simd.val[2], B1.m_simd.val[2], B2.m_simd.val[2], B3.m_simd.val[2]);
+         SIMD_4x32 T3(B0.m_simd.val[3], B1.m_simd.val[3], B2.m_simd.val[3], B3.m_simd.val[3]);
+
+         B0 = T0;
+         B1 = T1;
+         B2 = T2;
+         B3 = T3;
+#endif
          }
 
       native_simd_type raw() const { return m_simd; }
diff --git a/src/lib/utils/stl_compatibility.h b/src/lib/utils/stl_compatibility.h
index 03bd5c8ac..099af83b3 100644
--- a/src/lib/utils/stl_compatibility.h
+++ b/src/lib/utils/stl_compatibility.h
@@ -8,7 +8,6 @@
 #ifndef BOTAN_STL_COMPATIBILITY_H_
 #define BOTAN_STL_COMPATIBILITY_H_
 
-#include <botan/types.h>
 #include <memory>
 
 #if __cplusplus < 201402L
@@ -17,8 +16,6 @@
 #include <utility>
 #endif
 
-BOTAN_FUTURE_INTERNAL_HEADER(stl_compatability.h)
-
 namespace Botan
 {
 /*
diff --git a/src/lib/utils/uuid/uuid.h b/src/lib/utils/uuid/uuid.h
index 8f95f4d67..38b5aab1b 100644
--- a/src/lib/utils/uuid/uuid.h
+++ b/src/lib/utils/uuid/uuid.h
@@ -12,8 +12,6 @@
 #include <vector>
 #include <string>
 
-BOTAN_FUTURE_INTERNAL_HEADER(uuid.h)
-
 namespace Botan {
 
 class RandomNumberGenerator;
diff --git a/src/lib/x509/datastor.h b/src/lib/x509/datastor.h
index e849c3d89..ec3c5189b 100644
--- a/src/lib/x509/datastor.h
+++ b/src/lib/x509/datastor.h
@@ -15,8 +15,6 @@
 #include <vector>
 #include <map>
 
-BOTAN_FUTURE_INTERNAL_HEADER(datastor.h)
-
 namespace Botan {
 
 /**
diff --git a/src/lib/x509/x509_ext.cpp b/src/lib/x509/x509_ext.cpp
index 55e3c434e..0bfc337c4 100644
--- a/src/lib/x509/x509_ext.cpp
+++ b/src/lib/x509/x509_ext.cpp
@@ -13,7 +13,6 @@
 #include <botan/der_enc.h>
 #include <botan/ber_dec.h>
 #include <botan/hash.h>
-#include <botan/loadstor.h>
 #include <botan/internal/bit_ops.h>
 #include <algorithm>
 #include <set>
diff --git a/src/scripts/ci/lgtm.yml b/src/scripts/ci/lgtm.yml
index 6967f3299..fa2423858 100644
--- a/src/scripts/ci/lgtm.yml
+++ b/src/scripts/ci/lgtm.yml
@@ -28,4 +28,4 @@ extraction:
   cpp:
     configure:
       command:
-        - ./configure.py --build-bogo-shim --build-fuzzers=test --with-zlib --with-bzip2 --with-lzma --with-openssl --with-sqlite3 --no-store-vc-rev
+        - ./configure.py --build-targets="static,shared,cli,tests,bogo_shim" --build-fuzzers=test --with-zlib --with-bzip2 --with-lzma --with-openssl --with-sqlite3 --no-store-vc-rev
diff --git a/src/scripts/ci/setup_travis.sh b/src/scripts/ci/setup_travis.sh
index 50ca2c630..ddad66c87 100755
--- a/src/scripts/ci/setup_travis.sh
+++ b/src/scripts/ci/setup_travis.sh
@@ -11,51 +11,51 @@ set -ev
 
 if [ "$TRAVIS_OS_NAME" = "linux" ]; then
 
-    if [ "$TARGET" = "valgrind" ]; then
+    if [ "$BUILD_MODE" = "valgrind" ]; then
         sudo apt-get -qq update
         sudo apt-get install valgrind
 
-    elif [ "$TARGET" = "gcc4.8" ]; then
+    elif [ "$BUILD_MODE" = "gcc4.8" ]; then
         sudo apt-get -qq update
         sudo apt-get install g++-4.8
 
-    elif [ "$TARGET" = "cross-i386" ]; then
+    elif [ "$BUILD_MODE" = "cross-i386" ]; then
         sudo apt-get -qq update
         sudo apt-get install g++-multilib linux-libc-dev libc6-dev-i386
 
-    elif [ "$TARGET" = "cross-win64" ]; then
+    elif [ "$BUILD_MODE" = "cross-win64" ]; then
         sudo apt-get -qq update
         sudo apt-get install wine g++-mingw-w64-x86-64
 
-    elif [ "$TARGET" = "cross-arm32" ]; then
+    elif [ "$BUILD_MODE" = "cross-arm32" ]; then
         sudo apt-get -qq update
         sudo apt-get install qemu-user g++-arm-linux-gnueabihf
 
-    elif [ "$TARGET" = "cross-arm64" ]; then
+    elif [ "$BUILD_MODE" = "cross-arm64" ]; then
         sudo apt-get -qq update
         sudo apt-get install qemu-user g++-aarch64-linux-gnu
 
-    elif [ "$TARGET" = "cross-ppc32" ]; then
+    elif [ "$BUILD_MODE" = "cross-ppc32" ]; then
         sudo apt-get -qq update
         sudo apt-get install qemu-user g++-powerpc-linux-gnu
 
-    elif [ "$TARGET" = "cross-ppc64" ]; then
+    elif [ "$BUILD_MODE" = "cross-ppc64" ]; then
         sudo apt-get -qq update
         sudo apt-get install qemu-user g++-powerpc64le-linux-gnu
 
-    elif [ "$TARGET" = "cross-mips64" ]; then
+    elif [ "$BUILD_MODE" = "cross-mips64" ]; then
         sudo apt-get -qq update
         sudo apt-get install qemu-user g++-mips64-linux-gnuabi64
 
-    elif [ "$TARGET" = "cross-android-arm32" ] || [ "$TARGET" = "cross-android-arm64" ]; then
+    elif [ "$BUILD_MODE" = "cross-android-arm32" ] || [ "$BUILD_MODE" = "cross-android-arm64" ]; then
         wget -nv https://dl.google.com/android/repository/"$ANDROID_NDK"-linux-x86_64.zip
         unzip -qq "$ANDROID_NDK"-linux-x86_64.zip
 
-    elif [ "$TARGET" = "lint" ]; then
+    elif [ "$BUILD_MODE" = "lint" ]; then
         sudo apt-get -qq update
         sudo apt-get install pylint
 
-    elif [ "$TARGET" = "coverage" ]; then
+    elif [ "$BUILD_MODE" = "coverage" ]; then
         # need updated softhsm to avoid https://github.com/opendnssec/SoftHSMv2/issues/239
         sudo add-apt-repository -y ppa:pkg-opendnssec/ppa
         sudo apt-get -qq update
@@ -69,7 +69,7 @@ if [ "$TRAVIS_OS_NAME" = "linux" ]; then
 
         softhsm2-util --init-token --free --label test --pin 123456 --so-pin 12345678
 
-    elif [ "$TARGET" = "docs" ]; then
+    elif [ "$BUILD_MODE" = "docs" ]; then
         sudo apt-get -qq update
         sudo apt-get install doxygen python-docutils
 
diff --git a/src/scripts/ci/travis.yml b/src/scripts/ci/travis.yml
index 341f2982f..02cdfded7 100644
--- a/src/scripts/ci/travis.yml
+++ b/src/scripts/ci/travis.yml
@@ -13,30 +13,30 @@ compiler:
 
 env:
   global:
-    - CCACHE_MAXSIZE=1G
+    - CCACHE_MAXSIZE=800M
     - ANDROID_NDK=android-ndk-r20
 
   matrix:
-    - TARGET="shared"
-    - TARGET="coverage"
-    - TARGET="fuzzers"
-    - TARGET="valgrind"
-    - TARGET="cross-i386"
-    - TARGET="cross-ppc32"
-    - TARGET="cross-ppc64"
-    - TARGET="cross-arm32"
-    - TARGET="cross-arm64"
-    - TARGET="cross-mips64"
-    - TARGET="cross-win64"
-    - TARGET="cross-android-arm32"
-    - TARGET="cross-android-arm64"
-    - TARGET="gcc4.8"
-    - TARGET="static"
-    - TARGET="mini-shared"
-    - TARGET="bsi"
-    - TARGET="nist"
-    - TARGET="docs"
-    - TARGET="lint"
+    - BUILD_MODE="shared"
+    - BUILD_MODE="coverage"
+    - BUILD_MODE="fuzzers"
+    - BUILD_MODE="valgrind"
+    - BUILD_MODE="cross-i386"
+    - BUILD_MODE="cross-ppc32"
+    - BUILD_MODE="cross-ppc64"
+    - BUILD_MODE="cross-arm32"
+    - BUILD_MODE="cross-arm64"
+    - BUILD_MODE="cross-mips64"
+    - BUILD_MODE="cross-win64"
+    - BUILD_MODE="cross-android-arm32"
+    - BUILD_MODE="cross-android-arm64"
+    - BUILD_MODE="gcc4.8"
+    - BUILD_MODE="static"
+    - BUILD_MODE="mini-shared"
+    - BUILD_MODE="bsi"
+    - BUILD_MODE="nist"
+    - BUILD_MODE="docs"
+    - BUILD_MODE="lint"
 
 matrix:
   exclude:
@@ -46,7 +46,7 @@ matrix:
 
     # XCode 9.4 ICEs on 32-bit ARM builds
     - os: osx
-      env: TARGET="cross-arm32"
+      env: BUILD_MODE="cross-arm32"
 
     # Run static, docs, lint, bsi, nist, fuzzers, coverage, valgrind,
     # sanitizer, minimized and non-ARM cross builds only on Linux/gcc.
@@ -54,62 +54,62 @@ matrix:
     # cause CI timeouts.
 
     - compiler: clang
-      env: TARGET="static"
+      env: BUILD_MODE="static"
     - compiler: clang
-      env: TARGET="bsi"
+      env: BUILD_MODE="bsi"
     - compiler: clang
-      env: TARGET="nist"
+      env: BUILD_MODE="nist"
     - compiler: clang
-      env: TARGET="lint"
+      env: BUILD_MODE="lint"
     - compiler: clang
-      env: TARGET="docs"
+      env: BUILD_MODE="docs"
     - compiler: clang
-      env: TARGET="coverage"
+      env: BUILD_MODE="coverage"
 
     - compiler: clang
-      env: TARGET="fuzzers"
+      env: BUILD_MODE="fuzzers"
     - compiler: clang
-      env: TARGET="valgrind"
+      env: BUILD_MODE="valgrind"
     - compiler: clang
-      env: TARGET="mini-shared"
+      env: BUILD_MODE="mini-shared"
     - compiler: clang
-      env: TARGET="cross-win64"
+      env: BUILD_MODE="cross-win64"
     - compiler: clang
-      env: TARGET="cross-ppc32"
+      env: BUILD_MODE="cross-ppc32"
     - compiler: clang
-      env: TARGET="cross-ppc64"
+      env: BUILD_MODE="cross-ppc64"
     - compiler: clang
-      env: TARGET="cross-mips64"
+      env: BUILD_MODE="cross-mips64"
     - compiler: clang
-      env: TARGET="cross-i386"
+      env: BUILD_MODE="cross-i386"
     - compiler: clang
-      env: TARGET="gcc4.8"
+      env: BUILD_MODE="gcc4.8"
 
    # No ARM Clang compiler on Linux
     - os: linux
       compiler: clang
-      env: TARGET="cross-arm32"
+      env: BUILD_MODE="cross-arm32"
     - os: linux
       compiler: clang
-      env: TARGET="cross-arm64"
+      env: BUILD_MODE="cross-arm64"
 
-   # Android NDK is Linux/clang only
+   # Android NDK is Linux only
     - os: osx
-      env: TARGET="cross-android-arm32"
+      env: BUILD_MODE="cross-android-arm32"
     - os: osx
-      env: TARGET="cross-android-arm64"
+      env: BUILD_MODE="cross-android-arm64"
     - os: linux
       compiler: gcc
-      env: TARGET="cross-android-arm32"
+      env: BUILD_MODE="cross-android-arm32"
     - os: linux
       compiler: gcc
-      env: TARGET="cross-android-arm64"
+      env: BUILD_MODE="cross-android-arm64"
 
 install:
   - ./src/scripts/ci/setup_travis.sh
 
 script:
-  - ./src/scripts/ci_build.py --os=$TRAVIS_OS_NAME --cc=$CC --cc-bin=$CXX --without-pylint3 --pkcs11-lib=/usr/lib/softhsm/libsofthsm2.so $TARGET
+  - ./src/scripts/ci_build.py --os=$TRAVIS_OS_NAME --cc=$CC --cc-bin=$CXX --without-pylint3 --pkcs11-lib=/usr/lib/softhsm/libsofthsm2.so $BUILD_MODE
 
 # whitelist branches to avoid testing feature branches twice (as branch and as pull request)
 branches:
diff --git a/src/scripts/ci_build.py b/src/scripts/ci_build.py
index 756bc880b..90f92895f 100755
--- a/src/scripts/ci_build.py
+++ b/src/scripts/ci_build.py
@@ -65,15 +65,16 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro
     flags = ['--prefix=%s' % (install_prefix),
              '--cc=%s' % (target_cc),
              '--os=%s' % (target_os)]
+    build_targets = ['cli', 'tests']
 
     if target_cpu is not None:
         flags += ['--cpu=%s' % (target_cpu)]
 
     if target in ['shared', 'mini-shared']:
-        flags += ['--disable-static']
+        build_targets += ['shared']
 
     if target in ['static', 'mini-static', 'fuzzers'] or target_os in ['ios', 'mingw']:
-        flags += ['--disable-shared']
+        build_targets += ['static']
 
     if target in ['mini-static', 'mini-shared']:
         flags += ['--minimized-build', '--enable-modules=system_rng,sha2_32,sha2_64,aes']
@@ -89,15 +90,16 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro
         # Arbitrarily test disable static on module policy builds
         # tls is optional for bsi/nist but add it so verify tests work with these minimized configs
         flags += ['--module-policy=%s' % (target),
-                  '--enable-modules=tls',
-                  '--disable-static']
+                  '--enable-modules=tls']
+        build_targets += ['shared']
 
     if target == 'docs':
         flags += ['--with-doxygen', '--with-sphinx', '--with-rst2man']
         test_cmd = None
 
     if target == 'coverage':
-        flags += ['--with-coverage-info', '--with-debug-info', '--test-mode', '--build-bogo-shim']
+        flags += ['--with-coverage-info', '--with-debug-info', '--test-mode']
+        build_targets += ['bogo_shim']
     if target == 'valgrind':
         # valgrind in 16.04 has a bug with rdrand handling
         flags += ['--with-valgrind', '--disable-rdrand']
@@ -128,8 +130,8 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro
         # these profiling flags) but we can't use --no-optimizations as that
         # will make running the tests too slow.
         flags += ['--cc-abi-flags=-fprofile-instr-generate -fcoverage-mapping',
-                  '--disable-shared',
                   '--optimize-for-size']
+        build_targets += ['static']
 
         make_prefix = [os.path.join(root_dir, 'build-wrapper-linux-x86/build-wrapper-linux-x86-64'),
                        '--out-dir', 'bw-outputs']
@@ -206,7 +208,6 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro
                 flags += ['--cpu=mips64', '--with-endian=big']
                 cc_bin = 'mips64-linux-gnuabi64-g++'
                 test_prefix = ['qemu-mips64', '-L', '/usr/mips64-linux-gnuabi64/']
-                test_cmd.remove('simd_32') # no SIMD on MIPS
             else:
                 raise Exception("Unknown cross target '%s' for Linux" % (target))
     else:
@@ -273,6 +274,9 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro
         else:
             run_test_command = test_prefix + test_cmd
 
+    if 'static' not in build_targets and 'shared' not in build_targets:
+        build_targets += ['static', 'shared'] if target_os != 'windows' else ['shared']
+    flags += ['--build-targets=%s' % ','.join(build_targets)]
 
     return flags, run_test_command, make_prefix
 


Test patch:
diff --git a/src/tests/test_newhope.cpp b/src/tests/test_newhope.cpp
index 90d44263a..be75ebeb7 100644
--- a/src/tests/test_newhope.cpp
+++ b/src/tests/test_newhope.cpp
@@ -8,8 +8,8 @@
 
 #if defined(BOTAN_HAS_NEWHOPE) && defined(BOTAN_HAS_CHACHA)
    #include <botan/newhope.h>
-   #include <botan/hash.h>
-   #include <botan/stream_cipher.h>
+   #include <botan/sha3.h>
+   #include <botan/chacha.h>
    #include <botan/rng.h>
 #endif
 
@@ -48,7 +48,7 @@ class NEWHOPE_RNG final : public Botan::RandomNumberGenerator
          * random seed we compute the exact same result.
          */
          Botan::clear_mem(out, len);
-         m_chacha->cipher1(out, len);
+         m_chacha.cipher1(out, len);
 
          m_calls += 1;
 
@@ -63,7 +63,7 @@ class NEWHOPE_RNG final : public Botan::RandomNumberGenerator
             nonce[7] = m_calls;
             }
 
-         m_chacha->set_iv(nonce, 8);
+         m_chacha.set_iv(nonce, 8);
          }
 
       bool is_seeded() const override
@@ -80,8 +80,6 @@ class NEWHOPE_RNG final : public Botan::RandomNumberGenerator
 
       NEWHOPE_RNG(const std::vector<uint8_t>& seed)
          {
-         m_chacha = Botan::StreamCipher::create_or_throw("ChaCha20");
-
          if(seed.size() != 64 && seed.size() != 32)
             {
             throw Test_Error("Invalid NEWHOPE RNG seed");
@@ -90,16 +88,16 @@ class NEWHOPE_RNG final : public Botan::RandomNumberGenerator
          if(seed.size() == 64)
             {
             m_first.assign(seed.begin(), seed.begin() + 32);
-            m_chacha->set_key(seed.data() + 32, 32);
+            m_chacha.set_key(seed.data() + 32, 32);
             }
          else
             {
-            m_chacha->set_key(seed.data(), 32);
+            m_chacha.set_key(seed.data(), 32);
             }
          }
 
    private:
-      std::unique_ptr<Botan::StreamCipher> m_chacha;
+      Botan::ChaCha m_chacha;
       std::vector<uint8_t> m_first;
       uint8_t m_calls = 0;
    };
@@ -123,15 +121,15 @@ class NEWHOPE_Tests final : public Text_Based_Test
          NEWHOPE_RNG drbg_a(vars.get_req_bin("DRBG_SeedA"));
          NEWHOPE_RNG drbg_b(vars.get_req_bin("DRBG_SeedB"));
 
-         std::unique_ptr<Botan::HashFunction> sha3 = Botan::HashFunction::create("SHA-3(256)");
+         Botan::SHA_3_256 sha3;
 
          std::vector<uint8_t> send_a(Botan::NEWHOPE_SENDABYTES);
          Botan::newhope_poly a_sk;
          Botan::newhope_keygen(send_a.data(), &a_sk, drbg_a);
 
-         std::vector<uint8_t> h_send_a(sha3->output_length());
-         sha3->update(send_a);
-         sha3->final(h_send_a.data());
+         std::vector<uint8_t> h_send_a(sha3.output_length());
+         sha3.update(send_a);
+         sha3.final(h_send_a.data());
          result.test_eq("Hash Output A", h_send_a, h_output_a);
 
          std::vector<uint8_t> sharedkey_b(32);
@@ -139,9 +137,9 @@ class NEWHOPE_Tests final : public Text_Based_Test
          Botan::newhope_sharedb(sharedkey_b.data(), send_b.data(), send_a.data(), drbg_b);
          result.test_eq("Key B", sharedkey_b, shared_key);
 
-         std::vector<uint8_t> h_send_b(sha3->output_length());
-         sha3->update(send_b);
-         sha3->final(h_send_b.data());
+         std::vector<uint8_t> h_send_b(sha3.output_length());
+         sha3.update(send_b);
+         sha3.final(h_send_b.data());
          result.test_eq("Hash Output B", h_send_b, h_output_b);
 
          std::vector<uint8_t> sharedkey_a(32);
diff --git a/src/tests/test_rng.cpp b/src/tests/test_rng.cpp
index 3751ac5ca..e62f81623 100644
--- a/src/tests/test_rng.cpp
+++ b/src/tests/test_rng.cpp
@@ -30,6 +30,7 @@
 
 #if defined(BOTAN_HAS_RDRAND_RNG)
    #include <botan/rdrand_rng.h>
+   #include <botan/cpuid.h>
 #endif
 
 #if defined(BOTAN_HAS_ENTROPY_SOURCE)
@@ -755,7 +756,7 @@ class RDRAND_RNG_Tests final : public Test
          {
          Test::Result result("RDRAND_RNG");
 
-         if(Botan::RDRAND_RNG::available())
+         if(Botan::CPUID::has_rdrand())
             {
             Botan::RDRAND_RNG rng;
 
diff --git a/src/tests/test_simd.cpp b/src/tests/test_simd.cpp
index 95f310201..3603cb8e9 100644
--- a/src/tests/test_simd.cpp
+++ b/src/tests/test_simd.cpp
@@ -10,8 +10,6 @@
    #include <botan/internal/simd_32.h>
    #include <botan/cpuid.h>
    #include <botan/rotate.h>
-   #include <botan/loadstor.h>
-   #include <botan/bswap.h>
 #endif
 
 namespace Botan_Tests {
diff --git a/src/tests/test_tls_messages.cpp b/src/tests/test_tls_messages.cpp
index 15cc63b2e..f176839db 100644
--- a/src/tests/test_tls_messages.cpp
+++ b/src/tests/test_tls_messages.cpp
@@ -14,7 +14,6 @@
    #include <botan/tls_handshake_msg.h>
    #include <botan/tls_messages.h>
    #include <botan/tls_alert.h>
-   #include <botan/loadstor.h>
 #endif
 
 namespace Botan_Tests {
diff --git a/src/tests/test_utils.cpp b/src/tests/test_utils.cpp
index 19350e2d3..52d10058b 100644
--- a/src/tests/test_utils.cpp
+++ b/src/tests/test_utils.cpp
@@ -16,7 +16,6 @@
 #include <botan/internal/rounding.h>
 #include <botan/internal/ct_utils.h>
 #include <botan/internal/bit_ops.h>
-#include <botan/cpuid.h>
 #include <botan/charset.h>
 #include <botan/parsing.h>
 #include <botan/version.h>
diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp
index cbc1a3426..8e21a8d38 100644
--- a/src/tests/tests.cpp
+++ b/src/tests/tests.cpp
@@ -13,7 +13,6 @@
 #include <botan/parsing.h>
 #include <botan/internal/filesystem.h>
 #include <botan/internal/stl_util.h>
-#include <botan/cpuid.h>
 
 #if defined(BOTAN_HAS_BIGINT)
    #include <botan/bigint.h>
@@ -960,10 +959,10 @@ std::string strip_ws(const std::string& in)
    return in.substr(first_c, last_c - first_c + 1);
    }
 
-std::vector<uint64_t>
+std::vector<Botan::CPUID::CPUID_bits>
 parse_cpuid_bits(const std::vector<std::string>& tok)
    {
-   std::vector<uint64_t> bits;
+   std::vector<Botan::CPUID::CPUID_bits> bits;
    for(size_t i = 1; i < tok.size(); ++i)
       {
       const std::vector<Botan::CPUID::CPUID_bits> more = Botan::CPUID::bit_from_string(tok[i]);
@@ -1066,9 +1065,8 @@ std::vector<Test::Result> Text_Based_Test::run()
             Test::Result result = run_one_test(header, vars);
             if(m_cpu_flags.size() > 0)
                {
-               for(auto const& cpuid_u64 : m_cpu_flags)
+               for(auto const& cpuid_bit : m_cpu_flags)
                   {
-                  Botan::CPUID::CPUID_bits cpuid_bit = static_cast<Botan::CPUID::CPUID_bits>(cpuid_u64);
                   if(Botan::CPUID::has_cpuid_bit(cpuid_bit))
                      {
                      Botan::CPUID::clear_cpuid_bit(cpuid_bit);
diff --git a/src/tests/tests.h b/src/tests/tests.h
index bff479605..17a3f8610 100644
--- a/src/tests/tests.h
+++ b/src/tests/tests.h
@@ -12,6 +12,7 @@
 #include <botan/rng.h>
 #include <botan/hex.h>
 #include <botan/symkey.h>
+#include <botan/cpuid.h>
 #include <iosfwd>
 #include <functional>
 #include <map>
@@ -641,7 +642,7 @@ class Text_Based_Test : public Test
       std::unique_ptr<std::istream> m_cur;
       std::string m_cur_src_name;
       std::deque<std::string> m_srcs;
-      std::vector<uint64_t> m_cpu_flags;
+      std::vector<Botan::CPUID::CPUID_bits> m_cpu_flags;
    };
 
 }
diff --git a/src/tests/unit_tls.cpp b/src/tests/unit_tls.cpp
index 1055ca885..c6114b010 100644
--- a/src/tests/unit_tls.cpp
+++ b/src/tests/unit_tls.cpp
@@ -355,6 +355,11 @@ class TLS_Handshake_Test final
                                                    (side == Botan::TLS::CLIENT) ? client_extn : server_extn,
                                                    6, 1);
                }
+
+            Test_Extension(Botan::TLS::TLS_Data_Reader& reader, uint16_t)
+               {
+               m_buf = reader.get_range_vector<uint8_t>(1, 6, 6);
+               }
          private:
             std::vector<uint8_t> m_buf;
          };