aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-28 22:40:27 +0000
committerlloyd <[email protected]>2008-09-28 22:40:27 +0000
commitc32a8e6c7ecf97fc9423e6a967ce3d98b0689404 (patch)
treed9d41c74dd0f99f43119ae355f461fae1f3bf32c
parent31204986023619c385d378e79a6511bb81ef7b78 (diff)
Move all BigInt stuff into bigint/. Currently all asm modules are disabled;
configure.pl doesn't understand how to handle this yet (replace logic only understands stuff in src, not how one module can replace another modules src, or anything about prioritizing). Move some hex and base64 stuff out of charset.cpp and into their codec directories.
-rw-r--r--.mtn-ignore2
-rw-r--r--include/filters.h10
-rw-r--r--include/lookup.h1
-rw-r--r--src/bigint/asm_amd64/xxxinfo.txt (renamed from src/bigint/asm_amd64/modinfo.txt)0
-rw-r--r--src/bigint/asm_ia32/xxxinfo.txt (renamed from src/bigint/asm_ia32/modinfo.txt)0
-rw-r--r--src/bigint/big_code.cpp (renamed from src/big_code.cpp)0
-rw-r--r--src/bigint/big_io.cpp (renamed from src/big_io.cpp)0
-rw-r--r--src/bigint/big_ops2.cpp (renamed from src/big_ops2.cpp)0
-rw-r--r--src/bigint/big_ops3.cpp (renamed from src/big_ops3.cpp)0
-rw-r--r--src/bigint/big_rand.cpp (renamed from src/big_rand.cpp)0
-rw-r--r--src/bigint/bigint.cpp (renamed from src/bigint.cpp)0
-rw-r--r--src/bigint/bigint.h (renamed from include/bigint.h)0
-rw-r--r--src/bigint/blinding.cpp (renamed from src/blinding.cpp)0
-rw-r--r--src/bigint/blinding.h (renamed from include/blinding.h)0
-rw-r--r--src/bigint/def_powm.h (renamed from include/def_powm.h)0
-rw-r--r--src/bigint/divide.cpp (renamed from src/divide.cpp)0
-rw-r--r--src/bigint/dsa_gen.cpp (renamed from src/dsa_gen.cpp)0
-rw-r--r--src/bigint/jacobi.cpp (renamed from src/jacobi.cpp)0
-rw-r--r--src/bigint/make_prm.cpp (renamed from src/make_prm.cpp)0
-rw-r--r--src/bigint/modinfo.txt43
-rw-r--r--src/bigint/mp_amd64/xxxinfo.txt (renamed from src/bigint/mp_amd64/modinfo.txt)0
-rw-r--r--src/bigint/mp_asm.cpp (renamed from src/mp_asm.cpp)0
-rw-r--r--src/bigint/mp_asm.h (renamed from include/mp_asm.h)0
-rw-r--r--src/bigint/mp_asm64/xxxinfo.txt (renamed from src/bigint/mp_asm64/modinfo.txt)0
-rw-r--r--src/bigint/mp_asmi.h (renamed from include/mp_asmi.h)0
-rw-r--r--src/bigint/mp_comba.cpp (renamed from src/mp_comba.cpp)0
-rw-r--r--src/bigint/mp_core.h (renamed from include/mp_core.h)0
-rw-r--r--src/bigint/mp_ia32/xxxinfo.txt (renamed from src/bigint/mp_ia32/modinfo.txt)0
-rw-r--r--src/bigint/mp_ia32_msvc/xxxinfo.txt (renamed from src/bigint/mp_ia32_msvc/modinfo.txt)0
-rw-r--r--src/bigint/mp_karat.cpp (renamed from src/mp_karat.cpp)0
-rw-r--r--src/bigint/mp_misc.cpp (renamed from src/mp_misc.cpp)0
-rw-r--r--src/bigint/mp_monty.cpp (renamed from src/mp_monty.cpp)0
-rw-r--r--src/bigint/mp_mulop.cpp (renamed from src/mp_mulop.cpp)0
-rw-r--r--src/bigint/mp_numth.cpp (renamed from src/mp_numth.cpp)0
-rw-r--r--src/bigint/mp_shift.cpp (renamed from src/mp_shift.cpp)0
-rw-r--r--src/bigint/mp_types.h (renamed from include/mp_types.h)0
-rw-r--r--src/bigint/numthry.cpp (renamed from src/numthry.cpp)0
-rw-r--r--src/bigint/numthry.h (renamed from include/numthry.h)0
-rw-r--r--src/bigint/pow_mod.cpp (renamed from src/pow_mod.cpp)0
-rw-r--r--src/bigint/pow_mod.h (renamed from include/pow_mod.h)0
-rw-r--r--src/bigint/powm_fw.cpp (renamed from src/powm_fw.cpp)0
-rw-r--r--src/bigint/powm_mnt.cpp (renamed from src/powm_mnt.cpp)0
-rw-r--r--src/bigint/reducer.cpp (renamed from src/reducer.cpp)0
-rw-r--r--src/bigint/reducer.h (renamed from include/reducer.h)0
-rw-r--r--src/bigint/ressol.cpp (renamed from src/ressol.cpp)0
-rw-r--r--src/charset.cpp74
-rw-r--r--src/codec/base64/b64_char.cpp45
-rw-r--r--src/codec/base64/modinfo.txt1
-rw-r--r--src/codec/hex/hex_char.cpp46
-rw-r--r--src/codec/hex/modinfo.txt1
50 files changed, 147 insertions, 76 deletions
diff --git a/.mtn-ignore b/.mtn-ignore
index a6256de22..f1023b8f3 100644
--- a/.mtn-ignore
+++ b/.mtn-ignore
@@ -13,4 +13,4 @@
^doc/examples/.*\.pem$
^misc/nist_tests/x509test$
/?callgrind.out.*
-
+^todo.txt$
diff --git a/include/filters.h b/include/filters.h
index 7b9ba6caa..926217a5d 100644
--- a/include/filters.h
+++ b/include/filters.h
@@ -9,8 +9,14 @@
#include <botan/pipe.h>
#include <botan/basefilt.h>
#include <botan/data_snk.h>
-#include <botan/base64.h>
-#include <botan/hex.h>
+
+#if defined(BOTAN_HAS_BASE64_CODEC)
+ #include <botan/base64.h>
+#endif
+
+#if defined(BOTAN_HAS_HEX_CODEC)
+ #include <botan/hex.h>
+#endif
namespace Botan {
diff --git a/include/lookup.h b/include/lookup.h
index ccf32bde2..e37c27143 100644
--- a/include/lookup.h
+++ b/include/lookup.h
@@ -7,6 +7,7 @@
#define BOTAN_LOOKUP_H__
#include <botan/base.h>
+#include <botan/enums.h>
#include <botan/filters.h>
#include <botan/mode_pad.h>
#include <botan/pk_util.h>
diff --git a/src/bigint/asm_amd64/modinfo.txt b/src/bigint/asm_amd64/xxxinfo.txt
index 2a8f9fe5b..2a8f9fe5b 100644
--- a/src/bigint/asm_amd64/modinfo.txt
+++ b/src/bigint/asm_amd64/xxxinfo.txt
diff --git a/src/bigint/asm_ia32/modinfo.txt b/src/bigint/asm_ia32/xxxinfo.txt
index 12c8cd96d..12c8cd96d 100644
--- a/src/bigint/asm_ia32/modinfo.txt
+++ b/src/bigint/asm_ia32/xxxinfo.txt
diff --git a/src/big_code.cpp b/src/bigint/big_code.cpp
index 824cbb63e..824cbb63e 100644
--- a/src/big_code.cpp
+++ b/src/bigint/big_code.cpp
diff --git a/src/big_io.cpp b/src/bigint/big_io.cpp
index 3c201e8b2..3c201e8b2 100644
--- a/src/big_io.cpp
+++ b/src/bigint/big_io.cpp
diff --git a/src/big_ops2.cpp b/src/bigint/big_ops2.cpp
index ef083f394..ef083f394 100644
--- a/src/big_ops2.cpp
+++ b/src/bigint/big_ops2.cpp
diff --git a/src/big_ops3.cpp b/src/bigint/big_ops3.cpp
index 7f412f6db..7f412f6db 100644
--- a/src/big_ops3.cpp
+++ b/src/bigint/big_ops3.cpp
diff --git a/src/big_rand.cpp b/src/bigint/big_rand.cpp
index b8cad3a4c..b8cad3a4c 100644
--- a/src/big_rand.cpp
+++ b/src/bigint/big_rand.cpp
diff --git a/src/bigint.cpp b/src/bigint/bigint.cpp
index e3c7931e6..e3c7931e6 100644
--- a/src/bigint.cpp
+++ b/src/bigint/bigint.cpp
diff --git a/include/bigint.h b/src/bigint/bigint.h
index b1286551e..b1286551e 100644
--- a/include/bigint.h
+++ b/src/bigint/bigint.h
diff --git a/src/blinding.cpp b/src/bigint/blinding.cpp
index 740904d10..740904d10 100644
--- a/src/blinding.cpp
+++ b/src/bigint/blinding.cpp
diff --git a/include/blinding.h b/src/bigint/blinding.h
index 958686fb1..958686fb1 100644
--- a/include/blinding.h
+++ b/src/bigint/blinding.h
diff --git a/include/def_powm.h b/src/bigint/def_powm.h
index c91ff002c..c91ff002c 100644
--- a/include/def_powm.h
+++ b/src/bigint/def_powm.h
diff --git a/src/divide.cpp b/src/bigint/divide.cpp
index 003a06d83..003a06d83 100644
--- a/src/divide.cpp
+++ b/src/bigint/divide.cpp
diff --git a/src/dsa_gen.cpp b/src/bigint/dsa_gen.cpp
index baaba66ee..baaba66ee 100644
--- a/src/dsa_gen.cpp
+++ b/src/bigint/dsa_gen.cpp
diff --git a/src/jacobi.cpp b/src/bigint/jacobi.cpp
index 57c78508a..57c78508a 100644
--- a/src/jacobi.cpp
+++ b/src/bigint/jacobi.cpp
diff --git a/src/make_prm.cpp b/src/bigint/make_prm.cpp
index dc26a0400..dc26a0400 100644
--- a/src/make_prm.cpp
+++ b/src/bigint/make_prm.cpp
diff --git a/src/bigint/modinfo.txt b/src/bigint/modinfo.txt
new file mode 100644
index 000000000..571c3550f
--- /dev/null
+++ b/src/bigint/modinfo.txt
@@ -0,0 +1,43 @@
+realname "BigInt"
+
+load_on auto
+
+define BIGINT
+
+<add>
+big_code.cpp
+big_io.cpp
+big_ops2.cpp
+big_ops3.cpp
+big_rand.cpp
+bigint.cpp
+bigint.h
+blinding.cpp
+blinding.h
+def_powm.h
+divide.cpp
+dsa_gen.cpp
+jacobi.cpp
+make_prm.cpp
+mp_asm.cpp
+mp_comba.cpp
+mp_core.h
+mp_karat.cpp
+mp_misc.cpp
+mp_monty.cpp
+mp_mulop.cpp
+mp_numth.cpp
+mp_shift.cpp
+numthry.cpp
+numthry.h
+pow_mod.cpp
+pow_mod.h
+powm_fw.cpp
+powm_mnt.cpp
+reducer.cpp
+reducer.h
+ressol.cpp
+mp_types.h
+mp_asm.h
+mp_asmi.h
+</add>
diff --git a/src/bigint/mp_amd64/modinfo.txt b/src/bigint/mp_amd64/xxxinfo.txt
index a042a3976..a042a3976 100644
--- a/src/bigint/mp_amd64/modinfo.txt
+++ b/src/bigint/mp_amd64/xxxinfo.txt
diff --git a/src/mp_asm.cpp b/src/bigint/mp_asm.cpp
index e5d1fe0d6..e5d1fe0d6 100644
--- a/src/mp_asm.cpp
+++ b/src/bigint/mp_asm.cpp
diff --git a/include/mp_asm.h b/src/bigint/mp_asm.h
index e62a57110..e62a57110 100644
--- a/include/mp_asm.h
+++ b/src/bigint/mp_asm.h
diff --git a/src/bigint/mp_asm64/modinfo.txt b/src/bigint/mp_asm64/xxxinfo.txt
index a9e5d53da..a9e5d53da 100644
--- a/src/bigint/mp_asm64/modinfo.txt
+++ b/src/bigint/mp_asm64/xxxinfo.txt
diff --git a/include/mp_asmi.h b/src/bigint/mp_asmi.h
index d15295154..d15295154 100644
--- a/include/mp_asmi.h
+++ b/src/bigint/mp_asmi.h
diff --git a/src/mp_comba.cpp b/src/bigint/mp_comba.cpp
index c7a9c964c..c7a9c964c 100644
--- a/src/mp_comba.cpp
+++ b/src/bigint/mp_comba.cpp
diff --git a/include/mp_core.h b/src/bigint/mp_core.h
index 92949cd83..92949cd83 100644
--- a/include/mp_core.h
+++ b/src/bigint/mp_core.h
diff --git a/src/bigint/mp_ia32/modinfo.txt b/src/bigint/mp_ia32/xxxinfo.txt
index cf4959250..cf4959250 100644
--- a/src/bigint/mp_ia32/modinfo.txt
+++ b/src/bigint/mp_ia32/xxxinfo.txt
diff --git a/src/bigint/mp_ia32_msvc/modinfo.txt b/src/bigint/mp_ia32_msvc/xxxinfo.txt
index 36d9d0290..36d9d0290 100644
--- a/src/bigint/mp_ia32_msvc/modinfo.txt
+++ b/src/bigint/mp_ia32_msvc/xxxinfo.txt
diff --git a/src/mp_karat.cpp b/src/bigint/mp_karat.cpp
index 15b0551fd..15b0551fd 100644
--- a/src/mp_karat.cpp
+++ b/src/bigint/mp_karat.cpp
diff --git a/src/mp_misc.cpp b/src/bigint/mp_misc.cpp
index db9c8cda0..db9c8cda0 100644
--- a/src/mp_misc.cpp
+++ b/src/bigint/mp_misc.cpp
diff --git a/src/mp_monty.cpp b/src/bigint/mp_monty.cpp
index c162bfd4f..c162bfd4f 100644
--- a/src/mp_monty.cpp
+++ b/src/bigint/mp_monty.cpp
diff --git a/src/mp_mulop.cpp b/src/bigint/mp_mulop.cpp
index 3ab28d306..3ab28d306 100644
--- a/src/mp_mulop.cpp
+++ b/src/bigint/mp_mulop.cpp
diff --git a/src/mp_numth.cpp b/src/bigint/mp_numth.cpp
index b024d2e2d..b024d2e2d 100644
--- a/src/mp_numth.cpp
+++ b/src/bigint/mp_numth.cpp
diff --git a/src/mp_shift.cpp b/src/bigint/mp_shift.cpp
index 033774e46..033774e46 100644
--- a/src/mp_shift.cpp
+++ b/src/bigint/mp_shift.cpp
diff --git a/include/mp_types.h b/src/bigint/mp_types.h
index 81b6d7395..81b6d7395 100644
--- a/include/mp_types.h
+++ b/src/bigint/mp_types.h
diff --git a/src/numthry.cpp b/src/bigint/numthry.cpp
index ffd523e82..ffd523e82 100644
--- a/src/numthry.cpp
+++ b/src/bigint/numthry.cpp
diff --git a/include/numthry.h b/src/bigint/numthry.h
index 371621c2d..371621c2d 100644
--- a/include/numthry.h
+++ b/src/bigint/numthry.h
diff --git a/src/pow_mod.cpp b/src/bigint/pow_mod.cpp
index 17ca7b796..17ca7b796 100644
--- a/src/pow_mod.cpp
+++ b/src/bigint/pow_mod.cpp
diff --git a/include/pow_mod.h b/src/bigint/pow_mod.h
index 37e0871da..37e0871da 100644
--- a/include/pow_mod.h
+++ b/src/bigint/pow_mod.h
diff --git a/src/powm_fw.cpp b/src/bigint/powm_fw.cpp
index c29b9f311..c29b9f311 100644
--- a/src/powm_fw.cpp
+++ b/src/bigint/powm_fw.cpp
diff --git a/src/powm_mnt.cpp b/src/bigint/powm_mnt.cpp
index 6091d467a..6091d467a 100644
--- a/src/powm_mnt.cpp
+++ b/src/bigint/powm_mnt.cpp
diff --git a/src/reducer.cpp b/src/bigint/reducer.cpp
index 47c5c20fc..47c5c20fc 100644
--- a/src/reducer.cpp
+++ b/src/bigint/reducer.cpp
diff --git a/include/reducer.h b/src/bigint/reducer.h
index 48008e73b..48008e73b 100644
--- a/include/reducer.h
+++ b/src/bigint/reducer.h
diff --git a/src/ressol.cpp b/src/bigint/ressol.cpp
index 0cd2b988a..0cd2b988a 100644
--- a/src/ressol.cpp
+++ b/src/bigint/ressol.cpp
diff --git a/src/charset.cpp b/src/charset.cpp
index 4ebf37abf..73c520be1 100644
--- a/src/charset.cpp
+++ b/src/charset.cpp
@@ -4,9 +4,8 @@
*************************************************/
#include <botan/charset.h>
-#include <botan/hex.h>
-#include <botan/base64.h>
#include <botan/parsing.h>
+#include <botan/exceptn.h>
#include <cctype>
namespace Botan {
@@ -197,75 +196,4 @@ bool caseless_cmp(char a, char b)
}
-/*************************************************
-* Hex Encoder Lookup Tables *
-*************************************************/
-const byte Hex_Encoder::BIN_TO_HEX_UPPER[16] = {
-0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43,
-0x44, 0x45, 0x46 };
-
-const byte Hex_Encoder::BIN_TO_HEX_LOWER[16] = {
-0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63,
-0x64, 0x65, 0x66 };
-
-/*************************************************
-* Base64 Encoder Lookup Table *
-*************************************************/
-const byte Base64_Encoder::BIN_TO_BASE64[64] = {
-0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D,
-0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A,
-0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D,
-0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A,
-0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x2F };
-
-/*************************************************
-* Hex Decoder Lookup Table *
-*************************************************/
-const byte Hex_Decoder::HEX_TO_BIN[256] = {
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x01, 0x02, 0x03,
-0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 };
-
-/*************************************************
-* Base64 Decoder Lookup Table *
-*************************************************/
-const byte Base64_Decoder::BASE64_TO_BIN[256] = {
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x3E, 0x80, 0x80, 0x80, 0x3F, 0x34, 0x35, 0x36, 0x37,
-0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C,
-0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,
-0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D,
-0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 };
-
}
diff --git a/src/codec/base64/b64_char.cpp b/src/codec/base64/b64_char.cpp
new file mode 100644
index 000000000..3019c4d36
--- /dev/null
+++ b/src/codec/base64/b64_char.cpp
@@ -0,0 +1,45 @@
+/*************************************************
+* Base64 Codec Character Tables *
+* (C) 1999-2008 Jack Lloyd *
+*************************************************/
+
+#include <botan/base64.h>
+
+namespace Botan {
+
+/*************************************************
+* Base64 Encoder Lookup Table *
+*************************************************/
+const byte Base64_Encoder::BIN_TO_BASE64[64] = {
+0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D,
+0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A,
+0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D,
+0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A,
+0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x2F };
+
+/*************************************************
+* Base64 Decoder Lookup Table *
+*************************************************/
+const byte Base64_Decoder::BASE64_TO_BIN[256] = {
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x3E, 0x80, 0x80, 0x80, 0x3F, 0x34, 0x35, 0x36, 0x37,
+0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C,
+0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,
+0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D,
+0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 };
+
+}
diff --git a/src/codec/base64/modinfo.txt b/src/codec/base64/modinfo.txt
index 4e7b38584..c9c05a255 100644
--- a/src/codec/base64/modinfo.txt
+++ b/src/codec/base64/modinfo.txt
@@ -6,5 +6,6 @@ load_on auto
<add>
base64.cpp
+b64_char.cpp
base64.h
</add>
diff --git a/src/codec/hex/hex_char.cpp b/src/codec/hex/hex_char.cpp
new file mode 100644
index 000000000..d34614a10
--- /dev/null
+++ b/src/codec/hex/hex_char.cpp
@@ -0,0 +1,46 @@
+/*************************************************
+* Hex Character Table *
+* (C) 1999-2008 Jack Lloyd *
+*************************************************/
+
+#include <botan/hex.h>
+
+namespace Botan {
+
+/*************************************************
+* Hex Encoder Lookup Tables *
+*************************************************/
+const byte Hex_Encoder::BIN_TO_HEX_UPPER[16] = {
+0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43,
+0x44, 0x45, 0x46 };
+
+const byte Hex_Encoder::BIN_TO_HEX_LOWER[16] = {
+0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63,
+0x64, 0x65, 0x66 };
+
+/*************************************************
+* Hex Decoder Lookup Table *
+*************************************************/
+const byte Hex_Decoder::HEX_TO_BIN[256] = {
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x01, 0x02, 0x03,
+0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 };
+
+}
diff --git a/src/codec/hex/modinfo.txt b/src/codec/hex/modinfo.txt
index e0b07a552..4977742d0 100644
--- a/src/codec/hex/modinfo.txt
+++ b/src/codec/hex/modinfo.txt
@@ -6,5 +6,6 @@ load_on auto
<add>
hex.cpp
+hex_char.cpp
hex.h
</add>