From 558f8bc9d31725dfaa946bff4aee2db0436c56b5 Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 7 Jun 2010 22:49:02 +0000 Subject: In BigInt::bits, cache sig_words() result instead of calling twice --- src/math/bigint/bigint.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/math/bigint') diff --git a/src/math/bigint/bigint.cpp b/src/math/bigint/bigint.cpp index 09ac2a75d..1f3255175 100644 --- a/src/math/bigint/bigint.cpp +++ b/src/math/bigint/bigint.cpp @@ -249,10 +249,12 @@ u32bit BigInt::bytes() const */ u32bit BigInt::bits() const { - if(sig_words() == 0) + const u32bit words = sig_words(); + + if(words == 0) return 0; - u32bit full_words = sig_words() - 1, top_bits = MP_WORD_BITS; + u32bit full_words = words - 1, top_bits = MP_WORD_BITS; word top_word = word_at(full_words), mask = MP_WORD_TOP_BIT; while(top_bits && ((top_word & mask) == 0)) -- cgit v1.2.3 From 9c333239e691d9a80368fc2068c1c3956299ec00 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 11 Jun 2010 12:22:11 +0000 Subject: Add (untested) support for VC++'s _umul128 intrinsic, which apparently works on both x86-64 and ia64. Will allow using 64-bit limbs on Windows. --- src/math/bigint/mp_amd64_msvc/info.txt | 16 +++++++++ src/math/bigint/mp_amd64_msvc/mp_asm.h | 60 ++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 src/math/bigint/mp_amd64_msvc/info.txt create mode 100644 src/math/bigint/mp_amd64_msvc/mp_asm.h (limited to 'src/math/bigint') diff --git a/src/math/bigint/mp_amd64_msvc/info.txt b/src/math/bigint/mp_amd64_msvc/info.txt new file mode 100644 index 000000000..b6f322b83 --- /dev/null +++ b/src/math/bigint/mp_amd64_msvc/info.txt @@ -0,0 +1,16 @@ +load_on dep + +mp_bits 64 + + +mp_asm.h + + + +amd64 +ia64 + + + +msvc + diff --git a/src/math/bigint/mp_amd64_msvc/mp_asm.h b/src/math/bigint/mp_amd64_msvc/mp_asm.h new file mode 100644 index 000000000..09ca303df --- /dev/null +++ b/src/math/bigint/mp_amd64_msvc/mp_asm.h @@ -0,0 +1,60 @@ +/* +* Multiply-Add for 64-bit MSVC +* (C) 2010 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + +#ifndef BOTAN_MP_ASM_H__ +#define BOTAN_MP_ASM_H__ + +#include + +#if (BOTAN_MP_WORD_BITS != 64) + #error The mp_amd64_msvc module requires that BOTAN_MP_WORD_BITS == 64 +#endif + +#pragma intrinsic(_umul128) + +namespace Botan { + +extern "C" { + +/* +* Word Multiply +*/ +inline word word_madd2(word a, word b, word* c) + { + word hi, lo; + lo = _umul128(a, b, &hi); + + lo += *c; + hi += (lo < *c); // carry? + + *c = hi; + return lo; + } + +/* +* Word Multiply/Add +*/ +inline word word_madd3(word a, word b, word c, word* d) + { + word hi, lo; + lo = _umul128(a, b, &hi); + + lo += c; + hi += (lo < c); // carry? + + lo += *d; + hi += (lo < *d); // carry? + + *d = hi; + return lo; + } + +} + +} + +#endif -- cgit v1.2.3 From eb7b919a345baccf68ab4f58257a5ff2da3b1496 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 11 Jun 2010 12:25:21 +0000 Subject: Have to add it as explicit dep in bigint --- src/math/bigint/info.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/math/bigint') diff --git a/src/math/bigint/info.txt b/src/math/bigint/info.txt index d5741943f..0511c2d8d 100644 --- a/src/math/bigint/info.txt +++ b/src/math/bigint/info.txt @@ -30,7 +30,7 @@ mp_shift.cpp alloc hex -mp_amd64|mp_asm64|mp_ia32|mp_ia32_msvc|mp_generic +mp_amd64|mp_amd64_msvc|mp_asm64|mp_ia32|mp_ia32_msvc|mp_generic monty_generic mulop_generic rng -- cgit v1.2.3 From 19278e2242fc5f9b32b294d27b1c20d69b1f7bbc Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 11 Jun 2010 12:32:42 +0000 Subject: Include generic mp_asmi.h for MSVC Don't use /EHc; it says "C" functions are nothrow, which is not true for bigint_sub2_rev. Include needed for mp_asm.h --- src/build-data/cc/msvc.txt | 2 +- src/math/bigint/mp_amd64_msvc/info.txt | 1 + src/math/bigint/mp_amd64_msvc/mp_asm.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/math/bigint') diff --git a/src/build-data/cc/msvc.txt b/src/build-data/cc/msvc.txt index 273f1c5c0..24d91b3f3 100644 --- a/src/build-data/cc/msvc.txt +++ b/src/build-data/cc/msvc.txt @@ -11,7 +11,7 @@ add_lib_option "" no_debug_flags "/O2" debug_flags "/Od /Zi /DDEBUG" check_opt_flags "/O2 /D_CONSOLE" -lang_flags "/EHsc /GR" +lang_flags "/EHs /GR" warning_flags "/W3 /wd4275" shared_flags "/DBOTAN_DLL=__declspec(dllexport)" diff --git a/src/math/bigint/mp_amd64_msvc/info.txt b/src/math/bigint/mp_amd64_msvc/info.txt index b6f322b83..56ae05927 100644 --- a/src/math/bigint/mp_amd64_msvc/info.txt +++ b/src/math/bigint/mp_amd64_msvc/info.txt @@ -4,6 +4,7 @@ mp_bits 64 mp_asm.h +mp_generic:mp_asmi.h diff --git a/src/math/bigint/mp_amd64_msvc/mp_asm.h b/src/math/bigint/mp_amd64_msvc/mp_asm.h index 09ca303df..3acbe11bb 100644 --- a/src/math/bigint/mp_amd64_msvc/mp_asm.h +++ b/src/math/bigint/mp_amd64_msvc/mp_asm.h @@ -9,6 +9,7 @@ #define BOTAN_MP_ASM_H__ #include +#include #if (BOTAN_MP_WORD_BITS != 64) #error The mp_amd64_msvc module requires that BOTAN_MP_WORD_BITS == 64 -- cgit v1.2.3 From 416695f7363c4e93eaeaea23427a1fed3ad73cab Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 15 Jun 2010 21:59:23 +0000 Subject: Fix a few hundred Doxygen warnings --- src/algo_factory/algo_factory.cpp | 36 +++++++++++------------ src/alloc/secmem.h | 4 +-- src/asn1/der_enc.h | 9 ++++-- src/block/block_cipher.h | 4 +-- src/cert/cvc/cvc_ado.h | 1 + src/cert/cvc/cvc_cert.h | 3 +- src/cert/cvc/cvc_gen_cert.h | 1 + src/cert/cvc/cvc_self.h | 9 ++++-- src/cert/cvc/signed_obj.h | 6 ++-- src/cert/x509/crl_ent.h | 3 +- src/cert/x509/x509_ca.h | 2 ++ src/cert/x509/x509_crl.h | 6 +++- src/constructs/passhash/passhash9.h | 2 +- src/filters/data_snk.h | 4 +-- src/filters/data_src.h | 19 +++++++------ src/filters/filters.h | 8 +++--- src/filters/key_filt.h | 2 +- src/filters/modes/cbc/cbc.h | 4 +-- src/filters/pbe.h | 9 +++--- src/filters/pipe.h | 8 ++++-- src/libstate/init.h | 2 +- src/libstate/libstate.h | 4 +-- src/libstate/lookup.cpp | 20 ++++++------- src/libstate/lookup.h | 57 +++++++++++++++++++------------------ src/mac/mac.cpp | 2 +- src/mac/mac.h | 4 +-- src/math/bigint/bigint.h | 15 +++++++--- src/pbe/get_pbe.h | 9 +++--- src/pubkey/dh/dh.h | 2 +- src/pubkey/ecdh/ecdh.h | 3 +- src/pubkey/ecdsa/ecdsa.h | 6 ++-- src/pubkey/gost_3410/gost_3410.h | 3 +- src/pubkey/pk_keys.h | 2 +- src/pubkey/pubkey.h | 2 +- src/pubkey/x509_key.h | 16 +++++------ src/s2k/pbkdf1/pbkdf1.h | 2 +- src/ssl/rec_read.cpp | 8 +++--- src/stream/stream_cipher.h | 2 +- src/stream/turing/turing.h | 2 +- src/sym_algo/sym_algo.h | 2 +- src/utils/buf_comp/buf_comp.h | 2 +- 41 files changed, 173 insertions(+), 132 deletions(-) (limited to 'src/math/bigint') diff --git a/src/algo_factory/algo_factory.cpp b/src/algo_factory/algo_factory.cpp index e8a2a0913..13e81e7f5 100644 --- a/src/algo_factory/algo_factory.cpp +++ b/src/algo_factory/algo_factory.cpp @@ -22,7 +22,7 @@ namespace Botan { namespace { -/** +/* * Template functions for the factory prototype/search algorithm */ template @@ -84,7 +84,7 @@ const T* factory_prototype(const std::string& algo_spec, } -/** +/* * Setup caches */ Algorithm_Factory::Algorithm_Factory(Mutex_Factory& mf) @@ -95,7 +95,7 @@ Algorithm_Factory::Algorithm_Factory(Mutex_Factory& mf) mac_cache = new Algorithm_Cache(mf.make()); } -/** +/* * Delete all engines */ Algorithm_Factory::~Algorithm_Factory() @@ -113,7 +113,7 @@ void Algorithm_Factory::add_engine(Engine* engine) engines.push_back(engine); } -/** +/* * Set the preferred provider for an algorithm */ void Algorithm_Factory::set_preferred_provider(const std::string& algo_spec, @@ -129,7 +129,7 @@ void Algorithm_Factory::set_preferred_provider(const std::string& algo_spec, mac_cache->set_preferred_provider(algo_spec, provider); } -/** +/* * Get an engine out of the list */ Engine* Algorithm_Factory::get_engine_n(u32bit n) const @@ -139,7 +139,7 @@ Engine* Algorithm_Factory::get_engine_n(u32bit n) const return engines[n]; } -/** +/* * Return the possible providers of a request * Note: assumes you don't have different types by the same name */ @@ -163,7 +163,7 @@ Algorithm_Factory::providers_of(const std::string& algo_spec) return std::vector(); } -/** +/* * Return the prototypical block cipher corresponding to this request */ const BlockCipher* @@ -174,7 +174,7 @@ Algorithm_Factory::prototype_block_cipher(const std::string& algo_spec, *this, block_cipher_cache); } -/** +/* * Return the prototypical stream cipher corresponding to this request */ const StreamCipher* @@ -185,7 +185,7 @@ Algorithm_Factory::prototype_stream_cipher(const std::string& algo_spec, *this, stream_cipher_cache); } -/** +/* * Return the prototypical object corresponding to this request (if found) */ const HashFunction* @@ -196,7 +196,7 @@ Algorithm_Factory::prototype_hash_function(const std::string& algo_spec, *this, hash_cache); } -/** +/* * Return the prototypical object corresponding to this request */ const MessageAuthenticationCode* @@ -208,7 +208,7 @@ Algorithm_Factory::prototype_mac(const std::string& algo_spec, *this, mac_cache); } -/** +/* * Return a new block cipher corresponding to this request */ BlockCipher* @@ -220,7 +220,7 @@ Algorithm_Factory::make_block_cipher(const std::string& algo_spec, throw Algorithm_Not_Found(algo_spec); } -/** +/* * Return a new stream cipher corresponding to this request */ StreamCipher* @@ -232,7 +232,7 @@ Algorithm_Factory::make_stream_cipher(const std::string& algo_spec, throw Algorithm_Not_Found(algo_spec); } -/** +/* * Return a new object corresponding to this request */ HashFunction* @@ -244,7 +244,7 @@ Algorithm_Factory::make_hash_function(const std::string& algo_spec, throw Algorithm_Not_Found(algo_spec); } -/** +/* * Return a new object corresponding to this request */ MessageAuthenticationCode* @@ -256,7 +256,7 @@ Algorithm_Factory::make_mac(const std::string& algo_spec, throw Algorithm_Not_Found(algo_spec); } -/** +/* * Add a new block cipher */ void Algorithm_Factory::add_block_cipher(BlockCipher* block_cipher, @@ -265,7 +265,7 @@ void Algorithm_Factory::add_block_cipher(BlockCipher* block_cipher, block_cipher_cache->add(block_cipher, block_cipher->name(), provider); } -/** +/* * Add a new stream cipher */ void Algorithm_Factory::add_stream_cipher(StreamCipher* stream_cipher, @@ -274,7 +274,7 @@ void Algorithm_Factory::add_stream_cipher(StreamCipher* stream_cipher, stream_cipher_cache->add(stream_cipher, stream_cipher->name(), provider); } -/** +/* * Add a new hash */ void Algorithm_Factory::add_hash_function(HashFunction* hash, @@ -283,7 +283,7 @@ void Algorithm_Factory::add_hash_function(HashFunction* hash, hash_cache->add(hash, hash->name(), provider); } -/** +/* * Add a new mac */ void Algorithm_Factory::add_mac(MessageAuthenticationCode* mac, diff --git a/src/alloc/secmem.h b/src/alloc/secmem.h index b3b3fa973..d1a3ba7bd 100644 --- a/src/alloc/secmem.h +++ b/src/alloc/secmem.h @@ -97,7 +97,7 @@ class MemoryRegion /** * Copy the contents of another buffer into this buffer. * The former contents of *this are discarded. - * @param in the buffer to copy the contents from. + * @param other the buffer to copy the contents from. * @return a reference to *this */ MemoryRegion& operator=(const MemoryRegion& other) @@ -156,7 +156,7 @@ class MemoryRegion /** * Append data to the end of this buffer. - * @param data the buffer containing the data to append + * @param other the buffer containing the data to append */ void append(const MemoryRegion& other) { append(other.begin(), other.size()); } diff --git a/src/asn1/der_enc.h b/src/asn1/der_enc.h index 23b5297e5..3037ee707 100644 --- a/src/asn1/der_enc.h +++ b/src/asn1/der_enc.h @@ -13,6 +13,9 @@ namespace Botan { +class BigInt; +class ASN1_Object; + /* * General DER Encoding Object */ @@ -33,13 +36,13 @@ class BOTAN_DLL DER_Encoder DER_Encoder& encode_null(); DER_Encoder& encode(bool); DER_Encoder& encode(u32bit); - DER_Encoder& encode(const class BigInt&); + DER_Encoder& encode(const BigInt&); DER_Encoder& encode(const MemoryRegion&, ASN1_Tag); DER_Encoder& encode(const byte[], u32bit, ASN1_Tag); DER_Encoder& encode(bool, ASN1_Tag, ASN1_Tag = CONTEXT_SPECIFIC); DER_Encoder& encode(u32bit, ASN1_Tag, ASN1_Tag = CONTEXT_SPECIFIC); - DER_Encoder& encode(const class BigInt&, ASN1_Tag, + DER_Encoder& encode(const BigInt&, ASN1_Tag, ASN1_Tag = CONTEXT_SPECIFIC); DER_Encoder& encode(const MemoryRegion&, ASN1_Tag, ASN1_Tag, ASN1_Tag = CONTEXT_SPECIFIC); @@ -62,7 +65,7 @@ class BOTAN_DLL DER_Encoder return (*this); } - DER_Encoder& encode(const class ASN1_Object&); + DER_Encoder& encode(const ASN1_Object&); DER_Encoder& encode_if(bool, DER_Encoder&); DER_Encoder& add_object(ASN1_Tag, ASN1_Tag, const byte[], u32bit); diff --git a/src/block/block_cipher.h b/src/block/block_cipher.h index ff0a10103..11d5e20f9 100644 --- a/src/block/block_cipher.h +++ b/src/block/block_cipher.h @@ -58,7 +58,7 @@ class BOTAN_DLL BlockCipher : public SymmetricAlgorithm /** * Encrypt a block. - * @param in The plaintext block to be encrypted as a byte array. + * @param block the plaintext block to be encrypted * Must be of length BLOCK_SIZE. Will hold the result when the function * has finished. */ @@ -66,7 +66,7 @@ class BOTAN_DLL BlockCipher : public SymmetricAlgorithm /** * Decrypt a block. - * @param in The ciphertext block to be decrypted as a byte array. + * @param block the ciphertext block to be decrypted * Must be of length BLOCK_SIZE. Will hold the result when the function * has finished. */ diff --git a/src/cert/cvc/cvc_ado.h b/src/cert/cvc/cvc_ado.h index 230ee8b8d..65a39fd91 100644 --- a/src/cert/cvc/cvc_ado.h +++ b/src/cert/cvc/cvc_ado.h @@ -41,6 +41,7 @@ class BOTAN_DLL EAC1_1_ADO : public EAC1_1_obj * Create a signed CVC ADO request from to be signed (TBS) data * @param signer the signer used to sign the CVC ADO request * @param tbs_bits the TBS data to sign + * @param rng a random number generator */ static MemoryVector make_signed( PK_Signer& signer, diff --git a/src/cert/cvc/cvc_cert.h b/src/cert/cvc/cvc_cert.h index 12bc41a9c..69d0d824a 100644 --- a/src/cert/cvc/cvc_cert.h +++ b/src/cert/cvc/cvc_cert.h @@ -92,7 +92,8 @@ inline bool operator!=(EAC1_1_CVC const& lhs, EAC1_1_CVC const& rhs) * @param holder_auth_templ the holder authorization value byte to * appear in the CHAT of the certificate * @param ced the CED to appear in the certificate -* @param ced the CEX to appear in the certificate +* @param cex the CEX to appear in the certificate +* @param rng a random number generator */ EAC1_1_CVC BOTAN_DLL make_cvc_cert(PK_Signer& signer, const MemoryRegion& public_key, diff --git a/src/cert/cvc/cvc_gen_cert.h b/src/cert/cvc/cvc_gen_cert.h index f37684afd..61861df41 100644 --- a/src/cert/cvc/cvc_gen_cert.h +++ b/src/cert/cvc/cvc_gen_cert.h @@ -70,6 +70,7 @@ class EAC1_1_gen_CVC : public EAC1_1_obj // CRTP continuation from EAC1 * Create a signed generalized CVC object. * @param signer the signer used to sign this object * @param tbs_bits the body the generalized CVC object to be signed + * @param rng a random number generator * @result the DER encoded signed generalized CVC object */ static MemoryVector make_signed( diff --git a/src/cert/cvc/cvc_self.h b/src/cert/cvc/cvc_self.h index fb24ecd3a..f7bf6d5d8 100644 --- a/src/cert/cvc/cvc_self.h +++ b/src/cert/cvc/cvc_self.h @@ -97,7 +97,8 @@ namespace DE_EAC { * shall be entitled to read the biometrical iris image * @param fingerpr indicates whether the entity associated with the certificate * shall be entitled to read the biometrical fingerprint image -* @param rng the rng to use +* @param cvca_validity_months length of time in months this will be valid +* @param rng a random number generator * @result the CVCA certificate created */ EAC1_1_CVC BOTAN_DLL create_cvca(Private_Key const& priv_key, @@ -146,8 +147,10 @@ EAC1_1_Req BOTAN_DLL create_cvc_req(Private_Key const& priv_key, * @param seqnr the sequence number of the certificate to be created * @param seqnr_len the number of digits the sequence number will be * encoded in -* @param domestic indicates whether to sign a domestic or a foreign certificate: -* set to true for domestic +* @param domestic indicates whether to sign a domestic or a foreign +* certificate: set to true for domestic +* @param dvca_validity_months validity period in months +* @param ca_is_validity_months validity period in months * @param rng a random number generator * @result the new certificate * diff --git a/src/cert/cvc/signed_obj.h b/src/cert/cvc/signed_obj.h index 0e7dd6bdb..c0ae2cfc5 100644 --- a/src/cert/cvc/signed_obj.h +++ b/src/cert/cvc/signed_obj.h @@ -50,6 +50,7 @@ class BOTAN_DLL EAC_Signed_Object /** * Check the signature of this object. * @param key the public key associated with this signed object + * @param sig the signature we are checking * @return true if the signature was created by the private key * associated with this public key */ @@ -59,9 +60,10 @@ class BOTAN_DLL EAC_Signed_Object /** * Write this object DER encoded into a specified pipe. * @param pipe the pipe to write the encoded object to - * @param enc the encoding type to use + * @param encoding the encoding type to use */ - virtual void encode(Pipe&, X509_Encoding = PEM) const = 0; + virtual void encode(Pipe& pipe, + X509_Encoding encoding = PEM) const = 0; /** * BER encode this object. diff --git a/src/cert/x509/crl_ent.h b/src/cert/x509/crl_ent.h index 050356c84..2b06189e4 100644 --- a/src/cert/x509/crl_ent.h +++ b/src/cert/x509/crl_ent.h @@ -49,7 +49,8 @@ class BOTAN_DLL CRL_Entry : public ASN1_Object * @param cert the certificate to revoke * @param reason the reason code to set in the entry */ - CRL_Entry(const X509_Certificate&, CRL_Code = UNSPECIFIED); + CRL_Entry(const X509_Certificate& cert, + CRL_Code reason = UNSPECIFIED); private: bool throw_on_unknown_critical; diff --git a/src/cert/x509/x509_ca.h b/src/cert/x509/x509_ca.h index 6eb4bbbef..6f36444ee 100644 --- a/src/cert/x509/x509_ca.h +++ b/src/cert/x509/x509_ca.h @@ -71,6 +71,7 @@ class BOTAN_DLL X509_CA * @param signer a signing object * @param rng a random number generator * @param sig_algo the signature algorithm identifier + * @param pub_key the serialized public key * @param not_before the start time of the certificate * @param not_after the end time of the certificate * @param issuer_dn the DN of the issuer @@ -92,6 +93,7 @@ class BOTAN_DLL X509_CA * Create a new CA object. * @param ca_certificate the certificate of the CA * @param key the private key of the CA + * @param hash_fn name of a hash function to use for signing */ X509_CA(const X509_Certificate& ca_certificate, const Private_Key& key, diff --git a/src/cert/x509/x509_crl.h b/src/cert/x509/x509_crl.h index a7903e7e6..74427fbef 100644 --- a/src/cert/x509/x509_crl.h +++ b/src/cert/x509/x509_crl.h @@ -68,12 +68,16 @@ class BOTAN_DLL X509_CRL : public X509_Object /** * Construct a CRL from a data source. * @param source the data source providing the DER or PEM encoded CRL. + * @param throw_on_unknown_critical should we throw an exception + * if an unknown CRL extension marked as critical is encountered. */ - X509_CRL(DataSource&, bool throw_on_unknown_critical = false); + X509_CRL(DataSource& source, bool throw_on_unknown_critical = false); /** * Construct a CRL from a file containing the DER or PEM encoded CRL. * @param filename the name of the CRL file + * @param throw_on_unknown_critical should we throw an exception + * if an unknown CRL extension marked as critical is encountered. */ X509_CRL(const std::string& filename, bool throw_on_unknown_critical = false); diff --git a/src/constructs/passhash/passhash9.h b/src/constructs/passhash/passhash9.h index 6020dce42..8900d55d3 100644 --- a/src/constructs/passhash/passhash9.h +++ b/src/constructs/passhash/passhash9.h @@ -16,7 +16,7 @@ namespace Botan { * Create a password hash using PBKDF2 * @param password the password * @param rng a random number generator -* @Param work_factor how much work to do to slow down guessing attacks +* @param work_factor how much work to do to slow down guessing attacks */ std::string BOTAN_DLL generate_passhash9(const std::string& password, RandomNumberGenerator& rng, diff --git a/src/filters/data_snk.h b/src/filters/data_snk.h index 61ddf6e0d..db0bfc858 100644 --- a/src/filters/data_snk.h +++ b/src/filters/data_snk.h @@ -45,11 +45,11 @@ class BOTAN_DLL DataSink_Stream : public DataSink /** * Construct a DataSink_Stream from a stream. - * @param file the name of the file to open a stream to + * @param pathname the name of the file to open a stream to * @param use_binary indicates whether to treat the file * as a binary file or not */ - DataSink_Stream(const std::string& filename, + DataSink_Stream(const std::string& pathname, bool use_binary = false); ~DataSink_Stream(); diff --git a/src/filters/data_src.h b/src/filters/data_src.h index e16217e0f..c69aa84b0 100644 --- a/src/filters/data_src.h +++ b/src/filters/data_src.h @@ -21,8 +21,9 @@ class BOTAN_DLL DataSource { public: /** - * Read from the source. Moves the internal offset so that - * every call to read will return a new portion of the source. + * Read from the source. Moves the internal offset so that every + * call to read will return a new portion of the source. + * * @param out the byte array to write the result to * @param length the length of the byte array out * @return the length in bytes that was actually read and put @@ -31,11 +32,13 @@ class BOTAN_DLL DataSource virtual u32bit read(byte out[], u32bit length) = 0; /** - * Read from the source but do not modify the internal offset. Consecutive - * calls to peek() will return portions of the source starting at the same - * position. + * Read from the source but do not modify the internal + * offset. Consecutive calls to peek() will return portions of + * the source starting at the same position. + * * @param out the byte array to write the output to * @param length the length of the byte array out + * @param peek_offset the offset into the stream to read at * @return the length in bytes that was actually read and put * into out */ @@ -49,13 +52,13 @@ class BOTAN_DLL DataSource virtual bool end_of_data() const = 0; /** * return the id of this data source - * @return the std::string representing the id of this data source + * @return std::string representing the id of this data source */ virtual std::string id() const { return ""; } /** * Read one byte. - * @param the byte to read to + * @param out the byte to read to * @return the length in bytes that was actually read and put * into out */ @@ -63,7 +66,7 @@ class BOTAN_DLL DataSource /** * Peek at one byte. - * @param the byte to read to + * @param out an output byte * @return the length in bytes that was actually read and put * into out */ diff --git a/src/filters/filters.h b/src/filters/filters.h index 208332a56..6c78f77aa 100644 --- a/src/filters/filters.h +++ b/src/filters/filters.h @@ -160,8 +160,8 @@ class BOTAN_DLL MAC_Filter : public Keyed_Filter /** * Construct a MAC filter. The MAC key will be left empty. - * @param mac the MAC to use - * @param len the output length of this filter. Leave the default + * @param mac_obj the MAC to use + * @param out_len the output length of this filter. Leave the default * value 0 if you want to use the full output of the * MAC. Otherwise, specify a smaller value here so that the * output of the MAC will be cut off. @@ -174,9 +174,9 @@ class BOTAN_DLL MAC_Filter : public Keyed_Filter /** * Construct a MAC filter. - * @param mac the MAC to use + * @param mac_obj the MAC to use * @param key the MAC key to use - * @param len the output length of this filter. Leave the default + * @param out_len the output length of this filter. Leave the default * value 0 if you want to use the full output of the * MAC. Otherwise, specify a smaller value here so that the * output of the MAC will be cut off. diff --git a/src/filters/key_filt.h b/src/filters/key_filt.h index 36af91f88..6f3d23fcd 100644 --- a/src/filters/key_filt.h +++ b/src/filters/key_filt.h @@ -30,7 +30,7 @@ class BOTAN_DLL Keyed_Filter : public Filter * Set the initialization vector of this filter. * @param iv the initialization vector to set */ - virtual void set_iv(const InitializationVector&) {} + virtual void set_iv(const InitializationVector& iv) {} /** * Check whether a key length is valid for this filter. diff --git a/src/filters/modes/cbc/cbc.h b/src/filters/modes/cbc/cbc.h index 6d9092041..e51a94eac 100644 --- a/src/filters/modes/cbc/cbc.h +++ b/src/filters/modes/cbc/cbc.h @@ -24,7 +24,7 @@ class BOTAN_DLL CBC_Encryption : public Keyed_Filter, public: std::string name() const; - void set_iv(const InitializationVector&); + void set_iv(const InitializationVector& iv); void set_key(const SymmetricKey& key) { cipher->set_key(key); } @@ -61,7 +61,7 @@ class BOTAN_DLL CBC_Decryption : public Keyed_Filter, public: std::string name() const; - void set_iv(const InitializationVector&); + void set_iv(const InitializationVector& iv); void set_key(const SymmetricKey& key) { cipher->set_key(key); } diff --git a/src/filters/pbe.h b/src/filters/pbe.h index f06d593d0..9add98872 100644 --- a/src/filters/pbe.h +++ b/src/filters/pbe.h @@ -25,16 +25,17 @@ class BOTAN_DLL PBE : public Filter * Set this filter's key. * @param pw the password to be used for the encryption */ - virtual void set_key(const std::string&) = 0; + virtual void set_key(const std::string& pw) = 0; /** * Create a new random salt value and set the default iterations value. + * @param rng a random number generator */ virtual void new_params(RandomNumberGenerator& rng) = 0; /** * DER encode the params (the number of iterations and the salt value) - * @return the encoded params + * @return encoded params */ virtual MemoryVector encode_params() const = 0; @@ -42,11 +43,11 @@ class BOTAN_DLL PBE : public Filter * Decode params and use them inside this Filter. * @param src a data source to read the encoded params from */ - virtual void decode_params(DataSource&) = 0; + virtual void decode_params(DataSource& src) = 0; /** * Get this PBE's OID. - * @return the OID + * @return object identifier */ virtual OID get_oid() const = 0; }; diff --git a/src/filters/pipe.h b/src/filters/pipe.h index 9af21a13f..12d7716f1 100644 --- a/src/filters/pipe.h +++ b/src/filters/pipe.h @@ -107,6 +107,7 @@ class BOTAN_DLL Pipe : public DataSource * Read the default message from the pipe. Moves the internal * offset so that every call to read will return a new portion of * the message. + * * @param output the byte array to write the read bytes to * @param length the length of the byte array output * @return the number of bytes actually read into output @@ -125,9 +126,12 @@ class BOTAN_DLL Pipe : public DataSource u32bit read(byte output[], u32bit length, message_id msg); /** - * Read a single byte from the pipe. Moves the internal offset so that - * every call to read will return a new portion of the message. + * Read a single byte from the pipe. Moves the internal offset so + * that every call to read will return a new portion of the + * message. + * * @param output the byte to write the result to + * @param msg the message to read from * @return the number of bytes actually read into output */ u32bit read(byte& output, message_id msg = DEFAULT_MESSAGE); diff --git a/src/libstate/init.h b/src/libstate/init.h index 8b0ce80de..4c4a09d1f 100644 --- a/src/libstate/init.h +++ b/src/libstate/init.h @@ -28,7 +28,7 @@ class BOTAN_DLL LibraryInitializer /** * 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 4674eca88..8f76ed8b2 100644 --- a/src/libstate/libstate.h +++ b/src/libstate/libstate.h @@ -69,8 +69,7 @@ class BOTAN_DLL Library_State const std::string& key) const; /** - * 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, @@ -83,6 +82,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. 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..64de67489 100644 --- a/src/libstate/lookup.h +++ b/src/libstate/lookup.h @@ -105,7 +105,7 @@ 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 +* @param algo_spec the name of the desired string to key (S2K) algorithm * @return a pointer to the string to key algorithm object */ BOTAN_DLL S2K* get_s2k(const std::string& algo_spec); @@ -118,7 +118,7 @@ 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 +* @param algo_spec the name of the EME to create * @return a pointer to the desired EME object */ BOTAN_DLL EME* get_eme(const std::string& algo_spec); @@ -126,14 +126,14 @@ 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 +* @param algo_spec the name of the EME to create * @return a 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 +* @param algo_spec the name of the KDF to create * @return a pointer to the desired KDF object */ BOTAN_DLL KDF* get_kdf(const std::string& algo_spec); @@ -152,10 +152,11 @@ BOTAN_DLL KDF* get_kdf(const std::string& algo_spec); * or decrypting filter * @return a 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 @@ -165,30 +166,32 @@ BOTAN_DLL Keyed_Filter* get_cipher(const std::string& name, * or decrypting filter * @return a 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 */ -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 +* @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 +202,7 @@ 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 +* @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) @@ -236,15 +239,15 @@ 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 +* @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 +* @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); @@ -252,30 +255,30 @@ 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. * @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 +* @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 +* @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 +* @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/mac/mac.cpp b/src/mac/mac.cpp index a2c884ab6..cb89e872a 100644 --- a/src/mac/mac.cpp +++ b/src/mac/mac.cpp @@ -9,7 +9,7 @@ namespace Botan { -/** +/* * Default (deterministic) MAC verification operation */ bool MessageAuthenticationCode::verify_mac(const byte mac[], u32bit length) diff --git a/src/mac/mac.h b/src/mac/mac.h index 617e86358..b93ae473d 100644 --- a/src/mac/mac.h +++ b/src/mac/mac.h @@ -24,10 +24,10 @@ class BOTAN_DLL MessageAuthenticationCode : public BufferedComputation, /** * Verify a MAC. * @param in the MAC to verify as a byte array - * @param length the length of the byte array + * @param length the length of param in * @return true if the MAC is valid, false otherwise */ - virtual bool verify_mac(const byte[], u32bit); + virtual bool verify_mac(const byte in[], u32bit length); /** * Get a new object representing the same algorithm as *this diff --git a/src/math/bigint/bigint.h b/src/math/bigint/bigint.h index 0bb51fd20..cd1aebf00 100644 --- a/src/math/bigint/bigint.h +++ b/src/math/bigint/bigint.h @@ -361,14 +361,21 @@ class BOTAN_DLL BigInt */ void binary_decode(const MemoryRegion& buf); - u32bit encoded_size(Base = Binary) const; + /** + * @param base the base to measure the size for + * @return size of this integer in base base + */ + u32bit encoded_size(Base base = Binary) const; /** - @param rng a random number generator - @result a random integer between min and max + * @param rng a random number generator + * @param min the minimum value + * @param max the maximum value + * @return a random integer between min and max */ static BigInt random_integer(RandomNumberGenerator& rng, - const BigInt& min, const BigInt& max); + const BigInt& min, + const BigInt& max); /** * Encode the integer value from a BigInt to a SecureVector of bytes diff --git a/src/pbe/get_pbe.h b/src/pbe/get_pbe.h index 04eda6696..73c53497c 100644 --- a/src/pbe/get_pbe.h +++ b/src/pbe/get_pbe.h @@ -16,17 +16,18 @@ namespace Botan { /** * Factory function for PBEs. * @param algo_spec the name of the PBE algorithm to retrieve -* @return a pointer to a PBE with randomly created parameters +* @return pointer to a PBE with randomly created parameters */ -BOTAN_DLL PBE* get_pbe(const std::string&); +BOTAN_DLL PBE* get_pbe(const std::string& algo_spec); /** * Factory function for PBEs. * @param pbe_oid the oid of the desired PBE * @param params a DataSource providing the DER encoded parameters to use -* @return a pointer to the PBE with the specified parameters +* @return pointer to the PBE with the specified parameters */ -BOTAN_DLL PBE* get_pbe(const OID&, DataSource&); +BOTAN_DLL PBE* get_pbe(const OID& pbe_oid, + DataSource& params); } diff --git a/src/pubkey/dh/dh.h b/src/pubkey/dh/dh.h index 738b3f9c4..88b57922d 100644 --- a/src/pubkey/dh/dh.h +++ b/src/pubkey/dh/dh.h @@ -56,7 +56,7 @@ class BOTAN_DLL DH_PrivateKey : public DH_PublicKey, * Load a DH private key * @param alg_id the algorithm id * @param key_bits the subject public key - * @rng a random number generator + * @param rng a random number generator */ DH_PrivateKey(const AlgorithmIdentifier& alg_id, const MemoryRegion& key_bits, diff --git a/src/pubkey/ecdh/ecdh.h b/src/pubkey/ecdh/ecdh.h index 19621f2ca..ea1205a48 100644 --- a/src/pubkey/ecdh/ecdh.h +++ b/src/pubkey/ecdh/ecdh.h @@ -75,7 +75,8 @@ class BOTAN_DLL ECDH_PrivateKey : public ECDH_PublicKey, /** * Generate a new private key - * @param the domain parameters to used for this key + * @param rng a random number generator + * @param domain parameters to used for this key */ ECDH_PrivateKey(RandomNumberGenerator& rng, const EC_Domain_Params& domain) : diff --git a/src/pubkey/ecdsa/ecdsa.h b/src/pubkey/ecdsa/ecdsa.h index 62bd007f9..5e10c837d 100644 --- a/src/pubkey/ecdsa/ecdsa.h +++ b/src/pubkey/ecdsa/ecdsa.h @@ -72,7 +72,8 @@ class BOTAN_DLL ECDSA_PrivateKey : public ECDSA_PublicKey, /** * Generate a new private key - * @param the domain parameters to used for this key + * @param rng a random number generator + * @param domain parameters to used for this key */ ECDSA_PrivateKey(RandomNumberGenerator& rng, const EC_Domain_Params& domain) : @@ -83,7 +84,8 @@ class BOTAN_DLL ECDSA_PrivateKey : public ECDSA_PublicKey, * @param domain parameters * @param x the private key */ - ECDSA_PrivateKey(const EC_Domain_Params& domain, const BigInt& x) : + ECDSA_PrivateKey(const EC_Domain_Params& domain, + const BigInt& x) : EC_PrivateKey(domain, x) {} bool check_key(RandomNumberGenerator& rng, bool) const; diff --git a/src/pubkey/gost_3410/gost_3410.h b/src/pubkey/gost_3410/gost_3410.h index 36fa2912d..5148b0204 100644 --- a/src/pubkey/gost_3410/gost_3410.h +++ b/src/pubkey/gost_3410/gost_3410.h @@ -78,7 +78,8 @@ class BOTAN_DLL GOST_3410_PrivateKey : public GOST_3410_PublicKey, /** * Generate a new private key - * @param the domain parameters to used for this key + * @param rng a random number generator + * @param domain parameters to used for this key */ GOST_3410_PrivateKey(RandomNumberGenerator& rng, const EC_Domain_Params& domain) : diff --git a/src/pubkey/pk_keys.h b/src/pubkey/pk_keys.h index da73db0ee..781c8e70f 100644 --- a/src/pubkey/pk_keys.h +++ b/src/pubkey/pk_keys.h @@ -40,7 +40,7 @@ class BOTAN_DLL Public_Key * of the test * @return true if the test is passed */ - virtual bool check_key(RandomNumberGenerator&, bool) const + virtual bool check_key(RandomNumberGenerator& rng, bool strong) const { return true; } /** diff --git a/src/pubkey/pubkey.h b/src/pubkey/pubkey.h index d94b3e2e4..f6a120654 100644 --- a/src/pubkey/pubkey.h +++ b/src/pubkey/pubkey.h @@ -145,7 +145,7 @@ class BOTAN_DLL PK_Signer /** * Add a message part (single byte). - * @param the byte to add + * @param in the byte to add */ void update(byte in) { update(&in, 1); } diff --git a/src/pubkey/x509_key.h b/src/pubkey/x509_key.h index d9e9f2d7c..4ac6eab3d 100644 --- a/src/pubkey/x509_key.h +++ b/src/pubkey/x509_key.h @@ -23,42 +23,42 @@ namespace X509 { /** * BER encode a key * @param key the public key to encode -* @return the BER encoding of this key +* @return BER encoding of this key */ BOTAN_DLL MemoryVector BER_encode(const Public_Key& key); /** * PEM encode a public key into a string. * @param key the key to encode -* @return the PEM encoded key +* @return PEM encoded key */ BOTAN_DLL std::string PEM_encode(const Public_Key& key); /** * Create a public key from a data source. * @param source the source providing the DER or PEM encoded key -* @return the new public key object +* @return new public key object */ BOTAN_DLL Public_Key* load_key(DataSource& source); /** * Create a public key from a file -* @param file pathname to the file to load -* @return the new public key object +* @param filename pathname to the file to load +* @return new public key object */ BOTAN_DLL Public_Key* load_key(const std::string& filename); /** * Create a public key from a memory region. * @param enc the memory region containing the DER or PEM encoded key -* @return the new public key object +* @return new public key object */ BOTAN_DLL Public_Key* load_key(const MemoryRegion& enc); /** * Copy a key. * @param key the public key to copy -* @return the new public key object +* @return new public key object */ BOTAN_DLL Public_Key* copy_key(const Public_Key& key); @@ -68,7 +68,7 @@ BOTAN_DLL Public_Key* copy_key(const Public_Key& key); * constraints to be placed in the return value is derived * @param limits additional limits that will be incorporated into the * return value -* @return the combination of key type specific constraints and +* @return combination of key type specific constraints and * additional limits */ BOTAN_DLL Key_Constraints find_constraints(const Public_Key& pub_key, diff --git a/src/s2k/pbkdf1/pbkdf1.h b/src/s2k/pbkdf1/pbkdf1.h index 053a2dbe1..cf439efd8 100644 --- a/src/s2k/pbkdf1/pbkdf1.h +++ b/src/s2k/pbkdf1/pbkdf1.h @@ -29,7 +29,7 @@ class BOTAN_DLL PKCS5_PBKDF1 : public S2K /** * Create a PKCS #5 instance using the specified hash function. - * @param hash a pointer to a hash function object to use + * @param hash_in pointer to a hash function object to use */ PKCS5_PBKDF1(HashFunction* hash_in) : hash(hash_in) {} diff --git a/src/ssl/rec_read.cpp b/src/ssl/rec_read.cpp index 8b655f5bc..3c008641d 100644 --- a/src/ssl/rec_read.cpp +++ b/src/ssl/rec_read.cpp @@ -12,7 +12,7 @@ namespace Botan { -/** +/* * Reset the state */ void Record_Reader::reset() @@ -26,7 +26,7 @@ void Record_Reader::reset() seq_no = 0; } -/** +/* * Set the version to use */ void Record_Reader::set_version(Version_Code version) @@ -38,7 +38,7 @@ void Record_Reader::set_version(Version_Code version) minor = (version & 0xFF); } -/** +/* * Set the keys for reading */ void Record_Reader::set_keys(const CipherSuite& suite, const SessionKeys& keys, @@ -106,7 +106,7 @@ void Record_Reader::add_input(const byte input[], u32bit input_size) input_queue.write(input, input_size); } -/** +/* * Retrieve the next record */ u32bit Record_Reader::get_record(byte& msg_type, diff --git a/src/stream/stream_cipher.h b/src/stream/stream_cipher.h index 11b741a1a..c5d115a5d 100644 --- a/src/stream/stream_cipher.h +++ b/src/stream/stream_cipher.h @@ -39,7 +39,7 @@ class BOTAN_DLL StreamCipher : public SymmetricAlgorithm * @param iv the initialization vector * @param iv_len the length of the IV in bytes */ - virtual void set_iv(const byte[], u32bit iv_len) + virtual void set_iv(const byte iv[], u32bit iv_len) { if(iv_len) throw Invalid_Argument("The stream cipher " + name() + diff --git a/src/stream/turing/turing.h b/src/stream/turing/turing.h index 19d151fca..f9b4460ef 100644 --- a/src/stream/turing/turing.h +++ b/src/stream/turing/turing.h @@ -19,7 +19,7 @@ class BOTAN_DLL Turing : public StreamCipher { public: void cipher(const byte in[], byte out[], u32bit length); - void set_iv(const byte[], u32bit); + void set_iv(const byte iv[], u32bit iv_length); bool valid_iv_length(u32bit iv_len) const { return (iv_len % 4 == 0 && iv_len <= 16); } diff --git a/src/sym_algo/sym_algo.h b/src/sym_algo/sym_algo.h index 20bbd649f..f00c8cedf 100644 --- a/src/sym_algo/sym_algo.h +++ b/src/sym_algo/sym_algo.h @@ -52,7 +52,7 @@ class BOTAN_DLL SymmetricAlgorithm /** * Set the symmetric key of this object. * @param key the to be set as a byte array. - * @param the length of the byte array. + * @param length in bytes of key param */ void set_key(const byte key[], u32bit length) { diff --git a/src/utils/buf_comp/buf_comp.h b/src/utils/buf_comp/buf_comp.h index 6c1acb520..bbaa72919 100644 --- a/src/utils/buf_comp/buf_comp.h +++ b/src/utils/buf_comp/buf_comp.h @@ -29,7 +29,7 @@ class BOTAN_DLL BufferedComputation /** * Add new input to process. * @param in the input to process as a byte array - * @param the length of the byte array + * @param length of param in in bytes */ void update(const byte in[], u32bit length) { add_data(in, length); } -- cgit v1.2.3 From bfb119cc85776d38ee728d320605abcb3e52448e Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 16 Jun 2010 04:03:10 +0000 Subject: Replace "@return a blah" and "@return the blah" with just "@return blah" --- src/algo_factory/algo_cache.h | 2 +- src/alloc/secmem.h | 20 ++++++++++---------- src/asn1/asn1_oid.h | 6 +++--- src/block/block_cipher.h | 4 ++-- src/block/gost_28147/gost_28147.h | 2 +- src/cert/cvc/eac_asn_obj.h | 14 +++++++------- src/cert/cvc/signed_obj.h | 8 ++++---- src/cert/x509/crl_ent.h | 6 +++--- src/cert/x509/pkcs10.h | 16 ++++++++-------- src/cert/x509/x509_ca.h | 6 +++--- src/cert/x509/x509_crl.h | 10 +++++----- src/cert/x509/x509_obj.h | 2 +- src/cert/x509/x509cert.h | 30 +++++++++++++++--------------- src/cert/x509/x509self.h | 4 ++-- src/filters/data_src.h | 10 +++++----- src/filters/pipe.h | 20 ++++++++++---------- src/hash/hash.h | 2 +- src/libstate/libstate.h | 8 ++++---- src/libstate/look_pk.h | 10 +++++----- src/libstate/lookup.h | 22 +++++++++++----------- src/libstate/oid_lookup/oids.h | 4 ++-- src/libstate/scan_name.h | 18 +++++++++--------- src/mac/mac.h | 2 +- src/math/bigint/bigint.h | 4 ++-- src/pubkey/dl_algo/dl_algo.h | 12 ++++++------ src/pubkey/dl_group/dl_group.h | 10 +++++----- src/pubkey/ecdh/ecdh.h | 4 ++-- src/pubkey/if_algo/if_algo.h | 8 ++++---- src/pubkey/pk_keys.h | 10 +++++----- src/pubkey/pk_ops.h | 12 ++++++------ src/pubkey/pkcs8.h | 16 ++++++++-------- src/pubkey/pubkey.h | 16 ++++++++-------- src/s2k/s2k.h | 4 ++-- src/sym_algo/sym_algo.h | 2 +- src/utils/buf_comp/buf_comp.h | 2 +- src/utils/version.h | 10 +++++----- 36 files changed, 168 insertions(+), 168 deletions(-) (limited to 'src/math/bigint') diff --git a/src/algo_factory/algo_cache.h b/src/algo_factory/algo_cache.h index ad8d41383..376af130b 100644 --- a/src/algo_factory/algo_cache.h +++ b/src/algo_factory/algo_cache.h @@ -32,7 +32,7 @@ class Algorithm_Cache /** * @param algo_spec names the requested algorithm * @param pref_provider suggests a preferred provider - * @return a prototype object, or NULL + * @return prototype object, or NULL */ const T* get(const std::string& algo_spec, const std::string& pref_provider); diff --git a/src/alloc/secmem.h b/src/alloc/secmem.h index d1a3ba7bd..39b5549a9 100644 --- a/src/alloc/secmem.h +++ b/src/alloc/secmem.h @@ -24,7 +24,7 @@ class MemoryRegion /** * Find out the size of the buffer, i.e. how many objects of type T it * contains. - * @return the size of the buffer + * @return size of the buffer */ u32bit size() const { return used; } @@ -36,37 +36,37 @@ class MemoryRegion /** * Get a pointer to the first element in the buffer. - * @return a pointer to the first element in the buffer + * @return pointer to the first element in the buffer */ operator T* () { return buf; } /** * Get a constant pointer to the first element in the buffer. - * @return a constant pointer to the first element in the buffer + * @return constant pointer to the first element in the buffer */ operator const T* () const { return buf; } /** * Get a pointer to the first element in the buffer. - * @return a pointer to the first element in the buffer + * @return pointer to the first element in the buffer */ T* begin() { return buf; } /** * Get a constant pointer to the first element in the buffer. - * @return a constant pointer to the first element in the buffer + * @return constant pointer to the first element in the buffer */ const T* begin() const { return buf; } /** * Get a pointer to the last element in the buffer. - * @return a pointer to the last element in the buffer + * @return pointer to the last element in the buffer */ T* end() { return (buf + size()); } /** * Get a constant pointer to the last element in the buffer. - * @return a constant pointer to the last element in the buffer + * @return constant pointer to the last element in the buffer */ const T* end() const { return (buf + size()); } @@ -98,7 +98,7 @@ class MemoryRegion * Copy the contents of another buffer into this buffer. * The former contents of *this are discarded. * @param other the buffer to copy the contents from. - * @return a reference to *this + * @return reference to *this */ MemoryRegion& operator=(const MemoryRegion& other) { if(this != &other) set(other); return (*this); } @@ -299,7 +299,7 @@ class MemoryVector : public MemoryRegion /** * Copy the contents of another buffer into this buffer. * @param in the buffer to copy the contents from - * @return a reference to *this + * @return reference to *this */ MemoryVector& operator=(const MemoryRegion& in) { if(this != &in) set(in); return (*this); } @@ -352,7 +352,7 @@ class SecureVector : public MemoryRegion /** * Copy the contents of another buffer into this buffer. * @param in the buffer to copy the contents from - * @return a reference to *this + * @return reference to *this */ SecureVector& operator=(const MemoryRegion& in) { if(this != &in) set(in); return (*this); } diff --git a/src/asn1/asn1_oid.h b/src/asn1/asn1_oid.h index e6d077bee..b3db97744 100644 --- a/src/asn1/asn1_oid.h +++ b/src/asn1/asn1_oid.h @@ -31,13 +31,13 @@ class BOTAN_DLL OID : public ASN1_Object /** * Get this OID as list (vector) of its components. - * @return a vector representing this OID + * @return vector representing this OID */ std::vector get_id() const { return id; } /** * Get this OID as a string - * @return a string representing this OID + * @return string representing this OID */ std::string as_string() const; @@ -55,7 +55,7 @@ class BOTAN_DLL OID : public ASN1_Object /** * Add a component to this OID. * @param new_comp the new component to add to the end of this OID - * @return a reference to *this + * @return reference to *this */ OID& operator+=(u32bit new_comp); diff --git a/src/block/block_cipher.h b/src/block/block_cipher.h index 73c72a9e4..c1b58996e 100644 --- a/src/block/block_cipher.h +++ b/src/block/block_cipher.h @@ -40,12 +40,12 @@ class BOTAN_DLL BlockCipher : public SymmetricAlgorithm const u32bit BLOCK_SIZE; /** - * @return the native parallelism of this cipher in blocks + * @return native parallelism of this cipher in blocks */ virtual u32bit parallelism() const { return 1; } /** - * @return the prefererred parallelism of this cipher in bytes + * @return prefererred parallelism of this cipher in bytes */ u32bit parallel_bytes() const { diff --git a/src/block/gost_28147/gost_28147.h b/src/block/gost_28147/gost_28147.h index dbea932a0..ec23466f4 100644 --- a/src/block/gost_28147/gost_28147.h +++ b/src/block/gost_28147/gost_28147.h @@ -24,7 +24,7 @@ class BOTAN_DLL GOST_28147_89_Params /** * @param row the row * @param col the column - * @return the sbox entry at this row/column + * @return sbox entry at this row/column */ byte sbox_entry(u32bit row, u32bit col) const; diff --git a/src/cert/cvc/eac_asn_obj.h b/src/cert/cvc/eac_asn_obj.h index 9eaf02f63..d0bab6fdd 100644 --- a/src/cert/cvc/eac_asn_obj.h +++ b/src/cert/cvc/eac_asn_obj.h @@ -26,13 +26,13 @@ class BOTAN_DLL EAC_Time : public ASN1_Object /** * Get a this objects value as a string. - * @return the date string + * @return date string */ std::string as_string() const; /** * Get a this objects value as a readable formatted string. - * @return the date string + * @return date string */ std::string readable_string() const; @@ -72,19 +72,19 @@ class BOTAN_DLL EAC_Time : public ASN1_Object /** * Get the year value of this objects. - * @return the year value + * @return year value */ u32bit get_year() const; /** * Get the month value of this objects. - * @return the month value + * @return month value */ u32bit get_month() const; /** * Get the day value of this objects. - * @return the day value + * @return day value */ u32bit get_day() const; @@ -174,13 +174,13 @@ class BOTAN_DLL ASN1_EAC_String: public ASN1_Object /** * Get this objects string value. - * @return the string value + * @return string value */ std::string value() const; /** * Get this objects string value. - * @return the string value in iso8859 encoding + * @return string value in iso8859 encoding */ std::string iso_8859() const; diff --git a/src/cert/cvc/signed_obj.h b/src/cert/cvc/signed_obj.h index c0ae2cfc5..0c0fb30af 100644 --- a/src/cert/cvc/signed_obj.h +++ b/src/cert/cvc/signed_obj.h @@ -24,7 +24,7 @@ class BOTAN_DLL EAC_Signed_Object public: /** * Get the TBS (to-be-signed) data in this object. - * @return the DER encoded TBS data of this object + * @return DER encoded TBS data of this object */ virtual SecureVector tbs_data() const = 0; @@ -32,7 +32,7 @@ class BOTAN_DLL EAC_Signed_Object * Get the signature of this object as a concatenation, i.e. if the * signature consists of multiple parts (like in the case of ECDSA) * these will be concatenated. - * @return the signature as a concatenation of its parts + * @return signature as a concatenation of its parts */ /* @@ -67,13 +67,13 @@ class BOTAN_DLL EAC_Signed_Object /** * BER encode this object. - * @return the result containing the BER representation of this object. + * @return result containing the BER representation of this object. */ SecureVector BER_encode() const; /** * PEM encode this object. - * @return the result containing the PEM representation of this object. + * @return result containing the PEM representation of this object. */ std::string PEM_encode() const; diff --git a/src/cert/x509/crl_ent.h b/src/cert/x509/crl_ent.h index 2b06189e4..ec90750db 100644 --- a/src/cert/x509/crl_ent.h +++ b/src/cert/x509/crl_ent.h @@ -23,19 +23,19 @@ class BOTAN_DLL CRL_Entry : public ASN1_Object /** * Get the serial number of the certificate associated with this entry. - * @return the certificate's serial number + * @return certificate's serial number */ MemoryVector serial_number() const { return serial; } /** * Get the revocation date of the certificate associated with this entry - * @return the certificate's revocation date + * @return certificate's revocation date */ X509_Time expire_time() const { return time; } /** * Get the entries reason code - * @return the reason code + * @return reason code */ CRL_Code reason_code() const { return reason; } diff --git a/src/cert/x509/pkcs10.h b/src/cert/x509/pkcs10.h index 9b435de52..d1be9e0d3 100644 --- a/src/cert/x509/pkcs10.h +++ b/src/cert/x509/pkcs10.h @@ -23,38 +23,38 @@ class BOTAN_DLL PKCS10_Request : public X509_Object public: /** * Get the subject public key. - * @return the subject public key + * @return subject public key */ Public_Key* subject_public_key() const; /** * Get the raw DER encoded public key. - * @return the raw DER encoded public key + * @return raw DER encoded public key */ MemoryVector raw_public_key() const; /** * Get the subject DN. - * @return the subject DN + * @return subject DN */ X509_DN subject_dn() const; /** * Get the subject alternative name. - * @return the subject alternative name. + * @return subject alternative name. */ AlternativeName subject_alt_name() const; /** * Get the key constraints for the key associated with this * PKCS#10 object. - * @return the key constraints + * @return key constraints */ Key_Constraints constraints() const; /** * Get the extendend key constraints (if any). - * @return the extended key constraints + * @return extended key constraints */ std::vector ex_constraints() const; @@ -67,13 +67,13 @@ class BOTAN_DLL PKCS10_Request : public X509_Object /** * Return the constraint on the path length defined * in the BasicConstraints extension. - * @return the path limit + * @return path limit */ u32bit path_limit() const; /** * Get the challenge password for this request - * @return the challenge password for this request + * @return challenge password for this request */ std::string challenge_password() const; diff --git a/src/cert/x509/x509_ca.h b/src/cert/x509/x509_ca.h index 6f36444ee..97be6a415 100644 --- a/src/cert/x509/x509_ca.h +++ b/src/cert/x509/x509_ca.h @@ -30,7 +30,7 @@ class BOTAN_DLL X509_CA * @param rng the rng to use * @param not_before the starting time for the certificate * @param not_after the expiration time for the certificate - * @return the resulting certificate + * @return resulting certificate */ X509_Certificate sign_request(const PKCS10_Request& req, RandomNumberGenerator& rng, @@ -39,7 +39,7 @@ class BOTAN_DLL X509_CA /** * Get the certificate of this CA. - * @return the CA certificate + * @return CA certificate */ X509_Certificate ca_certificate() const; @@ -48,7 +48,7 @@ class BOTAN_DLL X509_CA * @param rng the random number generator to use * @param next_update the time to set in next update in seconds * as the offset from the current time - * @return the new CRL + * @return new CRL */ X509_CRL new_crl(RandomNumberGenerator& rng, u32bit next_update = 0) const; diff --git a/src/cert/x509/x509_crl.h b/src/cert/x509/x509_crl.h index 74427fbef..c2b3c4f5c 100644 --- a/src/cert/x509/x509_crl.h +++ b/src/cert/x509/x509_crl.h @@ -31,13 +31,13 @@ class BOTAN_DLL X509_CRL : public X509_Object /** * Get the entries of this CRL in the form of a vector. - * @return a vector containing the entries of this CRL. + * @return vector containing the entries of this CRL. */ std::vector get_revoked() const; /** * Get the issuer DN of this CRL. - * @return the CRLs issuer DN + * @return CRLs issuer DN */ X509_DN issuer_dn() const; @@ -49,19 +49,19 @@ class BOTAN_DLL X509_CRL : public X509_Object /** * Get the serial number of this CRL. - * @return the CRLs serial number + * @return CRLs serial number */ u32bit crl_number() const; /** * Get the CRL's thisUpdate value. - * @return the CRLs thisUpdate + * @return CRLs thisUpdate */ X509_Time this_update() const; /** * Get the CRL's nextUpdate value. - * @return the CRLs nextdUpdate + * @return CRLs nextdUpdate */ X509_Time next_update() const; diff --git a/src/cert/x509/x509_obj.h b/src/cert/x509/x509_obj.h index c7f92fa9d..52b76d218 100644 --- a/src/cert/x509/x509_obj.h +++ b/src/cert/x509/x509_obj.h @@ -33,7 +33,7 @@ class BOTAN_DLL X509_Object * @param rng the random number generator to use * @param alg_id the algorithm identifier of the signature scheme * @param tbs the tbs bits to be signed - * @return the signed X509 object + * @return signed X509 object */ static MemoryVector make_signed(class PK_Signer* signer, RandomNumberGenerator& rng, diff --git a/src/cert/x509/x509cert.h b/src/cert/x509/x509cert.h index 4a9d11f7f..dc7ef4dbb 100644 --- a/src/cert/x509/x509cert.h +++ b/src/cert/x509/x509cert.h @@ -24,19 +24,19 @@ class BOTAN_DLL X509_Certificate : public X509_Object public: /** * Get the public key associated with this certificate. - * @return the subject public key of this certificate + * @return subject public key of this certificate */ Public_Key* subject_public_key() const; /** * Get the issuer certificate DN. - * @return the issuer DN of this certificate + * @return issuer DN of this certificate */ X509_DN issuer_dn() const; /** * Get the subject certificate DN. - * @return the subject DN of this certificate + * @return subject DN of this certificate */ X509_DN subject_dn() const; @@ -50,7 +50,7 @@ class BOTAN_DLL X509_Certificate : public X509_Object * "X509v3.BasicConstraints.is_ca", "X509v3.ExtendedKeyUsage", * "X509v3.CertificatePolicies", "X509v3.SubjectKeyIdentifier" or * "X509.Certificate.serial". - * @return the value(s) of the specified parameter + * @return value(s) of the specified parameter */ std::vector subject_info(const std::string& name) const; @@ -58,43 +58,43 @@ class BOTAN_DLL X509_Certificate : public X509_Object * Get a value for a specific subject_info parameter name. * @param name the name of the paramter to look up. Possible names are * "X509.Certificate.v2.key_id" or "X509v3.AuthorityKeyIdentifier". - * @return the value(s) of the specified parameter + * @return value(s) of the specified parameter */ std::vector issuer_info(const std::string& name) const; /** * Get the notBefore of the certificate. - * @return the notBefore of the certificate + * @return notBefore of the certificate */ std::string start_time() const; /** * Get the notAfter of the certificate. - * @return the notAfter of the certificate + * @return notAfter of the certificate */ std::string end_time() const; /** * Get the X509 version of this certificate object. - * @return the X509 version + * @return X509 version */ u32bit x509_version() const; /** * Get the serial number of this certificate. - * @return the certificates serial number + * @return certificates serial number */ MemoryVector serial_number() const; /** * Get the DER encoded AuthorityKeyIdentifier of this certificate. - * @return the DER encoded AuthorityKeyIdentifier + * @return DER encoded AuthorityKeyIdentifier */ MemoryVector authority_key_id() const; /** * Get the DER encoded SubjectKeyIdentifier of this certificate. - * @return the DER encoded SubjectKeyIdentifier + * @return DER encoded SubjectKeyIdentifier */ MemoryVector subject_key_id() const; @@ -113,14 +113,14 @@ class BOTAN_DLL X509_Certificate : public X509_Object /** * Get the path limit as defined in the BasicConstraints extension of * this certificate. - * @return the path limit + * @return path limit */ u32bit path_limit() const; /** * Get the key constraints as defined in the KeyUsage extension of this * certificate. - * @return the key constraints + * @return key constraints */ Key_Constraints constraints() const; @@ -128,14 +128,14 @@ class BOTAN_DLL X509_Certificate : public X509_Object * Get the key constraints as defined in the ExtendedKeyUsage * extension of this * certificate. - * @return the key constraints + * @return key constraints */ std::vector ex_constraints() const; /** * Get the policies as defined in the CertificatePolicies extension * of this certificate. - * @return the certificate policies + * @return certificate policies */ std::vector policies() const; diff --git a/src/cert/x509/x509self.h b/src/cert/x509/x509self.h index 741350067..df5731050 100644 --- a/src/cert/x509/x509self.h +++ b/src/cert/x509/x509self.h @@ -174,7 +174,7 @@ namespace X509 { * associated with this self-signed certificate * @param hash_fn the hash function to use * @param rng the rng to use -* @return the newly created self-signed certificate +* @return newly created self-signed certificate */ BOTAN_DLL X509_Certificate create_self_signed_cert(const X509_Cert_Options& opts, @@ -188,7 +188,7 @@ create_self_signed_cert(const X509_Cert_Options& opts, * @param key the key used to sign this request * @param rng the rng to use * @param hash_fn the hash function to use -* @return the newly created PKCS#10 request +* @return newly created PKCS#10 request */ BOTAN_DLL PKCS10_Request create_cert_req(const X509_Cert_Options& opts, const Private_Key& key, diff --git a/src/filters/data_src.h b/src/filters/data_src.h index c69aa84b0..bf3bfa99b 100644 --- a/src/filters/data_src.h +++ b/src/filters/data_src.h @@ -26,7 +26,7 @@ class BOTAN_DLL DataSource * * @param out the byte array to write the result to * @param length the length of the byte array out - * @return the length in bytes that was actually read and put + * @return length in bytes that was actually read and put * into out */ virtual u32bit read(byte out[], u32bit length) = 0; @@ -39,7 +39,7 @@ class BOTAN_DLL DataSource * @param out the byte array to write the output to * @param length the length of the byte array out * @param peek_offset the offset into the stream to read at - * @return the length in bytes that was actually read and put + * @return length in bytes that was actually read and put * into out */ virtual u32bit peek(byte out[], u32bit length, @@ -59,7 +59,7 @@ class BOTAN_DLL DataSource /** * Read one byte. * @param out the byte to read to - * @return the length in bytes that was actually read and put + * @return length in bytes that was actually read and put * into out */ u32bit read_byte(byte& out); @@ -67,7 +67,7 @@ class BOTAN_DLL DataSource /** * Peek at one byte. * @param out an output byte - * @return the length in bytes that was actually read and put + * @return length in bytes that was actually read and put * into out */ u32bit peek_byte(byte& out) const; @@ -75,7 +75,7 @@ class BOTAN_DLL DataSource /** * Discard the next N bytes of the data * @param N the number of bytes to discard - * @return the number of bytes actually discarded + * @return number of bytes actually discarded */ u32bit discard_next(u32bit N); diff --git a/src/filters/pipe.h b/src/filters/pipe.h index 4f66b51d9..b7f09199b 100644 --- a/src/filters/pipe.h +++ b/src/filters/pipe.h @@ -116,7 +116,7 @@ class BOTAN_DLL Pipe : public DataSource * Find out how many bytes are ready to read. * @param msg the number identifying the message * for which the information is desired - * @return the number of bytes that can still be read + * @return number of bytes that can still be read */ u32bit remaining(message_id msg = DEFAULT_MESSAGE) const; @@ -127,7 +127,7 @@ class BOTAN_DLL Pipe : public DataSource * * @param output the byte array to write the read bytes to * @param length the length of the byte array output - * @return the number of bytes actually read into output + * @return number of bytes actually read into output */ u32bit read(byte output[], u32bit length); @@ -138,7 +138,7 @@ class BOTAN_DLL Pipe : public DataSource * @param output the byte array to write the read bytes to * @param length the length of the byte array output * @param msg the number identifying the message to read from - * @return the number of bytes actually read into output + * @return number of bytes actually read into output */ u32bit read(byte output[], u32bit length, message_id msg); @@ -149,21 +149,21 @@ class BOTAN_DLL Pipe : public DataSource * * @param output the byte to write the result to * @param msg the message to read from - * @return the number of bytes actually read into output + * @return number of bytes actually read into output */ u32bit read(byte& output, message_id msg = DEFAULT_MESSAGE); /** * Read the full contents of the pipe. * @param msg the number identifying the message to read from - * @return a SecureVector holding the contents of the pipe + * @return SecureVector holding the contents of the pipe */ SecureVector read_all(message_id msg = DEFAULT_MESSAGE); /** * Read the full contents of the pipe. * @param msg the number identifying the message to read from - * @return a string holding the contents of the pipe + * @return string holding the contents of the pipe */ std::string read_all_as_string(message_id = DEFAULT_MESSAGE); @@ -173,7 +173,7 @@ class BOTAN_DLL Pipe : public DataSource * @param output the byte array to write the peeked message part to * @param length the length of the byte array output * @param offset the offset from the current position in message - * @return the number of bytes actually peeked and written into output + * @return number of bytes actually peeked and written into output */ u32bit peek(byte output[], u32bit length, u32bit offset) const; @@ -184,7 +184,7 @@ class BOTAN_DLL Pipe : public DataSource * @param length the length of the byte array output * @param offset the offset from the current position in message * @param msg the number identifying the message to peek from - * @return the number of bytes actually peeked and written into output + * @return number of bytes actually peeked and written into output */ u32bit peek(byte output[], u32bit length, u32bit offset, message_id msg) const; @@ -195,7 +195,7 @@ class BOTAN_DLL Pipe : public DataSource * @param output the byte to write the peeked message byte to * @param offset the offset from the current position in message * @param msg the number identifying the message to peek from - * @return the number of bytes actually peeked and written into output + * @return number of bytes actually peeked and written into output */ u32bit peek(byte& output, u32bit offset, message_id msg = DEFAULT_MESSAGE) const; @@ -214,7 +214,7 @@ class BOTAN_DLL Pipe : public DataSource /** * Get the number of messages the are in this pipe. - * @return the number of messages the are in this pipe + * @return number of messages the are in this pipe */ message_id message_count() const; diff --git a/src/hash/hash.h b/src/hash/hash.h index 4f753f765..cdf90f184 100644 --- a/src/hash/hash.h +++ b/src/hash/hash.h @@ -31,7 +31,7 @@ class BOTAN_DLL HashFunction : public BufferedComputation /** * Get the name of this algorithm. - * @return the name of this algorithm + * @return name of this algorithm */ virtual std::string name() const = 0; diff --git a/src/libstate/libstate.h b/src/libstate/libstate.h index d7fb6e02c..eeb38287a 100644 --- a/src/libstate/libstate.h +++ b/src/libstate/libstate.h @@ -35,12 +35,12 @@ class BOTAN_DLL Library_State void initialize(bool thread_safe); /** - * @return the global Algorithm_Factory + * @return global Algorithm_Factory */ Algorithm_Factory& algorithm_factory() const; /** - * @return the global RandomNumberGenerator + * @return global RandomNumberGenerator */ RandomNumberGenerator& global_rng(); @@ -111,7 +111,7 @@ class BOTAN_DLL Library_State std::string deref_alias(const std::string& alias) const; /** - * @return a newly created Mutex (free with delete) + * @return newly created Mutex (free with delete) */ Mutex* get_mutex() const; private: @@ -155,7 +155,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 e1dc1d95c..c980e5f8d 100644 --- a/src/libstate/look_pk.h +++ b/src/libstate/look_pk.h @@ -19,7 +19,7 @@ namespace Botan { * * @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) @@ -33,7 +33,7 @@ inline PK_Encryptor* get_pk_encryptor(const Public_Key& key, * * @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) @@ -48,7 +48,7 @@ inline PK_Decryptor* get_pk_decryptor(const Private_Key& key, * @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, @@ -64,7 +64,7 @@ inline PK_Signer* get_pk_signer(const Private_Key& key, * @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, @@ -79,7 +79,7 @@ inline PK_Verifier* get_pk_verifier(const Public_Key& key, * * @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.h b/src/libstate/lookup.h index aa3a65f96..76e06b2de 100644 --- a/src/libstate/lookup.h +++ b/src/libstate/lookup.h @@ -64,7 +64,7 @@ retrieve_mac(const std::string& algo_spec) * @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) { @@ -77,7 +77,7 @@ inline BlockCipher* get_block_cipher(const std::string& algo_spec) * @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) { @@ -90,7 +90,7 @@ inline StreamCipher* get_stream_cipher(const std::string& algo_spec) * @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) { @@ -103,7 +103,7 @@ inline HashFunction* get_hash(const std::string& algo_spec) * @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) { @@ -114,7 +114,7 @@ inline MessageAuthenticationCode* get_mac(const std::string& algo_spec) /** * String to key algorithm factory method. * @param algo_spec the name of the desired string to key (S2K) algorithm -* @return a pointer to the string to key algorithm object +* @return pointer to the string to key algorithm object */ BOTAN_DLL S2K* get_s2k(const std::string& algo_spec); @@ -127,7 +127,7 @@ BOTAN_DLL S2K* get_s2k(const std::string& algo_spec); /** * Factory method for EME (message-encoding methods for encryption) objects * @param algo_spec the name of the EME to create -* @return a pointer to the desired EME object +* @return pointer to the desired EME object */ BOTAN_DLL EME* get_eme(const std::string& algo_spec); @@ -135,14 +135,14 @@ BOTAN_DLL EME* get_eme(const std::string& algo_spec); * Factory method for EMSA (message-encoding methods for signatures * with appendix) objects * @param algo_spec the name of the EME to create -* @return a pointer to the desired EME object +* @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 algo_spec the name of the KDF to create -* @return a pointer to the desired KDF object +* @return pointer to the desired KDF object */ BOTAN_DLL KDF* get_kdf(const std::string& algo_spec); @@ -158,7 +158,7 @@ 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& algo_spec, const SymmetricKey& key, @@ -172,7 +172,7 @@ BOTAN_DLL Keyed_Filter* get_cipher(const std::string& algo_spec, * 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& algo_spec, const SymmetricKey& key, @@ -185,7 +185,7 @@ BOTAN_DLL Keyed_Filter* get_cipher(const std::string& algo_spec, * @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& algo_spec, Cipher_Dir direction); 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.h b/src/libstate/scan_name.h index 49c3d3765..3d11d54f6 100644 --- a/src/libstate/scan_name.h +++ b/src/libstate/scan_name.h @@ -28,22 +28,22 @@ class BOTAN_DLL SCAN_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(); } @@ -57,32 +57,32 @@ class BOTAN_DLL SCAN_Name /** * @param i which argument - * @return the ith 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 + * @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 + * @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] : ""; } diff --git a/src/mac/mac.h b/src/mac/mac.h index 52ff9c94c..4518d91ad 100644 --- a/src/mac/mac.h +++ b/src/mac/mac.h @@ -36,7 +36,7 @@ class BOTAN_DLL MessageAuthenticationCode : public BufferedComputation, /** * Get the name of this algorithm. - * @return the name of this algorithm + * @return name of this algorithm */ virtual std::string name() const = 0; diff --git a/src/math/bigint/bigint.h b/src/math/bigint/bigint.h index cd1aebf00..81defd201 100644 --- a/src/math/bigint/bigint.h +++ b/src/math/bigint/bigint.h @@ -220,7 +220,7 @@ class BOTAN_DLL BigInt /** * Return the word at a specified position of the internal register * @param n position in the register - * @return the value at position n + * @return value at position n */ word word_at(u32bit n) const { return ((n < size()) ? reg[n] : 0); } @@ -371,7 +371,7 @@ class BOTAN_DLL BigInt * @param rng a random number generator * @param min the minimum value * @param max the maximum value - * @return a random integer between min and max + * @return random integer between min and max */ static BigInt random_integer(RandomNumberGenerator& rng, const BigInt& min, diff --git a/src/pubkey/dl_algo/dl_algo.h b/src/pubkey/dl_algo/dl_algo.h index 445f6c3f9..429bfb554 100644 --- a/src/pubkey/dl_algo/dl_algo.h +++ b/src/pubkey/dl_algo/dl_algo.h @@ -28,7 +28,7 @@ class BOTAN_DLL DL_Scheme_PublicKey : public virtual Public_Key /** * Get the DL domain parameters of this key. - * @return the DL domain parameters of this key + * @return DL domain parameters of this key */ const DL_Group& get_domain() const { return group; } @@ -39,25 +39,25 @@ class BOTAN_DLL DL_Scheme_PublicKey : public virtual Public_Key /** * Get the prime p of the underlying DL group. - * @return the prime p + * @return prime p */ const BigInt& group_p() const { return group.get_p(); } /** * Get the prime q of the underlying DL group. - * @return the prime q + * @return prime q */ const BigInt& group_q() const { return group.get_q(); } /** * Get the generator g of the underlying DL group. - * @return the generator g + * @return generator g */ const BigInt& group_g() const { return group.get_g(); } /** * Get the underlying groups encoding format. - * @return the encoding format + * @return encoding format */ virtual DL_Group::Format group_format() const = 0; @@ -82,7 +82,7 @@ class BOTAN_DLL DL_Scheme_PrivateKey : public virtual DL_Scheme_PublicKey, /** * Get the secret key x. - * @return the secret key + * @return secret key */ const BigInt& get_x() const { return x; } diff --git a/src/pubkey/dl_group/dl_group.h b/src/pubkey/dl_group/dl_group.h index a84a85f87..885ccd2f9 100644 --- a/src/pubkey/dl_group/dl_group.h +++ b/src/pubkey/dl_group/dl_group.h @@ -22,19 +22,19 @@ class BOTAN_DLL DL_Group public: /** * Get the prime p. - * @return the prime p + * @return prime p */ const BigInt& get_p() const; /** * Get the prime q. - * @return the prime q + * @return prime q */ const BigInt& get_q() const; /** * Get the base g. - * @return the base g + * @return base g */ const BigInt& get_g() const; @@ -68,14 +68,14 @@ class BOTAN_DLL DL_Group /** * Encode this group into a string using PEM encoding. * @param format the encoding format - * @return the string holding the PEM encoded group + * @return string holding the PEM encoded group */ std::string PEM_encode(Format format) const; /** * Encode this group into a string using DER encoding. * @param format the encoding format - * @return the string holding the DER encoded group + * @return string holding the DER encoded group */ SecureVector DER_encode(Format format) const; diff --git a/src/pubkey/ecdh/ecdh.h b/src/pubkey/ecdh/ecdh.h index ea1205a48..f0872c5cc 100644 --- a/src/pubkey/ecdh/ecdh.h +++ b/src/pubkey/ecdh/ecdh.h @@ -46,12 +46,12 @@ class BOTAN_DLL ECDH_PublicKey : public virtual EC_PublicKey * Get the maximum number of bits allowed to be fed to this key. * This is the bitlength of the order of the base point. - * @return the maximum number of input bits + * @return maximum number of input bits */ u32bit max_input_bits() const { return domain().get_order().bits(); } /** - * @return the public point value + * @return public point value */ MemoryVector public_value() const { return EC2OSP(public_point(), PointGFp::UNCOMPRESSED); } diff --git a/src/pubkey/if_algo/if_algo.h b/src/pubkey/if_algo/if_algo.h index 764a99e13..d0a1ec197 100644 --- a/src/pubkey/if_algo/if_algo.h +++ b/src/pubkey/if_algo/if_algo.h @@ -34,12 +34,12 @@ class BOTAN_DLL IF_Scheme_PublicKey : public virtual Public_Key MemoryVector x509_subject_public_key() const; /** - * @return the public modulus + * @return public modulus */ const BigInt& get_n() const { return n; } /** - * @return the public exponent + * @return public exponent */ const BigInt& get_e() const { return e; } @@ -73,13 +73,13 @@ class BOTAN_DLL IF_Scheme_PrivateKey : public virtual IF_Scheme_PublicKey, /** * Get the first prime p. - * @return the prime p + * @return prime p */ const BigInt& get_p() const { return p; } /** * Get the second prime q. - * @return the prime q + * @return prime q */ const BigInt& get_q() const { return q; } diff --git a/src/pubkey/pk_keys.h b/src/pubkey/pk_keys.h index b1036152d..8f086c617 100644 --- a/src/pubkey/pk_keys.h +++ b/src/pubkey/pk_keys.h @@ -23,13 +23,13 @@ class BOTAN_DLL Public_Key public: /** * Get the name of the underlying public key scheme. - * @return the name of the public key scheme + * @return name of the public key scheme */ virtual std::string algo_name() const = 0; /** * Get the OID of the underlying public key scheme. - * @return the OID of the public key scheme + * @return OID of the public key scheme */ virtual OID get_oid() const; @@ -45,19 +45,19 @@ class BOTAN_DLL Public_Key /** * Find out the number of message parts supported by this scheme. - * @return the number of message parts + * @return number of message parts */ virtual u32bit message_parts() const { return 1; } /** * Find out the message part size supported by this scheme/key. - * @return the size of the message parts + * @return size of the message parts in bits */ virtual u32bit message_part_size() const { return 0; } /** * Get the maximum message size in bits supported by this public key. - * @return the maximum message in bits + * @return maximum message size in bits */ virtual u32bit max_input_bits() const = 0; diff --git a/src/pubkey/pk_ops.h b/src/pubkey/pk_ops.h index 7a5b1d94d..b15a8d8cd 100644 --- a/src/pubkey/pk_ops.h +++ b/src/pubkey/pk_ops.h @@ -51,19 +51,19 @@ class BOTAN_DLL Signature public: /** * Find out the number of message parts supported by this scheme. - * @return the number of message parts + * @return number of message parts */ virtual u32bit message_parts() const { return 1; } /** * Find out the message part size supported by this scheme/key. - * @return the size of the message parts + * @return size of the message parts */ virtual u32bit message_part_size() const { return 0; } /** * Get the maximum message size in bits supported by this public key. - * @return the maximum message in bits + * @return maximum message in bits */ virtual u32bit max_input_bits() const = 0; @@ -87,19 +87,19 @@ class BOTAN_DLL Verification public: /** * Get the maximum message size in bits supported by this public key. - * @return the maximum message in bits + * @return maximum message in bits */ virtual u32bit max_input_bits() const = 0; /** * Find out the number of message parts supported by this scheme. - * @return the number of message parts + * @return number of message parts */ virtual u32bit message_parts() const { return 1; } /** * Find out the message part size supported by this scheme/key. - * @return the size of the message parts + * @return size of the message parts */ virtual u32bit message_part_size() const { return 0; } diff --git a/src/pubkey/pkcs8.h b/src/pubkey/pkcs8.h index 542d5bb2d..3da96d840 100644 --- a/src/pubkey/pkcs8.h +++ b/src/pubkey/pkcs8.h @@ -34,7 +34,7 @@ BOTAN_DLL SecureVector BER_encode(const Private_Key& key); /** * Get a string containing a PEM encoded private key. * @param key the key to encode -* @return the encoded key +* @return encoded key */ BOTAN_DLL std::string PEM_encode(const Private_Key& key); @@ -46,7 +46,7 @@ BOTAN_DLL std::string PEM_encode(const Private_Key& key); * @param pbe_algo the name of the desired password-based encryption algorithm; if empty ("") a reasonable (portable/secure) default will be chosen. -* @return the encrypted key in binary BER form +* @return encrypted key in binary BER form */ BOTAN_DLL SecureVector BER_encode(const Private_Key& key, RandomNumberGenerator& rng, @@ -62,7 +62,7 @@ BOTAN_DLL SecureVector BER_encode(const Private_Key& key, * @param pbe_algo the name of the desired password-based encryption algorithm; if empty ("") a reasonable (portable/secure) default will be chosen. -* @return the encrypted key in PEM form +* @return encrypted key in PEM form */ BOTAN_DLL std::string PEM_encode(const Private_Key& key, RandomNumberGenerator& rng, @@ -119,7 +119,7 @@ inline void encrypt_key(const Private_Key& key, * @param source the data source providing the encoded key * @param rng the rng to use * @param ui the user interface to be used for passphrase dialog -* @return the loaded private key object +* @return loaded private key object */ BOTAN_DLL Private_Key* load_key(DataSource& source, RandomNumberGenerator& rng, @@ -130,7 +130,7 @@ BOTAN_DLL Private_Key* load_key(DataSource& source, * @param rng the rng to use * @param pass the passphrase to decrypt the key. Provide an empty * string if the key is not encoded. -* @return the loaded private key object +* @return loaded private key object */ BOTAN_DLL Private_Key* load_key(DataSource& source, RandomNumberGenerator& rng, @@ -141,7 +141,7 @@ BOTAN_DLL Private_Key* load_key(DataSource& source, * @param filename the path to the file containing the encoded key * @param rng the rng to use * @param ui the user interface to be used for passphrase dialog -* @return the loaded private key object +* @return loaded private key object */ BOTAN_DLL Private_Key* load_key(const std::string& filename, RandomNumberGenerator& rng, @@ -152,7 +152,7 @@ BOTAN_DLL Private_Key* load_key(const std::string& filename, * @param rng the rng to use * @param pass the passphrase to decrypt the key. Provide an empty * string if the key is not encoded. -* @return the loaded private key object +* @return loaded private key object */ BOTAN_DLL Private_Key* load_key(const std::string& filename, RandomNumberGenerator& rng, @@ -162,7 +162,7 @@ BOTAN_DLL Private_Key* load_key(const std::string& filename, * Copy an existing encoded key object. * @param key the key to copy * @param rng the rng to use -* @return the new copy of the key +* @return new copy of the key */ BOTAN_DLL Private_Key* copy_key(const Private_Key& key, RandomNumberGenerator& rng); diff --git a/src/pubkey/pubkey.h b/src/pubkey/pubkey.h index d034427e1..ff4355675 100644 --- a/src/pubkey/pubkey.h +++ b/src/pubkey/pubkey.h @@ -43,7 +43,7 @@ class BOTAN_DLL PK_Encryptor * @param in the message as a byte array * @param length the length of the above byte array * @param rng the random number source to use - * @return the encrypted message + * @return encrypted message */ SecureVector encrypt(const byte in[], u32bit length, RandomNumberGenerator& rng) const @@ -55,7 +55,7 @@ class BOTAN_DLL PK_Encryptor * Encrypt a message. * @param in the message * @param rng the random number source to use - * @return the encrypted message + * @return encrypted message */ SecureVector encrypt(const MemoryRegion& in, RandomNumberGenerator& rng) const @@ -65,7 +65,7 @@ class BOTAN_DLL PK_Encryptor /** * Return the maximum allowed message size in bytes. - * @return the maximum message size in bytes + * @return maximum message size in bytes */ virtual u32bit maximum_input_size() const = 0; @@ -89,7 +89,7 @@ class BOTAN_DLL PK_Decryptor * Decrypt a ciphertext. * @param in the ciphertext as a byte array * @param length the length of the above byte array - * @return the decrypted message + * @return decrypted message */ SecureVector decrypt(const byte in[], u32bit length) const { @@ -99,7 +99,7 @@ class BOTAN_DLL PK_Decryptor /** * Decrypt a ciphertext. * @param in the ciphertext - * @return the decrypted message + * @return decrypted message */ SecureVector decrypt(const MemoryRegion& in) const { @@ -128,7 +128,7 @@ class BOTAN_DLL PK_Signer * @param in the message to sign as a byte array * @param length the length of the above byte array * @param rng the rng to use - * @return the signature + * @return signature */ SecureVector sign_message(const byte in[], u32bit length, RandomNumberGenerator& rng); @@ -137,7 +137,7 @@ class BOTAN_DLL PK_Signer * Sign a message. * @param in the message to sign * @param rng the rng to use - * @return the signature + * @return signature */ SecureVector sign_message(const MemoryRegion& in, RandomNumberGenerator& rng) @@ -166,7 +166,7 @@ class BOTAN_DLL PK_Signer * Get the signature of the so far processed message (provided by the * calls to update()). * @param rng the rng to use - * @return the signature of the total message + * @return signature of the total message */ SecureVector signature(RandomNumberGenerator& rng); diff --git a/src/s2k/s2k.h b/src/s2k/s2k.h index 5263dfd68..59e789a15 100644 --- a/src/s2k/s2k.h +++ b/src/s2k/s2k.h @@ -21,13 +21,13 @@ class BOTAN_DLL S2K public: /** - * @return a new instance of this same algorithm + * @return new instance of this same algorithm */ virtual S2K* clone() const = 0; /** * Get the algorithm name. - * @return the name of this S2K algorithm + * @return name of this S2K algorithm */ virtual std::string name() const = 0; diff --git a/src/sym_algo/sym_algo.h b/src/sym_algo/sym_algo.h index f1a4955ca..60180de90 100644 --- a/src/sym_algo/sym_algo.h +++ b/src/sym_algo/sym_algo.h @@ -38,7 +38,7 @@ class BOTAN_DLL SymmetricAlgorithm /** * The name of the algorithm. - * @return the name of the algorithm + * @return name of the algorithm */ virtual std::string name() const = 0; diff --git a/src/utils/buf_comp/buf_comp.h b/src/utils/buf_comp/buf_comp.h index 6ec21c0d0..e807e6abf 100644 --- a/src/utils/buf_comp/buf_comp.h +++ b/src/utils/buf_comp/buf_comp.h @@ -67,7 +67,7 @@ class BOTAN_DLL BufferedComputation /** * Complete the computation and retrieve the * final result. - * @return a SecureVector holding the result + * @return SecureVector holding the result */ SecureVector final() { diff --git a/src/utils/version.h b/src/utils/version.h index 9ed776ed7..13d0ac8bb 100644 --- a/src/utils/version.h +++ b/src/utils/version.h @@ -19,7 +19,7 @@ namespace Botan { /** * Get the version string identifying the version of Botan. -* @return the version string +* @return version string */ BOTAN_DLL std::string version_string(); @@ -27,25 +27,25 @@ BOTAN_DLL std::string version_string(); * Return the date this version of botan was released, in an * integer of the form YYYYMMDD. For instance a version released * on May 21, 2013 would return the integer 20130521 -* @return the release date +* @return release date */ BOTAN_DLL u32bit version_datestamp(); /** * Get the major version number. -* @return the major version number +* @return major version number */ BOTAN_DLL u32bit version_major(); /** * Get the minor version number. -* @return the minor version number +* @return minor version number */ BOTAN_DLL u32bit version_minor(); /** * Get the patch number. -* @return the patch number +* @return patch number */ BOTAN_DLL u32bit version_patch(); -- cgit v1.2.3 From a8a86e17906701393c7038967541935af5144946 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 16 Jun 2010 04:12:52 +0000 Subject: Cleanup some BigInt doxygen comments --- src/math/bigint/bigint.h | 75 ++++++++++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 31 deletions(-) (limited to 'src/math/bigint') diff --git a/src/math/bigint/bigint.h b/src/math/bigint/bigint.h index 81defd201..971a7cc2c 100644 --- a/src/math/bigint/bigint.h +++ b/src/math/bigint/bigint.h @@ -44,90 +44,96 @@ class BOTAN_DLL BigInt { DivideByZero() : Exception("BigInt divide by zero") {} }; /** - * += Operator + * += operator * @param y the BigInt to add to this */ BigInt& operator+=(const BigInt& y); /** - * -= Operator + * -= operator * @param y the BigInt to subtract from this */ BigInt& operator-=(const BigInt& y); /** - * *= Operator + * *= operator * @param y the BigInt to multiply with this */ BigInt& operator*=(const BigInt& y); /** - * /= Operator + * /= operator * @param y the BigInt to divide this by */ BigInt& operator/=(const BigInt& y); /** - * %= Operator, modulo operator. + * %= operator, modulo operator. * @param y the modulus to reduce this by */ BigInt& operator%=(const BigInt& y); /** - * %= Operator + * %= operator * @param y the modulus (word) to reduce this by */ word operator%=(word y); /** - * <<= Operator - * @param y the amount of bits to shift this left + * <<= operator + * @param y the number of bits to shift this left by */ BigInt& operator<<=(u32bit y); /** - * >>= Operator - * @param y the amount of bits to shift this right + * >>= operator + * @param y the number of bits to shift this right by */ BigInt& operator>>=(u32bit y); /** - * ++ Operator + * Increment operator */ BigInt& operator++() { return (*this += 1); } /** - * -- Operator + * Decrement operator */ BigInt& operator--() { return (*this -= 1); } /** - * ++ Operator (postfix) + * ++ operator (postfix) */ BigInt operator++(int) { BigInt x = (*this); ++(*this); return x; } /** - * -- Operator (postfix) + * -- operator (postfix) */ BigInt operator--(int) { BigInt x = (*this); --(*this); return x; } /** - * Unary - Operator + * Unary negation operator + * @return negative this */ BigInt operator-() const; /** - * ! Operator + * ! operator + * @return true iff this is zero, otherwise false */ bool operator !() const { return (!is_nonzero()); } /** - * [] Operator (array access) + * [] operator (array access) + * @param i a word index + * @return the word at index i */ word& operator[](u32bit i) { return reg[i]; } /** - * [] Operator (array access) + * [] operator (array access) + * @param i a word index + * @return the word at index i */ word operator[](u32bit i) const { return reg[i]; } @@ -137,8 +143,8 @@ class BOTAN_DLL BigInt void clear() { get_reg().clear(); } /** - * Compare *this to another BigInt. - * @param n the BigInt value to compare to this. + * Compare *this to another BigInt + * @param n the BigInt value to compare with * @param check_signs include sign in comparison? * @result if (thisn) return 1, if both * values are identical return 0 [like Perl's <=> operator] @@ -158,7 +164,7 @@ class BOTAN_DLL BigInt bool is_odd() const { return (get_bit(0) == 1); } /** - * Test if the integer is not zero. + * Test if the integer is not zero * @result true if the integer is non-zero, false otherwise */ bool is_nonzero() const { return (!is_zero()); } @@ -396,15 +402,22 @@ class BOTAN_DLL BigInt /** * Create a BigInt from an integer in a byte array - * @param buf the BigInt value to compare to this. + * @param buf the binary value to load * @param length size of buf * @param base number-base of the integer in buf - * @result BigInt-representing the given integer read from the byte array + * @result BigInt representing the integer in the byte array */ static BigInt decode(const byte buf[], u32bit length, Base base = Binary); - static BigInt decode(const MemoryRegion&, Base = Binary); + /** + * Create a BigInt from an integer in a byte array + * @param buf the binary value to load + * @param base number-base of the integer in buf + * @result BigInt representing the integer in the byte array + */ + static BigInt decode(const MemoryRegion& buf, + Base base = Binary); /** * Encode a BigInt to a byte array according to IEEE 1363 @@ -426,16 +439,16 @@ class BOTAN_DLL BigInt BigInt() { signedness = Positive; } /** - * Create BigInt from 64bit-Integer value - * @param n 64bit-integer + * Create BigInt from 64 bit integer + * @param n initial value of this BigInt */ BigInt(u64bit n); /** - * Copy-Constructor: clone given BigInt - * @param bigint the BigInt to clone + * Copy Constructor + * @param other the BigInt to copy */ - BigInt(const BigInt& bigint); + BigInt(const BigInt& other); /** * Create BigInt from a string. @@ -451,9 +464,9 @@ class BOTAN_DLL BigInt /** * Create a BigInt from an integer in a byte array - * @param buf the BigInt value to compare to this. + * @param buf the byte array holding the value * @param length size of buf - * @param base number-base of the integer in buf + * @param base is the number base of the integer in buf */ BigInt(const byte buf[], u32bit length, Base base = Binary); -- cgit v1.2.3 From 7466f9e9c6c41fde429f1a92c81e192546fb7b75 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 16 Jun 2010 04:18:40 +0000 Subject: More BigInt Doxygen comment updates --- src/math/bigint/bigint.h | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'src/math/bigint') diff --git a/src/math/bigint/bigint.h b/src/math/bigint/bigint.h index 971a7cc2c..997814950 100644 --- a/src/math/bigint/bigint.h +++ b/src/math/bigint/bigint.h @@ -68,7 +68,7 @@ class BOTAN_DLL BigInt BigInt& operator/=(const BigInt& y); /** - * %= operator, modulo operator. + * %= operator, modulo operator * @param y the modulus to reduce this by */ BigInt& operator%=(const BigInt& y); @@ -143,7 +143,7 @@ class BOTAN_DLL BigInt void clear() { get_reg().clear(); } /** - * Compare *this to another BigInt + * Compare this to another BigInt * @param n the BigInt value to compare with * @param check_signs include sign in comparison? * @result if (thisn) return 1, if both @@ -170,7 +170,7 @@ class BOTAN_DLL BigInt bool is_nonzero() const { return (!is_zero()); } /** - * Test if the integer is zero. + * Test if the integer is zero * @result true if the integer is zero, false otherwise */ bool is_zero() const @@ -235,19 +235,20 @@ class BOTAN_DLL BigInt * Return the integer as an unsigned 32bit-integer-value. If the * value is negative OR to big to be stored in 32bits, this * function will throw an exception. - * @result a 32bit-integer + * + * @result unsigned 32 bit representation of this */ u32bit to_u32bit() const; /** - * Tests if the sign of the integer is negative. - * @result true, if the integer has a negative sign, + * Tests if the sign of the integer is negative + * @result true, if the integer has a negative sign */ bool is_negative() const { return (sign() == Negative); } /** - * Tests if the sign of the integer is positive. - * @result true, if the integer has a positive sign, + * Tests if the sign of the integer is positive + * @result true, if the integer has a positive sign */ bool is_positive() const { return (sign() == Positive); } @@ -306,13 +307,13 @@ class BOTAN_DLL BigInt u32bit bytes() const; /** - * Get the bit-length of the integer. + * Get the bit-length of the integer * @result bit-length of the represented integer value */ u32bit bits() const; /** - * Return a pointer to the big integer word register. + * Return a pointer to the big integer word register * @result a pointer to the start of the internal register of * the integer value */ @@ -363,7 +364,7 @@ class BOTAN_DLL BigInt /** * Read integer value from a byte array (MemoryRegion) - * @param buf the BigInt value to compare to this. + * @param buf the array to load from */ void binary_decode(const MemoryRegion& buf); @@ -428,7 +429,7 @@ class BOTAN_DLL BigInt static SecureVector encode_1363(const BigInt& n, u32bit bytes); /** - * Swap BigInt-value with given BigInt. + * Swap BigInt-value with given BigInt * @param bigint the BigInt to swap values with */ void swap(BigInt& bigint); @@ -451,13 +452,13 @@ class BOTAN_DLL BigInt BigInt(const BigInt& other); /** - * Create BigInt from a string. - * If the string starts with 0x the rest of the string will be - * interpreted as hexadecimal digits. - * If the string starts with 0 and the second character is NOT - * an 'x' the string will be interpreted as octal digits. - * If the string starts with non-zero digit, it will be - * interpreted as a decimal number. + * Create BigInt from a string. If the string starts with 0x the + * rest of the string will be interpreted as hexadecimal digits. + * If the string starts with 0 and the second character is NOT an + * 'x' the string will be interpreted as octal digits. If the + * string starts with non-zero digit, it will be interpreted as a + * decimal number. + * * @param str the string to parse for an integer value */ BigInt(const std::string& str); -- cgit v1.2.3 From 71b73656661270ed9204b4e12ce15709467d9247 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 16 Jun 2010 04:35:50 +0000 Subject: More Doxygen updates. Also, don't expose divide() in numthry.h anymore, only in divide.h --- src/math/bigint/bigint.h | 53 ++++++++++++++++++------------------ src/math/numbertheory/numthry.h | 60 ++++++++++++++++++++++++++++++++--------- 2 files changed, 75 insertions(+), 38 deletions(-) (limited to 'src/math/bigint') diff --git a/src/math/bigint/bigint.h b/src/math/bigint/bigint.h index 997814950..a3a079dcc 100644 --- a/src/math/bigint/bigint.h +++ b/src/math/bigint/bigint.h @@ -68,28 +68,28 @@ class BOTAN_DLL BigInt BigInt& operator/=(const BigInt& y); /** - * %= operator, modulo operator + * Modulo operator * @param y the modulus to reduce this by */ BigInt& operator%=(const BigInt& y); /** - * %= operator + * Modulo operator * @param y the modulus (word) to reduce this by */ word operator%=(word y); /** - * <<= operator - * @param y the number of bits to shift this left by + * Left shift operator + * @param shift the number of bits to shift this left by */ - BigInt& operator<<=(u32bit y); + BigInt& operator<<=(u32bit shift); /** - * >>= operator - * @param y the number of bits to shift this right by + * Right shift operator + * @param shift the number of bits to shift this right by */ - BigInt& operator>>=(u32bit y); + BigInt& operator>>=(u32bit shift); /** * Increment operator @@ -102,12 +102,12 @@ class BOTAN_DLL BigInt BigInt& operator--() { return (*this -= 1); } /** - * ++ operator (postfix) + * Postfix increment operator */ BigInt operator++(int) { BigInt x = (*this); ++(*this); return x; } /** - * -- operator (postfix) + * Postfix decrement operator */ BigInt operator--(int) { BigInt x = (*this); --(*this); return x; } @@ -233,7 +233,7 @@ class BOTAN_DLL BigInt /** * Return the integer as an unsigned 32bit-integer-value. If the - * value is negative OR to big to be stored in 32bits, this + * value is negative OR too big to be stored in a u32bit, this * function will throw an exception. * * @result unsigned 32 bit representation of this @@ -242,13 +242,13 @@ class BOTAN_DLL BigInt /** * Tests if the sign of the integer is negative - * @result true, if the integer has a negative sign + * @result true, iff the integer has a negative sign */ bool is_negative() const { return (sign() == Negative); } /** * Tests if the sign of the integer is positive - * @result true, if the integer has a positive sign + * @result true, iff the integer has a positive sign */ bool is_positive() const { return (sign() == Positive); } @@ -259,13 +259,12 @@ class BOTAN_DLL BigInt Sign sign() const { return (signedness); } /** - * Return the opposite sign of the represented integer value * @result the opposite sign of the represented integer value */ Sign reverse_sign() const; /** - * Flip (mutate) the sign of the integer to its opposite value + * Flip the sign of this BigInt */ void flip_sign(); @@ -287,7 +286,7 @@ class BOTAN_DLL BigInt u32bit size() const { return get_reg().size(); } /** - * Give significant words of the represented integer value + * Return how many words we need to hold this value * @result significant words of the represented integer value */ u32bit sig_words() const @@ -301,14 +300,14 @@ class BOTAN_DLL BigInt } /** - * Give byte-length of the integer - * @result byte-length of the represented integer value + * Give byte length of the integer + * @result byte length of the represented integer value */ u32bit bytes() const; /** - * Get the bit-length of the integer - * @result bit-length of the represented integer value + * Get the bit length of the integer + * @result bit length of the represented integer value */ u32bit bits() const; @@ -429,10 +428,10 @@ class BOTAN_DLL BigInt static SecureVector encode_1363(const BigInt& n, u32bit bytes); /** - * Swap BigInt-value with given BigInt - * @param bigint the BigInt to swap values with + * Swap this value with another + * @param other BigInt to swap values with */ - void swap(BigInt& bigint); + void swap(BigInt& other); /** * Create empty BigInt @@ -481,14 +480,16 @@ class BOTAN_DLL BigInt /** * Create BigInt of specified size, all zeros * @param sign the sign - * @param n integer value + * @param n size of the internal register in words */ BigInt(Sign sign, u32bit n); /** * Create a number of the specified type and size - * @param type the type of number to create - * @param n the size + * @param type the type of number to create. For Power2, + * will create the integer 2^n + * @param n a size/length parameter, interpretation depends upon + * the value of type */ BigInt(NumberType type, u32bit n); diff --git a/src/math/numbertheory/numthry.h b/src/math/numbertheory/numthry.h index 2d889a68a..146f158b6 100644 --- a/src/math/numbertheory/numthry.h +++ b/src/math/numbertheory/numthry.h @@ -14,8 +14,8 @@ namespace Botan { -/* -* Fused Arithmetic Operations +/** +* Fused Arithmetic Operation */ BigInt BOTAN_DLL mul_add(const BigInt&, const BigInt&, const BigInt&); BigInt BOTAN_DLL sub_mul(const BigInt&, const BigInt&, const BigInt&); @@ -25,27 +25,63 @@ BigInt BOTAN_DLL sub_mul(const BigInt&, const BigInt&, const BigInt&); */ inline BigInt abs(const BigInt& n) { return n.abs(); } -void BOTAN_DLL divide(const BigInt&, const BigInt&, BigInt&, BigInt&); - +/** +* Compute the greatest common divisor +* @param x a positive integer +* @param y a positive integer +* @return gcd(x,y) +*/ BigInt BOTAN_DLL gcd(const BigInt& x, const BigInt& y); + +/** +* Least common multiple +* @param x a positive integer +* @param y a positive integer +* @return z, smallest integer such that z % x == 0 and z % y == 0 +*/ BigInt BOTAN_DLL lcm(const BigInt& x, const BigInt& y); -BigInt BOTAN_DLL square(const BigInt&); -BigInt BOTAN_DLL inverse_mod(const BigInt&, const BigInt&); +/** +* @param x an integer +* @return (x*x) +*/ +BigInt BOTAN_DLL square(const BigInt& x); + +/** +* Modular inversion +* @param x a positive integer +* @param modulus a positive integer +* @return y st (x*y) % modulus == 1 +*/ +BigInt BOTAN_DLL inverse_mod(const BigInt& x, + const BigInt& modulus); + +/** +* Jacobi function +*/ s32bit BOTAN_DLL jacobi(const BigInt&, const BigInt&); +/** +* Modular exponentation +*/ BigInt BOTAN_DLL power_mod(const BigInt&, const BigInt&, const BigInt&); -/* -* Compute the square root of x modulo a prime -* using the Shanks-Tonnelli algorithm +/** +* Compute the square root of x modulo a prime using the +* Shanks-Tonnelli algorithm +* +* @param x the input +* @param p the prime +* @return y such that (y*y)%p == x, or -1 if no such integer */ BigInt BOTAN_DLL ressol(const BigInt& x, const BigInt& p); -/* -* Utility Functions +/** +* @param x an integer +* @return count of the zero bits in x, or, equivalently, the largest +* value of n such that 2^n divides x evently */ -u32bit BOTAN_DLL low_zero_bits(const BigInt&); +u32bit BOTAN_DLL low_zero_bits(const BigInt& x); /* * Primality Testing -- cgit v1.2.3 From 71557dc5873b2596c2e9551bb56b8e9bd9469849 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 16 Jun 2010 04:37:18 +0000 Subject: Doxygen for divide.h --- src/math/bigint/divide.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/math/bigint') diff --git a/src/math/bigint/divide.h b/src/math/bigint/divide.h index 9445b137b..36aed7854 100644 --- a/src/math/bigint/divide.h +++ b/src/math/bigint/divide.h @@ -12,7 +12,17 @@ namespace Botan { -void BOTAN_DLL divide(const BigInt&, const BigInt&, BigInt&, BigInt&); +/** +* BigInt Division +* @param x an integer +* @param y a non-zero integer +* @param q will be set to x / y +* @param r will be set to x % y +*/ +void BOTAN_DLL divide(const BigInt& x, + const BigInt& y, + BigInt& q, + BigInt& r); } -- cgit v1.2.3 From 3dde5683f69b9cb9f558bfb18087ce35fbbec78a Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 17 Jun 2010 06:29:23 +0000 Subject: Use mode(TI) operations to get access to MIPS 64-bit multiply. Required after GCC 4.4 --- src/math/bigint/mp_asm64/mp_asm.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/math/bigint') diff --git a/src/math/bigint/mp_asm64/mp_asm.h b/src/math/bigint/mp_asm64/mp_asm.h index c9159eaa7..b0906095d 100644 --- a/src/math/bigint/mp_asm64/mp_asm.h +++ b/src/math/bigint/mp_asm64/mp_asm.h @@ -47,7 +47,10 @@ namespace Botan { #elif defined(BOTAN_TARGET_ARCH_IS_MIPS64) #define BOTAN_WORD_MUL(a,b,z1,z0) do { \ - asm("dmultu %2,%3" : "=h" (z0), "=l" (z1) : "r" (a), "r" (b)); \ + typedef unsigned int uint128_t __attribute__((mode(TI))); \ + uint128_t r = (uint128_t)a * b; \ + z0 = (r >> 64) & 0xFFFFFFFFFFFFFFFF; \ + z1 = (r ) & 0xFFFFFFFFFFFFFFFF; \ } while(0); #else -- cgit v1.2.3