diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/get_pbe.cpp | 3 | ||||
-rw-r--r-- | src/core/info.txt | 8 | ||||
-rw-r--r-- | src/core/kdf.cpp (renamed from src/pk/pubkey/kdf.cpp) | 2 | ||||
-rw-r--r-- | src/core/kdf.h | 50 | ||||
-rw-r--r-- | src/core/lookup.h | 10 | ||||
-rw-r--r-- | src/core/pk_pad.cpp (renamed from src/pk/pubkey/pk_util.cpp) | 4 | ||||
-rw-r--r-- | src/kdf/kdf1/info.txt | 1 | ||||
-rw-r--r-- | src/kdf/kdf1/kdf1.h | 2 | ||||
-rw-r--r-- | src/kdf/kdf2/kdf2.h | 2 | ||||
-rw-r--r-- | src/kdf/mgf1/mgf1.h | 3 | ||||
-rw-r--r-- | src/kdf/sslv3/prf_ssl3.h | 2 | ||||
-rw-r--r-- | src/kdf/tlsv1/prf_tls.h | 2 | ||||
-rw-r--r-- | src/kdf/x942/prf_x942.h | 2 | ||||
-rw-r--r-- | src/pk/pubkey/info.txt | 3 | ||||
-rw-r--r-- | src/pk/pubkey/pk_util.h | 92 | ||||
-rw-r--r-- | src/pk/pubkey/pkcs8.cpp | 2 | ||||
-rw-r--r-- | src/pk/pubkey/pubkey.h | 2 | ||||
-rw-r--r-- | src/pk_pad/eme1/eme1.h | 3 | ||||
-rw-r--r-- | src/pk_pad/eme_pkcs/eme_pkcs.h | 2 | ||||
-rw-r--r-- | src/pk_pad/emsa1/emsa1.h | 2 | ||||
-rw-r--r-- | src/pk_pad/emsa2/emsa2.h | 2 | ||||
-rw-r--r-- | src/pk_pad/emsa3/emsa3.h | 2 | ||||
-rw-r--r-- | src/pk_pad/emsa4/emsa4.h | 3 | ||||
-rw-r--r-- | src/pk_pad/emsa_raw/emsa_raw.h | 2 |
24 files changed, 81 insertions, 125 deletions
diff --git a/src/core/get_pbe.cpp b/src/core/get_pbe.cpp index 6bd85b3e1..cd1ed2aa4 100644 --- a/src/core/get_pbe.cpp +++ b/src/core/get_pbe.cpp @@ -3,8 +3,7 @@ * (C) 1999-2007 Jack Lloyd * *************************************************/ -#include <botan/lookup.h> -#include <botan/pbe.h> +#include <botan/get_pbe.h> #include <botan/oids.h> #include <botan/parsing.h> diff --git a/src/core/info.txt b/src/core/info.txt index 16f2a041f..a77165072 100644 --- a/src/core/info.txt +++ b/src/core/info.txt @@ -23,15 +23,17 @@ def_powm.cpp eng_base.cpp engine.cpp exceptn.cpp -lookup.cpp get_enc.cpp get_pbe.cpp init_def.cpp init_opt.cpp +kdf.cpp libstate.cpp look_pk.cpp +lookup.cpp modules.cpp oids.cpp +pk_pad.cpp policy.cpp rng.cpp s2k.cpp @@ -45,15 +47,17 @@ engine.h enums.h exceptn.h init.h +kdf.h libstate.h look_add.h look_pk.h +get_pbe.h lookup.h modules.h mutex.h oids.h +pk_pad.h rng.h s2k.h symkey.h </add> - diff --git a/src/pk/pubkey/kdf.cpp b/src/core/kdf.cpp index dca56e1a6..2d24d896c 100644 --- a/src/pk/pubkey/kdf.cpp +++ b/src/core/kdf.cpp @@ -3,7 +3,7 @@ * (C) 1999-2007 Jack Lloyd * *************************************************/ -#include <botan/pk_util.h> +#include <botan/kdf.h> #include <botan/lookup.h> #include <botan/loadstor.h> #include <algorithm> diff --git a/src/core/kdf.h b/src/core/kdf.h new file mode 100644 index 000000000..7d0c1866b --- /dev/null +++ b/src/core/kdf.h @@ -0,0 +1,50 @@ +/************************************************* +* KDF/MGF Header File * +* (C) 1999-2007 Jack Lloyd * +*************************************************/ + +#ifndef BOTAN_KDF_BASE_H__ +#define BOTAN_KDF_BASE_H__ + +#include <botan/secmem.h> +#include <botan/types.h> + +namespace Botan { + +/************************************************* +* Key Derivation Function * +*************************************************/ +class BOTAN_DLL KDF + { + public: + SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&, + const std::string& = "") const; + SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&, + const MemoryRegion<byte>&) const; + SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&, + const byte[], u32bit) const; + + SecureVector<byte> derive_key(u32bit, const byte[], u32bit, + const std::string& = "") const; + SecureVector<byte> derive_key(u32bit, const byte[], u32bit, + const byte[], u32bit) const; + + virtual ~KDF() {} + private: + virtual SecureVector<byte> derive(u32bit, const byte[], u32bit, + const byte[], u32bit) const = 0; + }; + +/************************************************* +* Mask Generation Function * +*************************************************/ +class BOTAN_DLL MGF + { + public: + virtual void mask(const byte[], u32bit, byte[], u32bit) const = 0; + virtual ~MGF() {} + }; + +} + +#endif diff --git a/src/core/lookup.h b/src/core/lookup.h index fb163342a..016ad4618 100644 --- a/src/core/lookup.h +++ b/src/core/lookup.h @@ -10,10 +10,10 @@ #include <botan/enums.h> #include <botan/filters.h> #include <botan/mode_pad.h> -#include <botan/pk_util.h> +#include <botan/kdf.h> +#include <botan/pk_pad.h> #include <botan/libstate.h> #include <botan/s2k.h> -#include <botan/pbe.h> namespace Botan { @@ -48,12 +48,6 @@ BOTAN_DLL S2K* get_s2k(const std::string&); BOTAN_DLL const BlockCipherModePaddingMethod* get_bc_pad(const std::string&); /************************************************* -* Get a PBE object * -*************************************************/ -BOTAN_DLL PBE* get_pbe(const std::string&); -BOTAN_DLL PBE* get_pbe(const OID&, DataSource&); - -/************************************************* * Get an EMSA/EME/KDF/MGF function * *************************************************/ BOTAN_DLL EME* get_eme(const std::string&); diff --git a/src/pk/pubkey/pk_util.cpp b/src/core/pk_pad.cpp index 1976436ea..23dc9a95b 100644 --- a/src/pk/pubkey/pk_util.cpp +++ b/src/core/pk_pad.cpp @@ -1,9 +1,9 @@ /************************************************* -* PK Utility Classes Source File * +* EME/EMSA Base Class Source File * * (C) 1999-2008 Jack Lloyd * *************************************************/ -#include <botan/pk_util.h> +#include <botan/pk_pad.h> namespace Botan { diff --git a/src/kdf/kdf1/info.txt b/src/kdf/kdf1/info.txt index 802df67d0..65011907e 100644 --- a/src/kdf/kdf1/info.txt +++ b/src/kdf/kdf1/info.txt @@ -8,3 +8,4 @@ load_on auto kdf1.h kdf1.cpp </add> + diff --git a/src/kdf/kdf1/kdf1.h b/src/kdf/kdf1/kdf1.h index ebc1979fc..9aaa81d2b 100644 --- a/src/kdf/kdf1/kdf1.h +++ b/src/kdf/kdf1/kdf1.h @@ -6,7 +6,7 @@ #ifndef BOTAN_KDF1_H__ #define BOTAN_KDF1_H__ -#include <botan/pk_util.h> +#include <botan/kdf.h> namespace Botan { diff --git a/src/kdf/kdf2/kdf2.h b/src/kdf/kdf2/kdf2.h index 003f0fc45..f3768f15f 100644 --- a/src/kdf/kdf2/kdf2.h +++ b/src/kdf/kdf2/kdf2.h @@ -6,7 +6,7 @@ #ifndef BOTAN_KDF2_H__ #define BOTAN_KDF2_H__ -#include <botan/pk_util.h> +#include <botan/kdf.h> namespace Botan { diff --git a/src/kdf/mgf1/mgf1.h b/src/kdf/mgf1/mgf1.h index c235821bf..dee762f3b 100644 --- a/src/kdf/mgf1/mgf1.h +++ b/src/kdf/mgf1/mgf1.h @@ -6,7 +6,8 @@ #ifndef BOTAN_MGF1_H__ #define BOTAN_MGF1_H__ -#include <botan/pk_util.h> +#include <botan/kdf.h> +#include <botan/base.h> namespace Botan { diff --git a/src/kdf/sslv3/prf_ssl3.h b/src/kdf/sslv3/prf_ssl3.h index 951ccfe92..b8f498832 100644 --- a/src/kdf/sslv3/prf_ssl3.h +++ b/src/kdf/sslv3/prf_ssl3.h @@ -6,7 +6,7 @@ #ifndef BOTAN_SSLV3_PRF_H__ #define BOTAN_SSLV3_PRF_H__ -#include <botan/pk_util.h> +#include <botan/kdf.h> namespace Botan { diff --git a/src/kdf/tlsv1/prf_tls.h b/src/kdf/tlsv1/prf_tls.h index ebd0815ca..7d7134740 100644 --- a/src/kdf/tlsv1/prf_tls.h +++ b/src/kdf/tlsv1/prf_tls.h @@ -6,7 +6,7 @@ #ifndef BOTAN_TLS_PRF__ #define BOTAN_TLS_PRF__ -#include <botan/pk_util.h> +#include <botan/kdf.h> namespace Botan { diff --git a/src/kdf/x942/prf_x942.h b/src/kdf/x942/prf_x942.h index 9b78d1f86..3b5bb93c0 100644 --- a/src/kdf/x942/prf_x942.h +++ b/src/kdf/x942/prf_x942.h @@ -6,7 +6,7 @@ #ifndef BOTAN_ANSI_X942_PRF_H__ #define BOTAN_ANSI_X942_PRF_H__ -#include <botan/pk_util.h> +#include <botan/kdf.h> namespace Botan { diff --git a/src/pk/pubkey/info.txt b/src/pk/pubkey/info.txt index ecb6ce2d1..ebcb4eb0e 100644 --- a/src/pk/pubkey/info.txt +++ b/src/pk/pubkey/info.txt @@ -14,7 +14,6 @@ asn1 dh_op.cpp dsa_op.cpp elg_op.cpp -kdf.cpp nr_op.cpp pk_algs.cpp pk_algs.h @@ -23,8 +22,6 @@ pk_core.h pk_keys.cpp pk_keys.h pk_ops.h -pk_util.cpp -pk_util.h pkcs8.cpp pkcs8.h pubkey.cpp diff --git a/src/pk/pubkey/pk_util.h b/src/pk/pubkey/pk_util.h deleted file mode 100644 index aa7a71234..000000000 --- a/src/pk/pubkey/pk_util.h +++ /dev/null @@ -1,92 +0,0 @@ -/************************************************* -* PK Utility Classes Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#ifndef BOTAN_PUBKEY_UTIL_H__ -#define BOTAN_PUBKEY_UTIL_H__ - -#include <botan/base.h> -#include <botan/rng.h> - -namespace Botan { - -/************************************************* -* Encoding Method for Encryption * -*************************************************/ -class BOTAN_DLL EME - { - public: - virtual u32bit maximum_input_size(u32bit) const = 0; - - SecureVector<byte> encode(const byte[], u32bit, u32bit, - RandomNumberGenerator&) const; - SecureVector<byte> encode(const MemoryRegion<byte>&, u32bit, - RandomNumberGenerator&) const; - - SecureVector<byte> decode(const byte[], u32bit, u32bit) const; - SecureVector<byte> decode(const MemoryRegion<byte>&, u32bit) const; - - virtual ~EME() {} - private: - virtual SecureVector<byte> pad(const byte[], u32bit, u32bit, - RandomNumberGenerator&) const = 0; - - virtual SecureVector<byte> unpad(const byte[], u32bit, u32bit) const = 0; - }; - -/************************************************* -* Encoding Method for Signatures, Appendix * -*************************************************/ -class BOTAN_DLL EMSA - { - public: - virtual void update(const byte[], u32bit) = 0; - virtual SecureVector<byte> raw_data() = 0; - - virtual SecureVector<byte> encoding_of(const MemoryRegion<byte>&, - u32bit, - RandomNumberGenerator& rng) = 0; - - virtual bool verify(const MemoryRegion<byte>&, const MemoryRegion<byte>&, - u32bit) throw() = 0; - virtual ~EMSA() {} - }; - -/************************************************* -* Key Derivation Function * -*************************************************/ -class BOTAN_DLL KDF - { - public: - SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&, - const std::string& = "") const; - SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&, - const MemoryRegion<byte>&) const; - SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&, - const byte[], u32bit) const; - - SecureVector<byte> derive_key(u32bit, const byte[], u32bit, - const std::string& = "") const; - SecureVector<byte> derive_key(u32bit, const byte[], u32bit, - const byte[], u32bit) const; - - virtual ~KDF() {} - private: - virtual SecureVector<byte> derive(u32bit, const byte[], u32bit, - const byte[], u32bit) const = 0; - }; - -/************************************************* -* Mask Generation Function * -*************************************************/ -class BOTAN_DLL MGF - { - public: - virtual void mask(const byte[], u32bit, byte[], u32bit) const = 0; - virtual ~MGF() {} - }; - -} - -#endif diff --git a/src/pk/pubkey/pkcs8.cpp b/src/pk/pubkey/pkcs8.cpp index 2963c9d86..a79a616a2 100644 --- a/src/pk/pubkey/pkcs8.cpp +++ b/src/pk/pubkey/pkcs8.cpp @@ -4,13 +4,13 @@ *************************************************/ #include <botan/pkcs8.h> +#include <botan/get_pbe.h> #include <botan/der_enc.h> #include <botan/ber_dec.h> #include <botan/asn1_obj.h> #include <botan/pk_algs.h> #include <botan/oids.h> #include <botan/pem.h> -#include <botan/lookup.h> #include <memory> namespace Botan { diff --git a/src/pk/pubkey/pubkey.h b/src/pk/pubkey/pubkey.h index 0c9abf18f..52f14c5b3 100644 --- a/src/pk/pubkey/pubkey.h +++ b/src/pk/pubkey/pubkey.h @@ -8,7 +8,7 @@ #include <botan/base.h> #include <botan/pk_keys.h> -#include <botan/pk_util.h> +#include <botan/pk_pad.h> namespace Botan { diff --git a/src/pk_pad/eme1/eme1.h b/src/pk_pad/eme1/eme1.h index 2a0ac92c4..af8530470 100644 --- a/src/pk_pad/eme1/eme1.h +++ b/src/pk_pad/eme1/eme1.h @@ -6,7 +6,8 @@ #ifndef BOTAN_EME1_H__ #define BOTAN_EME1_H__ -#include <botan/pk_util.h> +#include <botan/pk_pad.h> +#include <botan/kdf.h> namespace Botan { diff --git a/src/pk_pad/eme_pkcs/eme_pkcs.h b/src/pk_pad/eme_pkcs/eme_pkcs.h index 9ec500c54..f23a9733d 100644 --- a/src/pk_pad/eme_pkcs/eme_pkcs.h +++ b/src/pk_pad/eme_pkcs/eme_pkcs.h @@ -6,7 +6,7 @@ #ifndef BOTAN_EME_PKCS1_H__ #define BOTAN_EME_PKCS1_H__ -#include <botan/pk_util.h> +#include <botan/pk_pad.h> namespace Botan { diff --git a/src/pk_pad/emsa1/emsa1.h b/src/pk_pad/emsa1/emsa1.h index f8d7ac043..c0eec8d17 100644 --- a/src/pk_pad/emsa1/emsa1.h +++ b/src/pk_pad/emsa1/emsa1.h @@ -6,7 +6,7 @@ #ifndef BOTAN_EMSA1_H__ #define BOTAN_EMSA1_H__ -#include <botan/pk_util.h> +#include <botan/pk_pad.h> namespace Botan { diff --git a/src/pk_pad/emsa2/emsa2.h b/src/pk_pad/emsa2/emsa2.h index 5db9593f8..79e21a8f8 100644 --- a/src/pk_pad/emsa2/emsa2.h +++ b/src/pk_pad/emsa2/emsa2.h @@ -6,7 +6,7 @@ #ifndef BOTAN_EMSA2_H__ #define BOTAN_EMSA2_H__ -#include <botan/pk_util.h> +#include <botan/pk_pad.h> namespace Botan { diff --git a/src/pk_pad/emsa3/emsa3.h b/src/pk_pad/emsa3/emsa3.h index fa8521216..bdaec5c42 100644 --- a/src/pk_pad/emsa3/emsa3.h +++ b/src/pk_pad/emsa3/emsa3.h @@ -6,7 +6,7 @@ #ifndef BOTAN_EMSA3_H__ #define BOTAN_EMSA3_H__ -#include <botan/pk_util.h> +#include <botan/pk_pad.h> namespace Botan { diff --git a/src/pk_pad/emsa4/emsa4.h b/src/pk_pad/emsa4/emsa4.h index f4d4a4b6d..8f2505281 100644 --- a/src/pk_pad/emsa4/emsa4.h +++ b/src/pk_pad/emsa4/emsa4.h @@ -6,7 +6,8 @@ #ifndef BOTAN_EMSA4_H__ #define BOTAN_EMSA4_H__ -#include <botan/pk_util.h> +#include <botan/pk_pad.h> +#include <botan/kdf.h> namespace Botan { diff --git a/src/pk_pad/emsa_raw/emsa_raw.h b/src/pk_pad/emsa_raw/emsa_raw.h index a9e21d0e0..923a390d3 100644 --- a/src/pk_pad/emsa_raw/emsa_raw.h +++ b/src/pk_pad/emsa_raw/emsa_raw.h @@ -6,7 +6,7 @@ #ifndef BOTAN_EMSA_RAW_H__ #define BOTAN_EMSA_RAW_H__ -#include <botan/pk_util.h> +#include <botan/pk_pad.h> namespace Botan { |