diff options
82 files changed, 289 insertions, 202 deletions
diff --git a/src/algo_factory/algo_cache.h b/src/algo_factory/algo_cache.h index c9fbf5b26..13df8e752 100644 --- a/src/algo_factory/algo_cache.h +++ b/src/algo_factory/algo_cache.h @@ -50,6 +50,10 @@ class Algorithm_Cache */ std::vector<std::string> providers_of(const std::string& algo_name); + /** + * Constructor + * @param m a mutex to serialize internal access + */ Algorithm_Cache(Mutex* m) : mutex(m) {} ~Algorithm_Cache(); private: 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<typename T> @@ -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<MessageAuthenticationCode>(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<std::string>(); } -/** +/* * 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/algo_factory/algo_factory.h b/src/algo_factory/algo_factory.h index e8a4914b5..3284942ad 100644 --- a/src/algo_factory/algo_factory.h +++ b/src/algo_factory/algo_factory.h @@ -155,8 +155,9 @@ class BOTAN_DLL Algorithm_Factory void add_mac(MessageAuthenticationCode* algo, const std::string& provider); - /* - * Deprecated + /** + * An iterator for the engines in this factory + * @deprecated */ class BOTAN_DLL Engine_Iterator { diff --git a/src/alloc/alloc_mmap/mmap_mem.h b/src/alloc/alloc_mmap/mmap_mem.h index da3dda31d..be1d06cff 100644 --- a/src/alloc/alloc_mmap/mmap_mem.h +++ b/src/alloc/alloc_mmap/mmap_mem.h @@ -12,8 +12,11 @@ namespace Botan { -/* -* Memory Mapping Allocator +/** +* Allocator that uses memory maps backed by disk. We zeroize the map +* upon deallocation. If swap occurs, the VM will swap to the shared +* file backing rather than to a swap device, which means we know where +* it is and can zap it later. */ class MemoryMapping_Allocator : public Pooling_Allocator { diff --git a/src/alloc/allocate.h b/src/alloc/allocate.h index 180f2c021..819e2542c 100644 --- a/src/alloc/allocate.h +++ b/src/alloc/allocate.h @@ -13,7 +13,7 @@ namespace Botan { -/* +/** * Allocator Interface */ class BOTAN_DLL Allocator diff --git a/src/alloc/mem_pool/mem_pool.h b/src/alloc/mem_pool/mem_pool.h index 9735a547d..69555544e 100644 --- a/src/alloc/mem_pool/mem_pool.h +++ b/src/alloc/mem_pool/mem_pool.h @@ -16,7 +16,7 @@ namespace Botan { -/* +/** * Pooling Allocator */ class Pooling_Allocator : public Allocator 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<T>& operator=(const MemoryRegion<T>& 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<T>& other) { append(other.begin(), other.size()); } diff --git a/src/alloc/system_alloc/defalloc.h b/src/alloc/system_alloc/defalloc.h index 0c8804223..27ee3cd8f 100644 --- a/src/alloc/system_alloc/defalloc.h +++ b/src/alloc/system_alloc/defalloc.h @@ -12,8 +12,8 @@ namespace Botan { -/* -* Malloc Allocator +/** +* Allocator using malloc */ class Malloc_Allocator : public Allocator { @@ -24,8 +24,8 @@ class Malloc_Allocator : public Allocator std::string type() const { return "malloc"; } }; -/* -* Locking Allocator +/** +* Allocator using malloc plus locking */ class Locking_Allocator : public Pooling_Allocator { diff --git a/src/asn1/alg_id.h b/src/asn1/alg_id.h index 4a1ad2f30..417a71b30 100644 --- a/src/asn1/alg_id.h +++ b/src/asn1/alg_id.h @@ -14,7 +14,7 @@ namespace Botan { -/* +/** * Algorithm Identifier */ class BOTAN_DLL AlgorithmIdentifier : public ASN1_Object diff --git a/src/asn1/asn1_int.h b/src/asn1/asn1_int.h index e6fb09398..3562f692b 100644 --- a/src/asn1/asn1_int.h +++ b/src/asn1/asn1_int.h @@ -13,7 +13,7 @@ namespace Botan { -/* +/** * ASN.1 Type and Class Tags */ enum ASN1_Tag { @@ -50,7 +50,7 @@ enum ASN1_Tag { DIRECTORY_STRING = 0xFF01 }; -/* +/** * Basic ASN.1 Object Interface */ class BOTAN_DLL ASN1_Object @@ -61,7 +61,7 @@ class BOTAN_DLL ASN1_Object virtual ~ASN1_Object() {} }; -/* +/** * BER Encoded Object */ class BOTAN_DLL BER_Object @@ -86,7 +86,7 @@ bool maybe_BER(DataSource&); } -/* +/** * General BER Decoding Error Exception */ struct BOTAN_DLL BER_Decoding_Error : public Decoding_Error @@ -94,7 +94,7 @@ struct BOTAN_DLL BER_Decoding_Error : public Decoding_Error BER_Decoding_Error(const std::string&); }; -/* +/** * Exception For Incorrect BER Taggings */ struct BOTAN_DLL BER_Bad_Tag : public BER_Decoding_Error diff --git a/src/asn1/asn1_obj.h b/src/asn1/asn1_obj.h index ea21c475f..6800166e6 100644 --- a/src/asn1/asn1_obj.h +++ b/src/asn1/asn1_obj.h @@ -17,7 +17,7 @@ namespace Botan { -/* +/** * Attribute */ class BOTAN_DLL Attribute : public ASN1_Object @@ -34,7 +34,7 @@ class BOTAN_DLL Attribute : public ASN1_Object Attribute(const std::string&, const MemoryRegion<byte>&); }; -/* +/** * X.509 Time */ class BOTAN_DLL X509_Time : public ASN1_Object @@ -61,7 +61,7 @@ class BOTAN_DLL X509_Time : public ASN1_Object ASN1_Tag tag; }; -/* +/** * Simple String */ class BOTAN_DLL ASN1_String : public ASN1_Object @@ -82,7 +82,7 @@ class BOTAN_DLL ASN1_String : public ASN1_Object ASN1_Tag tag; }; -/* +/** * Distinguished Name */ class BOTAN_DLL X509_DN : public ASN1_Object @@ -112,7 +112,7 @@ class BOTAN_DLL X509_DN : public ASN1_Object MemoryVector<byte> dn_bits; }; -/* +/** * Alternative Name */ class BOTAN_DLL AlternativeName : public ASN1_Object diff --git a/src/asn1/ber_dec.h b/src/asn1/ber_dec.h index 3658aeba4..52e309aec 100644 --- a/src/asn1/ber_dec.h +++ b/src/asn1/ber_dec.h @@ -13,7 +13,7 @@ namespace Botan { -/* +/** * BER Decoding Object */ class BOTAN_DLL BER_Decoder diff --git a/src/asn1/der_enc.h b/src/asn1/der_enc.h index 23b5297e5..ae10b4bc8 100644 --- a/src/asn1/der_enc.h +++ b/src/asn1/der_enc.h @@ -13,7 +13,10 @@ namespace Botan { -/* +class BigInt; +class ASN1_Object; + +/** * General DER Encoding Object */ class BOTAN_DLL DER_Encoder @@ -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<byte>&, 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<byte>&, 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/block/blowfish/blowfish.h b/src/block/blowfish/blowfish.h index 2306f0e37..a178ec488 100644 --- a/src/block/blowfish/blowfish.h +++ b/src/block/blowfish/blowfish.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * Blowfish */ class BOTAN_DLL Blowfish : public BlockCipher diff --git a/src/block/cascade/cascade.h b/src/block/cascade/cascade.h index 98c64fb3e..263a9e8a1 100644 --- a/src/block/cascade/cascade.h +++ b/src/block/cascade/cascade.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * Block Cipher Cascade */ class BOTAN_DLL Cascade_Cipher : public BlockCipher diff --git a/src/block/cast/cast128.h b/src/block/cast/cast128.h index 048d2e43c..967e91938 100644 --- a/src/block/cast/cast128.h +++ b/src/block/cast/cast128.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * CAST-128 */ class BOTAN_DLL CAST_128 : public BlockCipher diff --git a/src/block/cast/cast256.h b/src/block/cast/cast256.h index 170d94e77..c4a305671 100644 --- a/src/block/cast/cast256.h +++ b/src/block/cast/cast256.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * CAST-256 */ class BOTAN_DLL CAST_256 : public BlockCipher diff --git a/src/block/des/des.h b/src/block/des/des.h index 32dd3daf6..1ae806850 100644 --- a/src/block/des/des.h +++ b/src/block/des/des.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * DES */ class BOTAN_DLL DES : public BlockCipher @@ -32,7 +32,7 @@ class BOTAN_DLL DES : public BlockCipher SecureVector<u32bit, 32> round_key; }; -/* +/** * Triple DES */ class BOTAN_DLL TripleDES : public BlockCipher diff --git a/src/block/des/desx.h b/src/block/des/desx.h index 440574e9d..45a9d8479 100644 --- a/src/block/des/desx.h +++ b/src/block/des/desx.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * DESX */ class BOTAN_DLL DESX : public BlockCipher diff --git a/src/block/idea/idea.h b/src/block/idea/idea.h index 1a9644d4e..be1417a36 100644 --- a/src/block/idea/idea.h +++ b/src/block/idea/idea.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * IDEA */ class BOTAN_DLL IDEA : public BlockCipher diff --git a/src/block/idea_sse2/idea_sse2.h b/src/block/idea_sse2/idea_sse2.h index 585de7264..b00e0f400 100644 --- a/src/block/idea_sse2/idea_sse2.h +++ b/src/block/idea_sse2/idea_sse2.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * IDEA in SSE2 */ class BOTAN_DLL IDEA_SSE2 : public IDEA diff --git a/src/block/kasumi/kasumi.h b/src/block/kasumi/kasumi.h index 827989a57..fda348ef3 100644 --- a/src/block/kasumi/kasumi.h +++ b/src/block/kasumi/kasumi.h @@ -12,8 +12,8 @@ namespace Botan { -/* -* KASUMI +/** +* KASUMI, the block cipher used in 3G telephony */ class BOTAN_DLL KASUMI : public BlockCipher { diff --git a/src/block/lion/lion.h b/src/block/lion/lion.h index f24acdb72..07556399b 100644 --- a/src/block/lion/lion.h +++ b/src/block/lion/lion.h @@ -14,8 +14,13 @@ namespace Botan { -/* -* Lion +/** +* Lion is a block cipher construction designed by Ross Anderson and +* Eli Biham, described in "Two Practical and Provably Secure Block +* Ciphers: BEAR and LION". It has a variable block size and is +* designed to encrypt very large blocks (up to a megabyte) + +* http://www.cl.cam.ac.uk/~rja14/Papers/bear-lion.pdf */ class BOTAN_DLL Lion : public BlockCipher { diff --git a/src/block/lubyrack/lubyrack.h b/src/block/lubyrack/lubyrack.h index 7249cf157..29b7ee5a4 100644 --- a/src/block/lubyrack/lubyrack.h +++ b/src/block/lubyrack/lubyrack.h @@ -13,8 +13,8 @@ namespace Botan { -/* -* Luby-Rackoff +/** +* Luby-Rackoff block cipher construction */ class BOTAN_DLL LubyRackoff : public BlockCipher { diff --git a/src/block/mars/mars.h b/src/block/mars/mars.h index f2a6d0197..f455ec5ca 100644 --- a/src/block/mars/mars.h +++ b/src/block/mars/mars.h @@ -12,6 +12,9 @@ namespace Botan { +/** +* MARS, IBM's candidate for AES +*/ class BOTAN_DLL MARS : public BlockCipher { public: diff --git a/src/block/noekeon/noekeon.h b/src/block/noekeon/noekeon.h index abeecbc64..5b04a135d 100644 --- a/src/block/noekeon/noekeon.h +++ b/src/block/noekeon/noekeon.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * Noekeon */ class BOTAN_DLL Noekeon : public BlockCipher diff --git a/src/block/noekeon_simd/noekeon_simd.h b/src/block/noekeon_simd/noekeon_simd.h index aba1e3d65..507f17e21 100644 --- a/src/block/noekeon_simd/noekeon_simd.h +++ b/src/block/noekeon_simd/noekeon_simd.h @@ -12,8 +12,8 @@ namespace Botan { -/* -* Noekeon +/** +* Noekeon implementation using SIMD operations */ class BOTAN_DLL Noekeon_SIMD : public Noekeon { diff --git a/src/block/rc2/rc2.h b/src/block/rc2/rc2.h index dd0295572..d4ecac462 100644 --- a/src/block/rc2/rc2.h +++ b/src/block/rc2/rc2.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * RC2 */ class BOTAN_DLL RC2 : public BlockCipher diff --git a/src/block/rc5/rc5.h b/src/block/rc5/rc5.h index 82931c1d2..5135336b1 100644 --- a/src/block/rc5/rc5.h +++ b/src/block/rc5/rc5.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * RC5 */ class BOTAN_DLL RC5 : public BlockCipher diff --git a/src/block/rc6/rc6.h b/src/block/rc6/rc6.h index cc1534ee2..9b2d587fa 100644 --- a/src/block/rc6/rc6.h +++ b/src/block/rc6/rc6.h @@ -12,8 +12,8 @@ namespace Botan { -/* -* RC6 +/** +* RC6, Ron Rivest's AES candidate */ class BOTAN_DLL RC6 : public BlockCipher { diff --git a/src/block/safer/safer_sk.h b/src/block/safer/safer_sk.h index 80d2dc069..3386102e4 100644 --- a/src/block/safer/safer_sk.h +++ b/src/block/safer/safer_sk.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * SAFER-SK */ class BOTAN_DLL SAFER_SK : public BlockCipher diff --git a/src/block/seed/seed.h b/src/block/seed/seed.h index e56b77dbb..0c80199ad 100644 --- a/src/block/seed/seed.h +++ b/src/block/seed/seed.h @@ -12,8 +12,8 @@ namespace Botan { -/* -* SEED +/** +* SEED, a Korean block cipher */ class BOTAN_DLL SEED : public BlockCipher { diff --git a/src/block/serpent/serpent.h b/src/block/serpent/serpent.h index 37ce10c7b..2bbe2f71f 100644 --- a/src/block/serpent/serpent.h +++ b/src/block/serpent/serpent.h @@ -12,8 +12,8 @@ namespace Botan { -/* -* Serpent +/** +* Serpent, an AES finalist */ class BOTAN_DLL Serpent : public BlockCipher { diff --git a/src/block/serpent_ia32/serp_ia32.h b/src/block/serpent_ia32/serp_ia32.h index dc6beaf13..229a2042b 100644 --- a/src/block/serpent_ia32/serp_ia32.h +++ b/src/block/serpent_ia32/serp_ia32.h @@ -12,8 +12,8 @@ namespace Botan { -/* -* Serpent +/** +* Serpent implementation in x86 assembly */ class BOTAN_DLL Serpent_IA32 : public Serpent { diff --git a/src/block/serpent_simd/serp_simd.h b/src/block/serpent_simd/serp_simd.h index 54bfa1dd7..f0a11fc93 100644 --- a/src/block/serpent_simd/serp_simd.h +++ b/src/block/serpent_simd/serp_simd.h @@ -12,8 +12,8 @@ namespace Botan { -/* -* Serpent +/** +* Serpent implementation using SIMD */ class BOTAN_DLL Serpent_SIMD : public Serpent { diff --git a/src/block/skipjack/skipjack.h b/src/block/skipjack/skipjack.h index d481aee08..29978efc7 100644 --- a/src/block/skipjack/skipjack.h +++ b/src/block/skipjack/skipjack.h @@ -12,8 +12,8 @@ namespace Botan { -/* -* Skipjack +/** +* Skipjack, a NSA designed cipher used in Fortezza */ class BOTAN_DLL Skipjack : public BlockCipher { diff --git a/src/block/square/square.h b/src/block/square/square.h index 8e1f7f815..a17771f11 100644 --- a/src/block/square/square.h +++ b/src/block/square/square.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * Square */ class BOTAN_DLL Square : public BlockCipher diff --git a/src/block/tea/tea.h b/src/block/tea/tea.h index 152c9a905..128f42080 100644 --- a/src/block/tea/tea.h +++ b/src/block/tea/tea.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * TEA */ class BOTAN_DLL TEA : public BlockCipher diff --git a/src/block/twofish/twofish.h b/src/block/twofish/twofish.h index 7600abca8..3191dc963 100644 --- a/src/block/twofish/twofish.h +++ b/src/block/twofish/twofish.h @@ -12,8 +12,8 @@ namespace Botan { -/* -* Twofish +/** +* Twofish, an AES finalist */ class BOTAN_DLL Twofish : public BlockCipher { diff --git a/src/block/xtea/xtea.h b/src/block/xtea/xtea.h index 940992dfa..b16cdf555 100644 --- a/src/block/xtea/xtea.h +++ b/src/block/xtea/xtea.h @@ -12,7 +12,7 @@ namespace Botan { -/* +/** * XTEA */ class BOTAN_DLL XTEA : public BlockCipher diff --git a/src/block/xtea_simd/xtea_simd.h b/src/block/xtea_simd/xtea_simd.h index e114bf63a..87eeb433b 100644 --- a/src/block/xtea_simd/xtea_simd.h +++ b/src/block/xtea_simd/xtea_simd.h @@ -12,8 +12,8 @@ namespace Botan { -/* -* XTEA (SIMD variant) +/** +* XTEA implemented using SIMD operations */ class BOTAN_DLL XTEA_SIMD : public XTEA { 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<EAC1_1_ADO> * 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<byte> 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<byte>& 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<Derived> // 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<byte> 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/filter.h b/src/filters/filter.h index b840a69da..4773fe159 100644 --- a/src/filters/filter.h +++ b/src/filters/filter.h @@ -47,8 +47,20 @@ class BOTAN_DLL Filter virtual ~Filter() {} protected: - void send(const byte[], u32bit); - void send(byte input) { send(&input, 1); } + /** + * @param in some input for the filter + * @param length the length of in + */ + void send(const byte in[], u32bit length); + + /** + * @param in some input for the filter + */ + void send(byte in) { send(&input, 1); } + + /** + * @param in some input for the filter + */ void send(const MemoryRegion<byte>& in) { send(in.begin(), in.size()); } Filter(); private: @@ -76,8 +88,17 @@ class BOTAN_DLL Filter u32bit owns() const { return filter_owns; } - void attach(Filter*); - void set_next(Filter*[], u32bit); + /** + * Attach another filter to this one + * @param f filter to attach + */ + void attach(Filter* f); + + /** + * @param filters the filters to set + * @param count number of items in filters + */ + void set_next(Filter* filters[], u32bit count); Filter* get_next() const; SecureVector<byte> write_queue; @@ -94,10 +115,15 @@ class BOTAN_DLL Filter class BOTAN_DLL Fanout_Filter : public Filter { protected: + /** + * Increment the number of filters past us that we own + */ void incr_owns() { ++filter_owns; } void set_port(u32bit n) { Filter::set_port(n); } + void set_next(Filter* f[], u32bit n) { Filter::set_next(f, n); } + void attach(Filter* f) { Filter::attach(f); } }; 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<byte> 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/hash/has160/has160.h b/src/hash/has160/has160.h index 210145484..a82e4c579 100644 --- a/src/hash/has160/has160.h +++ b/src/hash/has160/has160.h @@ -12,8 +12,9 @@ namespace Botan { -/* -* HAS-160 +/** +* HAS-160, a Korean hash function standardized in +* TTAS.KO-12.0011/R1. Used in conjuction with KCDSA */ class BOTAN_DLL HAS_160 : public MDx_HashFunction { 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/hmac/hmac.h b/src/mac/hmac/hmac.h index 62bb69853..43a5d22a4 100644 --- a/src/mac/hmac/hmac.h +++ b/src/mac/hmac/hmac.h @@ -13,7 +13,7 @@ namespace Botan { -/* +/** * HMAC */ class BOTAN_DLL HMAC : public MessageAuthenticationCode @@ -23,6 +23,9 @@ class BOTAN_DLL HMAC : public MessageAuthenticationCode std::string name() const; MessageAuthenticationCode* clone() const; + /** + * @param hash the hash to use for HMACing + */ HMAC(HashFunction* hash); ~HMAC() { delete hash; } private: 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<byte>& 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<byte>& 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<byte> 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<byte>& 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); } |