aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/alloc/alloc_mmap/mmap_mem.h5
-rw-r--r--src/alloc/mem_pool/mem_pool.h5
-rw-r--r--src/alloc/secmem.h9
-rw-r--r--src/alloc/system_alloc/defalloc.h5
-rw-r--r--src/pk_pad/emsa1/emsa1.h3
-rw-r--r--src/pk_pad/emsa1_bsi/emsa1_bsi.h3
-rw-r--r--src/pk_pad/emsa2/emsa2.h3
-rw-r--r--src/pk_pad/emsa3/emsa3.cpp22
-rw-r--r--src/pk_pad/emsa3/emsa3.h5
-rw-r--r--src/pk_pad/emsa4/emsa4.h12
10 files changed, 55 insertions, 17 deletions
diff --git a/src/alloc/alloc_mmap/mmap_mem.h b/src/alloc/alloc_mmap/mmap_mem.h
index be1d06cff..521d85ea9 100644
--- a/src/alloc/alloc_mmap/mmap_mem.h
+++ b/src/alloc/alloc_mmap/mmap_mem.h
@@ -21,7 +21,10 @@ namespace Botan {
class MemoryMapping_Allocator : public Pooling_Allocator
{
public:
- MemoryMapping_Allocator(Mutex* m) : Pooling_Allocator(m) {}
+ /**
+ * @param mutex used for internal locking
+ */
+ MemoryMapping_Allocator(Mutex* mutex) : Pooling_Allocator(mutex) {}
std::string type() const { return "mmap"; }
private:
void* alloc_block(u32bit);
diff --git a/src/alloc/mem_pool/mem_pool.h b/src/alloc/mem_pool/mem_pool.h
index 69555544e..a67e641e2 100644
--- a/src/alloc/mem_pool/mem_pool.h
+++ b/src/alloc/mem_pool/mem_pool.h
@@ -27,7 +27,10 @@ class Pooling_Allocator : public Allocator
void destroy();
- Pooling_Allocator(Mutex*);
+ /**
+ * @param mutex used for internal locking
+ */
+ Pooling_Allocator(Mutex* mutex);
~Pooling_Allocator();
private:
void get_more_core(u32bit);
diff --git a/src/alloc/secmem.h b/src/alloc/secmem.h
index 39b5549a9..bc5a2499d 100644
--- a/src/alloc/secmem.h
+++ b/src/alloc/secmem.h
@@ -195,6 +195,11 @@ class MemoryRegion
~MemoryRegion() { deallocate(buf, allocated); }
protected:
MemoryRegion() { buf = 0; alloc = 0; used = allocated = 0; }
+
+ /**
+ * Copy constructor
+ * @param other the other region to copy
+ */
MemoryRegion(const MemoryRegion<T>& other)
{
buf = 0;
@@ -203,6 +208,10 @@ class MemoryRegion
set(other.buf, other.used);
}
+ /**
+ * @param locking should we use a locking allocator
+ * @param length the initial length to use
+ */
void init(bool locking, u32bit length = 0)
{ alloc = Allocator::get(locking); resize(length); }
private:
diff --git a/src/alloc/system_alloc/defalloc.h b/src/alloc/system_alloc/defalloc.h
index 27ee3cd8f..dcf552b8b 100644
--- a/src/alloc/system_alloc/defalloc.h
+++ b/src/alloc/system_alloc/defalloc.h
@@ -30,7 +30,10 @@ class Malloc_Allocator : public Allocator
class Locking_Allocator : public Pooling_Allocator
{
public:
- Locking_Allocator(Mutex* m) : Pooling_Allocator(m) {}
+ /**
+ * @param mutex used for internal locking
+ */
+ Locking_Allocator(Mutex* mutex) : Pooling_Allocator(mutex) {}
std::string type() const { return "locking"; }
private:
diff --git a/src/pk_pad/emsa1/emsa1.h b/src/pk_pad/emsa1/emsa1.h
index e95414ad3..50fda5273 100644
--- a/src/pk_pad/emsa1/emsa1.h
+++ b/src/pk_pad/emsa1/emsa1.h
@@ -20,6 +20,9 @@ namespace Botan {
class BOTAN_DLL EMSA1 : public EMSA
{
public:
+ /**
+ * @param h the hash object to use
+ */
EMSA1(HashFunction* h) : hash(h) {}
~EMSA1() { delete hash; }
protected:
diff --git a/src/pk_pad/emsa1_bsi/emsa1_bsi.h b/src/pk_pad/emsa1_bsi/emsa1_bsi.h
index ec86d40e2..a0a3515fb 100644
--- a/src/pk_pad/emsa1_bsi/emsa1_bsi.h
+++ b/src/pk_pad/emsa1_bsi/emsa1_bsi.h
@@ -21,6 +21,9 @@ implementation comes from InSiTo
class BOTAN_DLL EMSA1_BSI : public EMSA1
{
public:
+ /**
+ * @param hash the hash object to use
+ */
EMSA1_BSI(HashFunction* hash) : EMSA1(hash) {}
private:
SecureVector<byte> encoding_of(const MemoryRegion<byte>&, u32bit,
diff --git a/src/pk_pad/emsa2/emsa2.h b/src/pk_pad/emsa2/emsa2.h
index bda34fbd1..cfb3f9e12 100644
--- a/src/pk_pad/emsa2/emsa2.h
+++ b/src/pk_pad/emsa2/emsa2.h
@@ -20,6 +20,9 @@ namespace Botan {
class BOTAN_DLL EMSA2 : public EMSA
{
public:
+ /**
+ * @param hash the hash object to use
+ */
EMSA2(HashFunction* hash);
~EMSA2() { delete hash; }
private:
diff --git a/src/pk_pad/emsa3/emsa3.cpp b/src/pk_pad/emsa3/emsa3.cpp
index dc905a464..82981d38c 100644
--- a/src/pk_pad/emsa3/emsa3.cpp
+++ b/src/pk_pad/emsa3/emsa3.cpp
@@ -12,7 +12,7 @@ namespace Botan {
namespace {
-/**
+/*
* EMSA3 Encode Operation
*/
SecureVector<byte> emsa3_encoding(const MemoryRegion<byte>& msg,
@@ -37,7 +37,7 @@ SecureVector<byte> emsa3_encoding(const MemoryRegion<byte>& msg,
}
-/**
+/*
* EMSA3 Update Operation
*/
void EMSA3::update(const byte input[], u32bit length)
@@ -45,7 +45,7 @@ void EMSA3::update(const byte input[], u32bit length)
hash->update(input, length);
}
-/**
+/*
* Return the raw (unencoded) data
*/
SecureVector<byte> EMSA3::raw_data()
@@ -53,7 +53,7 @@ SecureVector<byte> EMSA3::raw_data()
return hash->final();
}
-/**
+/*
* EMSA3 Encode Operation
*/
SecureVector<byte> EMSA3::encoding_of(const MemoryRegion<byte>& msg,
@@ -67,7 +67,7 @@ SecureVector<byte> EMSA3::encoding_of(const MemoryRegion<byte>& msg,
hash_id, hash_id.size());
}
-/**
+/*
* Default signature decoding
*/
bool EMSA3::verify(const MemoryRegion<byte>& coded,
@@ -88,7 +88,7 @@ bool EMSA3::verify(const MemoryRegion<byte>& coded,
}
}
-/**
+/*
* EMSA3 Constructor
*/
EMSA3::EMSA3(HashFunction* hash_in) : hash(hash_in)
@@ -96,7 +96,7 @@ EMSA3::EMSA3(HashFunction* hash_in) : hash(hash_in)
hash_id = pkcs_hash_id(hash->name());
}
-/**
+/*
* EMSA3 Destructor
*/
EMSA3::~EMSA3()
@@ -104,7 +104,7 @@ EMSA3::~EMSA3()
delete hash;
}
-/**
+/*
* EMSA3_Raw Update Operation
*/
void EMSA3_Raw::update(const byte input[], u32bit length)
@@ -112,7 +112,7 @@ void EMSA3_Raw::update(const byte input[], u32bit length)
message.append(input, length);
}
-/**
+/*
* Return the raw (unencoded) data
*/
SecureVector<byte> EMSA3_Raw::raw_data()
@@ -122,7 +122,7 @@ SecureVector<byte> EMSA3_Raw::raw_data()
return ret;
}
-/**
+/*
* EMSA3_Raw Encode Operation
*/
SecureVector<byte> EMSA3_Raw::encoding_of(const MemoryRegion<byte>& msg,
@@ -132,7 +132,7 @@ SecureVector<byte> EMSA3_Raw::encoding_of(const MemoryRegion<byte>& msg,
return emsa3_encoding(msg, output_bits, 0, 0);
}
-/**
+/*
* Default signature decoding
*/
bool EMSA3_Raw::verify(const MemoryRegion<byte>& coded,
diff --git a/src/pk_pad/emsa3/emsa3.h b/src/pk_pad/emsa3/emsa3.h
index 1e080aab6..09c1e40cc 100644
--- a/src/pk_pad/emsa3/emsa3.h
+++ b/src/pk_pad/emsa3/emsa3.h
@@ -21,7 +21,10 @@ namespace Botan {
class BOTAN_DLL EMSA3 : public EMSA
{
public:
- EMSA3(HashFunction*);
+ /**
+ * @param hash the hash object to use
+ */
+ EMSA3(HashFunction* hash);
~EMSA3();
void update(const byte[], u32bit);
diff --git a/src/pk_pad/emsa4/emsa4.h b/src/pk_pad/emsa4/emsa4.h
index 6315c424e..7dfc3892a 100644
--- a/src/pk_pad/emsa4/emsa4.h
+++ b/src/pk_pad/emsa4/emsa4.h
@@ -20,8 +20,16 @@ namespace Botan {
class BOTAN_DLL EMSA4 : public EMSA
{
public:
- EMSA4(HashFunction*);
- EMSA4(HashFunction*, u32bit);
+ /**
+ * @param hash the hash object to use
+ */
+ EMSA4(HashFunction* hash);
+
+ /**
+ * @param hash the hash object to use
+ * @param salt_size the size of the salt to use in bytes
+ */
+ EMSA4(HashFunction* hash, u32bit salt_size);
~EMSA4() { delete hash; delete mgf; }
private: