diff options
Diffstat (limited to 'src/libstate')
-rw-r--r-- | src/libstate/botan.h | 2 | ||||
-rw-r--r-- | src/libstate/init.cpp | 2 | ||||
-rw-r--r-- | src/libstate/init.h | 11 | ||||
-rw-r--r-- | src/libstate/libstate.h | 10 | ||||
-rw-r--r-- | src/libstate/look_pk.h | 20 | ||||
-rw-r--r-- | src/libstate/lookup.cpp | 20 | ||||
-rw-r--r-- | src/libstate/lookup.h | 107 | ||||
-rw-r--r-- | src/libstate/oid_lookup/oids.h | 4 | ||||
-rw-r--r-- | src/libstate/scan_name.cpp | 2 | ||||
-rw-r--r-- | src/libstate/scan_name.h | 36 |
10 files changed, 132 insertions, 82 deletions
diff --git a/src/libstate/botan.h b/src/libstate/botan.h index a88edb59b..42d3dc392 100644 --- a/src/libstate/botan.h +++ b/src/libstate/botan.h @@ -1,4 +1,4 @@ -/** +/* * A vague catch all include file for Botan * (C) 1999-2007 Jack Lloyd * diff --git a/src/libstate/init.cpp b/src/libstate/init.cpp index 0d9a2420c..a65098d5a 100644 --- a/src/libstate/init.cpp +++ b/src/libstate/init.cpp @@ -1,4 +1,4 @@ -/** +/* * Default Initialization Function * (C) 1999-2009 Jack Lloyd * diff --git a/src/libstate/init.h b/src/libstate/init.h index 254f9458b..2d70e4370 100644 --- a/src/libstate/init.h +++ b/src/libstate/init.h @@ -1,4 +1,4 @@ -/** +/* * Library Initialization * (C) 1999-2008 Jack Lloyd * @@ -22,13 +22,20 @@ namespace Botan { class BOTAN_DLL LibraryInitializer { public: + /** + * Initialize the library + * @param options a string listing initialization options + */ static void initialize(const std::string& options = ""); + /** + * Shutdown the library + */ static void deinitialize(); /** * Initialize the library - * @param thread_safe if the library should use a thread-safe mutex + * @param options a string listing initialization options */ LibraryInitializer(const std::string& options = "") { LibraryInitializer::initialize(options); } diff --git a/src/libstate/libstate.h b/src/libstate/libstate.h index 5af55e9d8..f3abdf87a 100644 --- a/src/libstate/libstate.h +++ b/src/libstate/libstate.h @@ -34,12 +34,12 @@ class BOTAN_DLL Library_State void initialize(); /** - * @return the global Algorithm_Factory + * @return global Algorithm_Factory */ Algorithm_Factory& algorithm_factory() const; /** - * @return the global RandomNumberGenerator + * @return global RandomNumberGenerator */ RandomNumberGenerator& global_rng(); @@ -71,8 +71,7 @@ class BOTAN_DLL Library_State const std::string& key); /** - * Check whether a certain parameter is set - * or not. + * Check whether a certain parameter is set or not. * @param section the section of the desired key * @param key the desired keys name * @result true if the parameters value is set, @@ -85,6 +84,7 @@ class BOTAN_DLL Library_State * Set a configuration parameter. * @param section the section of the desired key * @param key the desired keys name + * @param value the new value * @param overwrite if set to true, the parameters value * will be overwritten even if it is already set, otherwise * no existing values will be overwritten. @@ -144,7 +144,7 @@ BOTAN_DLL void set_global_state(Library_State* state); /** * Swap the current state for another * @param new_state the new state object to use -* @return the previous state (or NULL if none) +* @return previous state (or NULL if none) */ BOTAN_DLL Library_State* swap_global_state(Library_State* new_state); diff --git a/src/libstate/look_pk.h b/src/libstate/look_pk.h index 833b28f67..c980e5f8d 100644 --- a/src/libstate/look_pk.h +++ b/src/libstate/look_pk.h @@ -15,9 +15,11 @@ namespace Botan { /** * Public key encryptor factory method. +* @deprecated Instantiate object from pubkey.h directly +* * @param key the key that will work inside the encryptor * @param eme determines the algorithm and encoding -* @return the public key encryptor object +* @return public key encryptor object */ inline PK_Encryptor* get_pk_encryptor(const Public_Key& key, const std::string& eme) @@ -27,9 +29,11 @@ inline PK_Encryptor* get_pk_encryptor(const Public_Key& key, /** * Public key decryptor factory method. +* @deprecated Instantiate object from pubkey.h directly +* * @param key the key that will work inside the decryptor * @param eme determines the algorithm and encoding -* @return the public key decryptor object +* @return public key decryptor object */ inline PK_Decryptor* get_pk_decryptor(const Private_Key& key, const std::string& eme) @@ -39,10 +43,12 @@ inline PK_Decryptor* get_pk_decryptor(const Private_Key& key, /** * Public key signer factory method. +* @deprecated Instantiate object from pubkey.h directly +* * @param key the key that will work inside the signer * @param emsa determines the algorithm, encoding and hash algorithm * @param sig_format the signature format to be used -* @return the public key signer object +* @return public key signer object */ inline PK_Signer* get_pk_signer(const Private_Key& key, const std::string& emsa, @@ -53,10 +59,12 @@ inline PK_Signer* get_pk_signer(const Private_Key& key, /** * Public key verifier factory method. +* @deprecated Instantiate object from pubkey.h directly +* * @param key the key that will work inside the verifier * @param emsa determines the algorithm, encoding and hash algorithm * @param sig_format the signature format to be used -* @return the public key verifier object +* @return public key verifier object */ inline PK_Verifier* get_pk_verifier(const Public_Key& key, const std::string& emsa, @@ -67,9 +75,11 @@ inline PK_Verifier* get_pk_verifier(const Public_Key& key, /** * Public key key agreement factory method. +* @deprecated Instantiate object from pubkey.h directly +* * @param key the key that will work inside the key agreement * @param kdf the kdf algorithm to use -* @return the key agreement algorithm +* @return key agreement algorithm */ inline PK_Key_Agreement* get_pk_kas(const PK_Key_Agreement_Key& key, const std::string& kdf) diff --git a/src/libstate/lookup.cpp b/src/libstate/lookup.cpp index 01f4a3d42..586c335e6 100644 --- a/src/libstate/lookup.cpp +++ b/src/libstate/lookup.cpp @@ -11,7 +11,7 @@ namespace Botan { -/** +/* * Query if an algorithm exists */ bool have_algorithm(const std::string& name) @@ -29,7 +29,7 @@ bool have_algorithm(const std::string& name) return false; } -/** +/* * Query the block size of a cipher or hash */ u32bit block_size_of(const std::string& name) @@ -45,7 +45,7 @@ u32bit block_size_of(const std::string& name) throw Algorithm_Not_Found(name); } -/** +/* * Query the OUTPUT_LENGTH of a hash or MAC */ u32bit output_length_of(const std::string& name) @@ -61,7 +61,7 @@ u32bit output_length_of(const std::string& name) throw Algorithm_Not_Found(name); } -/** +/* * Check if a keylength is valid for this algo */ bool valid_keylength_for(u32bit key_len, const std::string& name) @@ -80,7 +80,7 @@ bool valid_keylength_for(u32bit key_len, const std::string& name) throw Algorithm_Not_Found(name); } -/** +/* * Query the MINIMUM_KEYLENGTH of an algorithm */ u32bit min_keylength_of(const std::string& name) @@ -99,7 +99,7 @@ u32bit min_keylength_of(const std::string& name) throw Algorithm_Not_Found(name); } -/** +/* * Query the MAXIMUM_KEYLENGTH of an algorithm */ u32bit max_keylength_of(const std::string& name) @@ -118,7 +118,7 @@ u32bit max_keylength_of(const std::string& name) throw Algorithm_Not_Found(name); } -/** +/* * Query the KEYLENGTH_MULTIPLE of an algorithm */ u32bit keylength_multiple_of(const std::string& name) @@ -137,7 +137,7 @@ u32bit keylength_multiple_of(const std::string& name) throw Algorithm_Not_Found(name); } -/** +/* * Get a cipher object */ Keyed_Filter* get_cipher(const std::string& algo_spec, @@ -156,7 +156,7 @@ Keyed_Filter* get_cipher(const std::string& algo_spec, throw Algorithm_Not_Found(algo_spec); } -/** +/* * Get a cipher object */ Keyed_Filter* get_cipher(const std::string& algo_spec, @@ -173,7 +173,7 @@ Keyed_Filter* get_cipher(const std::string& algo_spec, return cipher; } -/** +/* * Get a cipher object */ Keyed_Filter* get_cipher(const std::string& algo_spec, diff --git a/src/libstate/lookup.h b/src/libstate/lookup.h index 5f10bb3f8..76e06b2de 100644 --- a/src/libstate/lookup.h +++ b/src/libstate/lookup.h @@ -61,8 +61,10 @@ retrieve_mac(const std::string& algo_spec) /** * Block cipher factory method. +* @deprecated Call algorithm_factory() directly +* * @param algo_spec the name of the desired block cipher -* @return a pointer to the block cipher object +* @return pointer to the block cipher object */ inline BlockCipher* get_block_cipher(const std::string& algo_spec) { @@ -72,8 +74,10 @@ inline BlockCipher* get_block_cipher(const std::string& algo_spec) /** * Stream cipher factory method. +* @deprecated Call algorithm_factory() directly +* * @param algo_spec the name of the desired stream cipher -* @return a pointer to the stream cipher object +* @return pointer to the stream cipher object */ inline StreamCipher* get_stream_cipher(const std::string& algo_spec) { @@ -83,8 +87,10 @@ inline StreamCipher* get_stream_cipher(const std::string& algo_spec) /** * Hash function factory method. +* @deprecated Call algorithm_factory() directly +* * @param algo_spec the name of the desired hash function -* @return a pointer to the hash function object +* @return pointer to the hash function object */ inline HashFunction* get_hash(const std::string& algo_spec) { @@ -94,8 +100,10 @@ inline HashFunction* get_hash(const std::string& algo_spec) /** * MAC factory method. +* @deprecated Call algorithm_factory() directly +* * @param algo_spec the name of the desired MAC -* @return a pointer to the MAC object +* @return pointer to the MAC object */ inline MessageAuthenticationCode* get_mac(const std::string& algo_spec) { @@ -105,8 +113,8 @@ inline MessageAuthenticationCode* get_mac(const std::string& algo_spec) /** * String to key algorithm factory method. -* @param name the name of the desired string to key (S2K) algorithm -* @return a pointer to the string to key algorithm object +* @param algo_spec the name of the desired string to key (S2K) algorithm +* @return pointer to the string to key algorithm object */ BOTAN_DLL S2K* get_s2k(const std::string& algo_spec); @@ -118,23 +126,23 @@ BOTAN_DLL S2K* get_s2k(const std::string& algo_spec); /** * Factory method for EME (message-encoding methods for encryption) objects -* @param name the name of the EME to create -* @return a pointer to the desired EME object +* @param algo_spec the name of the EME to create +* @return pointer to the desired EME object */ BOTAN_DLL EME* get_eme(const std::string& algo_spec); /** * Factory method for EMSA (message-encoding methods for signatures * with appendix) objects -* @param name the name of the EME to create -* @return a pointer to the desired EME object +* @param algo_spec the name of the EME to create +* @return pointer to the desired EME object */ BOTAN_DLL EMSA* get_emsa(const std::string& algo_spec); /** * Factory method for KDF (key derivation function) -* @param name the name of the KDF to create -* @return a pointer to the desired KDF object +* @param algo_spec the name of the KDF to create +* @return pointer to the desired KDF object */ BOTAN_DLL KDF* get_kdf(const std::string& algo_spec); @@ -150,12 +158,13 @@ BOTAN_DLL KDF* get_kdf(const std::string& algo_spec); * @param iv the initialization vector to be used * @param direction determines whether the filter will be an encrypting * or decrypting filter -* @return a pointer to the encryption or decryption filter +* @return pointer to the encryption or decryption filter */ -BOTAN_DLL Keyed_Filter* get_cipher(const std::string& name, +BOTAN_DLL Keyed_Filter* get_cipher(const std::string& algo_spec, const SymmetricKey& key, const InitializationVector& iv, - Cipher_Dir dir); + Cipher_Dir direction); + /** * Factory method for general symmetric cipher filters. * @param algo_spec the name of the desired cipher @@ -163,32 +172,36 @@ BOTAN_DLL Keyed_Filter* get_cipher(const std::string& name, * the filter * @param direction determines whether the filter will be an encrypting * or decrypting filter -* @return a pointer to the encryption or decryption filter +* @return pointer to the encryption or decryption filter */ -BOTAN_DLL Keyed_Filter* get_cipher(const std::string& name, +BOTAN_DLL Keyed_Filter* get_cipher(const std::string& algo_spec, const SymmetricKey& key, - Cipher_Dir dir); + Cipher_Dir direction); -/** Factory method for general symmetric cipher filters. No key will -* be set in the filter. +/** +* Factory method for general symmetric cipher filters. No key will be +* set in the filter. +* * @param algo_spec the name of the desired cipher - * @param direction determines whether the filter will be an encrypting or * decrypting filter -* @return a pointer to the encryption or decryption filter +* @return pointer to the encryption or decryption filter */ -BOTAN_DLL Keyed_Filter* get_cipher(const std::string& name, Cipher_Dir dir); +BOTAN_DLL Keyed_Filter* get_cipher(const std::string& algo_spec, + Cipher_Dir direction); /** * Check if an algorithm exists. -* @param name the name of the algorithm to check for +* @param algo_spec the name of the algorithm to check for * @return true if the algorithm exists, false otherwise */ BOTAN_DLL bool have_algorithm(const std::string& algo_spec); /** * Check if a block cipher algorithm exists. -* @param name the name of the algorithm to check for +* @deprecated Call algorithm_factory() directly +* +* @param algo_spec the name of the algorithm to check for * @return true if the algorithm exists, false otherwise */ inline bool have_block_cipher(const std::string& algo_spec) @@ -199,7 +212,9 @@ inline bool have_block_cipher(const std::string& algo_spec) /** * Check if a stream cipher algorithm exists. -* @param name the name of the algorithm to check for +* @deprecated Call algorithm_factory() directly +* +* @param algo_spec the name of the algorithm to check for * @return true if the algorithm exists, false otherwise */ inline bool have_stream_cipher(const std::string& algo_spec) @@ -210,6 +225,8 @@ inline bool have_stream_cipher(const std::string& algo_spec) /** * Check if a hash algorithm exists. +* @deprecated Call algorithm_factory() directly +* * @param algo_spec the name of the algorithm to check for * @return true if the algorithm exists, false otherwise */ @@ -221,6 +238,8 @@ inline bool have_hash(const std::string& algo_spec) /** * Check if a MAC algorithm exists. +* @deprecated Call algorithm_factory() directly +* * @param algo_spec the name of the algorithm to check for * @return true if the algorithm exists, false otherwise */ @@ -236,46 +255,58 @@ inline bool have_mac(const std::string& algo_spec) /** * Find out the block size of a certain symmetric algorithm. -* @param name the name of the algorithm -* @return the block size of the specified algorithm +* @deprecated Call algorithm_factory() directly +* +* @param algo_spec the name of the algorithm +* @return block size of the specified algorithm */ BOTAN_DLL u32bit block_size_of(const std::string& algo_spec); /** * Find out the output length of a certain symmetric algorithm. -* @param name the name of the algorithm -* @return the output length of the specified algorithm +* @deprecated Call algorithm_factory() directly +* +* @param algo_spec the name of the algorithm +* @return output length of the specified algorithm */ BOTAN_DLL u32bit output_length_of(const std::string& algo_spec); /** * Find out the whether a certain key length is allowd for a given * symmetric algorithm. +* @deprecated Call algorithm_factory() directly +* * @param key_len the key length in question -* @param name the name of the algorithm +* @param algo_spec the name of the algorithm * @return true if the key length is valid for that algorithm, false otherwise */ -BOTAN_DLL bool valid_keylength_for(u32bit keylen, +BOTAN_DLL bool valid_keylength_for(u32bit key_len, const std::string& algo_spec); /** * Find out the minimum key size of a certain symmetric algorithm. -* @param name the name of the algorithm -* @return the minimum key length of the specified algorithm +* @deprecated Call algorithm_factory() directly +* +* @param algo_spec the name of the algorithm +* @return minimum key length of the specified algorithm */ BOTAN_DLL u32bit min_keylength_of(const std::string& algo_spec); /** * Find out the maximum key size of a certain symmetric algorithm. -* @param name the name of the algorithm -* @return the maximum key length of the specified algorithm +* @deprecated Call algorithm_factory() directly +* +* @param algo_spec the name of the algorithm +* @return maximum key length of the specified algorithm */ BOTAN_DLL u32bit max_keylength_of(const std::string& algo_spec); /** * Find out the size any valid key is a multiple of for a certain algorithm. -* @param name the name of the algorithm -* @return the size any valid key is a multiple of +* @deprecated Call algorithm_factory() directly +* +* @param algo_spec the name of the algorithm +* @return size any valid key is a multiple of */ BOTAN_DLL u32bit keylength_multiple_of(const std::string& algo_spec); diff --git a/src/libstate/oid_lookup/oids.h b/src/libstate/oid_lookup/oids.h index fdfe61f7c..70b7dee81 100644 --- a/src/libstate/oid_lookup/oids.h +++ b/src/libstate/oid_lookup/oids.h @@ -31,7 +31,7 @@ BOTAN_DLL bool have_oid(const std::string& oid); /** * Resolve an OID * @param oid the OID to look up -* @return the name associated with this OID +* @return name associated with this OID */ BOTAN_DLL std::string lookup(const OID& oid); @@ -39,7 +39,7 @@ BOTAN_DLL std::string lookup(const OID& oid); * Find the OID to a name. The lookup will be performed in the * general OID section of the configuration. * @param name the name to resolve -* @return the OID associated with the specified name +* @return OID associated with the specified name */ BOTAN_DLL OID lookup(const std::string& name); diff --git a/src/libstate/scan_name.cpp b/src/libstate/scan_name.cpp index eccb15565..7c2e4b28d 100644 --- a/src/libstate/scan_name.cpp +++ b/src/libstate/scan_name.cpp @@ -1,4 +1,4 @@ -/** +/* * SCAN Name Abstraction * (C) 2008-2009 Jack Lloyd * diff --git a/src/libstate/scan_name.h b/src/libstate/scan_name.h index 4350dca86..3d11d54f6 100644 --- a/src/libstate/scan_name.h +++ b/src/libstate/scan_name.h @@ -1,4 +1,4 @@ -/** +/* * SCAN Name Abstraction * (C) 2008 Jack Lloyd * @@ -23,64 +23,66 @@ class BOTAN_DLL SCAN_Name { public: /** - @param algo_spec A SCAN-format name + * @param algo_spec A SCAN-format name */ SCAN_Name(std::string algo_spec); /** - @return the original input string + * @return original input string */ std::string as_string() const { return orig_algo_spec; } /** - @return the algorithm name + * @return algorithm name */ std::string algo_name() const { return alg_name; } /** - @return the algorithm name plus any arguments + * @return algorithm name plus any arguments */ std::string algo_name_and_args() const; /** - @return the number of arguments + * @return number of arguments */ u32bit arg_count() const { return args.size(); } /** - @return if the number of arguments is between lower and upper + * @param lower is the lower bound + * @param upper is the upper bound + * @return if the number of arguments is between lower and upper */ bool arg_count_between(u32bit lower, u32bit upper) const { return ((arg_count() >= lower) && (arg_count() <= upper)); } /** - @param i which argument - @return the ith argument + * @param i which argument + * @return ith argument */ std::string arg(u32bit i) const; /** - @param i which argument - @param def_value the default value - @return the ith argument or the default value + * @param i which argument + * @param def_value the default value + * @return ith argument or the default value */ std::string arg(u32bit i, const std::string& def_value) const; /** - @param i which argument - @param def_value the default value - @return the ith argument as a u32bit, or the default value + * @param i which argument + * @param def_value the default value + * @return ith argument as a u32bit, or the default value */ u32bit arg_as_u32bit(u32bit i, u32bit def_value) const; /** - @return the cipher mode (if any) + * @return cipher mode (if any) */ std::string cipher_mode() const { return (mode_info.size() >= 1) ? mode_info[0] : ""; } /** - @return the cipher mode padding (if any) + * @return cipher mode padding (if any) */ std::string cipher_mode_pad() const { return (mode_info.size() >= 2) ? mode_info[1] : ""; } |