summaryrefslogtreecommitdiff
path: root/gfpcrypt.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-04-11 04:47:03 -0400
committerJeffrey Walton <noloader@gmail.com>2021-04-11 04:47:03 -0400
commit6c7b91d5e2ddb24491581e4b0642ece05d41e2bc (patch)
treeaa722fb84c18db49cd6f156faba131a4e4cf8b62 /gfpcrypt.h
parente2784078d9f637d44b2a7f1929750b4fa1fb815b (diff)
downloadcryptopp-git-6c7b91d5e2ddb24491581e4b0642ece05d41e2bc.tar.gz
Update documentation
Diffstat (limited to 'gfpcrypt.h')
-rw-r--r--gfpcrypt.h116
1 files changed, 58 insertions, 58 deletions
diff --git a/gfpcrypt.h b/gfpcrypt.h
index 448642b6..f8555bbb 100644
--- a/gfpcrypt.h
+++ b/gfpcrypt.h
@@ -47,8 +47,8 @@ public:
/// \param rng a RandomNumberGenerator derived class
/// \param pbits the size of p, in bits
/// \details This function overload of Initialize() creates a new private key because it
- /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
- /// then use one of the other Initialize() overloads.
+ /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ /// then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, unsigned int pbits)
{GenerateRandom(rng, MakeParameters("ModulusSize", (int)pbits));}
@@ -85,9 +85,9 @@ public:
/// \return true if the value was retrieved, false otherwise
/// \details GetVoidValue() retrieves the value of name if it exists.
/// \note GetVoidValue() is an internal function and should be implemented
- /// by derived classes. Users should use one of the other functions instead.
+ /// by derived classes. Users should use one of the other functions instead.
/// \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
- /// GetRequiredParameter() and GetRequiredIntParameter()
+ /// GetRequiredParameter() and GetRequiredIntParameter()
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const;
/// \brief Initialize or reinitialize this key
@@ -254,9 +254,9 @@ public:
/// \return true if the value was retrieved, false otherwise
/// \details GetVoidValue() retrieves the value of name if it exists.
/// \note GetVoidValue() is an internal function and should be implemented
- /// by derived classes. Users should use one of the other functions instead.
+ /// by derived classes. Users should use one of the other functions instead.
/// \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
- /// GetRequiredParameter() and GetRequiredIntParameter()
+ /// GetRequiredParameter() and GetRequiredIntParameter()
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
{
return GetValueHelper<DL_GroupParameters_IntegerBased>(this, name, valueType, pValue).Assignable();
@@ -319,7 +319,7 @@ public:
/// \tparam T FieldElement type or class
/// \tparam H HashTransformation derived class
/// \sa <a href="http://tools.ietf.org/rfc/rfc6979.txt">RFC 6979, Deterministic Usage of the
-/// Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)</a>
+/// Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)</a>
/// \since Crypto++ 6.0
template <class T, class H>
class DL_Algorithm_DSA_RFC6979 : public DL_Algorithm_GDSA<T>, public DeterministicSignatureAlgorithm
@@ -475,10 +475,10 @@ private:
/// \brief German Digital Signature Algorithm
/// \tparam T FieldElement type or class
/// \details The Digital Signature Scheme ECGDSA does not define the algorithm over integers. Rather, the
-/// signature algorithm is only defined over elliptic curves. However, The library design is such that the
-/// generic algorithm reside in <tt>gfpcrypt.h</tt>.
+/// signature algorithm is only defined over elliptic curves. However, The library design is such that the
+/// generic algorithm reside in <tt>gfpcrypt.h</tt>.
/// \sa Erwin Hess, Marcus Schafheutle, and Pascale Serf <A HREF="http://www.teletrust.de/fileadmin/files/oid/ecgdsa_final.pdf">
-/// The Digital Signature Scheme ECGDSA (October 24, 2006)</A>
+/// The Digital Signature Scheme ECGDSA (October 24, 2006)</A>
template <class T>
class DL_Algorithm_GDSA_ISO15946 : public DL_ElgamalLikeSignatureAlgorithm<T>
{
@@ -596,8 +596,8 @@ public:
/// \param rng a RandomNumberGenerator derived class
/// \param modulusBits the size of the modulus, in bits
/// \details This function overload of Initialize() creates a new private key because it
- /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
- /// then use one of the other Initialize() overloads.
+ /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ /// then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits)
{this->GenerateRandomWithKeySize(rng, modulusBits);}
@@ -606,8 +606,8 @@ public:
/// \param p the modulus
/// \param g the generator
/// \details This function overload of Initialize() creates a new private key because it
- /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
- /// then use one of the other Initialize() overloads.
+ /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ /// then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, const Integer &p, const Integer &g)
{this->GenerateRandom(rng, MakeParameters("Modulus", p)("SubgroupGenerator", g));}
@@ -617,8 +617,8 @@ public:
/// \param q the subgroup order
/// \param g the generator
/// \details This function overload of Initialize() creates a new private key because it
- /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
- /// then use one of the other Initialize() overloads.
+ /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ /// then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, const Integer &p, const Integer &q, const Integer &g)
{this->GenerateRandom(rng, MakeParameters("Modulus", p)("SubgroupOrder", q)("SubgroupGenerator", g));}
@@ -705,12 +705,12 @@ public:
/// \details ValidateGroup() also checks that the lengths of p and q are allowed
/// by the DSA standard.
/// \details There are four levels of thoroughness:
- /// <ul>
- /// <li>0 - using this object won't cause a crash or exception
- /// <li>1 - this object will probably function, and encrypt, sign, other operations correctly
- /// <li>2 - ensure this object will function correctly, and perform reasonable security checks
- /// <li>3 - perform reasonable security checks, and do checks that may take a long time
- /// </ul>
+ /// <ul>
+ /// <li>0 - using this object won't cause a crash or exception
+ /// <li>1 - this object will probably function, and encrypt, sign, other operations correctly
+ /// <li>2 - ensure this object will function correctly, and perform reasonable security checks
+ /// <li>3 - perform reasonable security checks, and do checks that may take a long time
+ /// </ul>
/// \details Level 0 does not require a RandomNumberGenerator. A NullRNG() can be used for level 0.
/// Level 1 may not check for weak keys and such. Levels 2 and 3 are recommended.
bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const;
@@ -723,11 +723,11 @@ public:
/// <tt>DSA::MAX_PRIME_LENGTH</tt>, and divisible by <tt>DSA::PRIME_LENGTH_MULTIPLE</tt>.
/// \details An example of changing the modulus size using NameValuePairs is shown below.
/// <pre>
- /// AlgorithmParameters params = MakeParameters
- /// (Name::ModulusSize(), 2048);
+ /// AlgorithmParameters params = MakeParameters
+ /// (Name::ModulusSize(), 2048);
///
- /// DL_GroupParameters_DSA groupParams;
- /// groupParams.GenerateRandom(prng, params);
+ /// DL_GroupParameters_DSA groupParams;
+ /// groupParams.GenerateRandom(prng, params);
/// </pre>
/// \throw KeyingErr if a key can't be generated or algorithm parameters are invalid.
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg);
@@ -764,25 +764,25 @@ struct DL_Keys_DSA
/// \brief DSA signature scheme
/// \tparam H HashTransformation derived class
/// \details The class is named DSA2 instead of DSA for backwards compatibility because
-/// DSA was a non-template class.
+/// DSA was a non-template class.
/// \details DSA default method GenerateRandom uses a 2048-bit modulus and a 224-bit subgoup by default.
-/// The modulus can be changed using the following code:
+/// The modulus can be changed using the following code:
/// <pre>
-/// DSA::PrivateKey privateKey;
-/// privateKey.GenerateRandomWithKeySize(prng, 2048);
+/// DSA::PrivateKey privateKey;
+/// privateKey.GenerateRandomWithKeySize(prng, 2048);
/// </pre>
/// \details The subgroup order can be changed using the following code:
/// <pre>
-/// AlgorithmParameters params = MakeParameters
-/// (Name::ModulusSize(), 2048)
-/// (Name::SubgroupOrderSize(), 256);
+/// AlgorithmParameters params = MakeParameters
+/// (Name::ModulusSize(), 2048)
+/// (Name::SubgroupOrderSize(), 256);
///
-/// DSA::PrivateKey privateKey;
-/// privateKey.GenerateRandom(prng, params);
+/// DSA::PrivateKey privateKey;
+/// privateKey.GenerateRandom(prng, params);
/// </pre>
/// \sa <a href="http://en.wikipedia.org/wiki/Digital_Signature_Algorithm">DSA</a>, as specified in FIPS 186-3,
-/// <a href="https://www.cryptopp.com/wiki/Digital_Signature_Algorithm">Digital Signature Algorithm</a> on the wiki, and
-/// <a href="https://www.cryptopp.com/wiki/NameValuePairs">NameValuePairs</a> on the wiki.
+/// <a href="https://www.cryptopp.com/wiki/Digital_Signature_Algorithm">Digital Signature Algorithm</a> on the wiki, and
+/// <a href="https://www.cryptopp.com/wiki/NameValuePairs">NameValuePairs</a> on the wiki.
/// \since Crypto++ 1.0 for DSA, Crypto++ 5.6.2 for DSA2, Crypto++ 6.1 for 2048-bit modulus.
template <class H>
class DSA2 : public DL_SS<
@@ -823,12 +823,12 @@ CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest<D
/// \tparam DHAES_MODE flag indicating DHAES mode
/// \tparam LABEL_OCTETS flag indicating the label is octet count
/// \details DL_EncryptionAlgorithm_Xor is based on an early P1363 draft, which itself appears to be based on an
-/// early Certicom SEC-1 draft (or an early SEC-1 draft was based on a P1363 draft). Crypto++ 4.2 used it in its Integrated
-/// Ecryption Schemes with <tt>NoCofactorMultiplication</tt>, <tt>DHAES_MODE=false</tt> and <tt>LABEL_OCTETS=true</tt>.
+/// early Certicom SEC-1 draft (or an early SEC-1 draft was based on a P1363 draft). Crypto++ 4.2 used it in its Integrated
+/// Ecryption Schemes with <tt>NoCofactorMultiplication</tt>, <tt>DHAES_MODE=false</tt> and <tt>LABEL_OCTETS=true</tt>.
/// \details If you need this method for Crypto++ 4.2 compatibility, then use the ECIES template class with
-/// <tt>NoCofactorMultiplication</tt>, <tt>DHAES_MODE=false</tt> and <tt>LABEL_OCTETS=true</tt>.
+/// <tt>NoCofactorMultiplication</tt>, <tt>DHAES_MODE=false</tt> and <tt>LABEL_OCTETS=true</tt>.
/// \details If you need this method for Bouncy Castle 1.54 and Botan 1.11 compatibility, then use the ECIES template class with
-/// <tt>NoCofactorMultiplication</tt>, <tt>DHAES_MODE=ture</tt> and <tt>LABEL_OCTETS=false</tt>.
+/// <tt>NoCofactorMultiplication</tt>, <tt>DHAES_MODE=ture</tt> and <tt>LABEL_OCTETS=false</tt>.
/// \details Bouncy Castle 1.54 and Botan 1.11 compatibility are the default template parameters.
/// \since Crypto++ 4.0
template <class MAC, bool DHAES_MODE, bool LABEL_OCTETS=false>
@@ -952,32 +952,32 @@ public:
/// \tparam DHAES_MODE flag indicating if the MAC includes addition context parameters such as the label
/// \tparam LABEL_OCTETS flag indicating if the label size is specified in octets or bits
/// \details DLIES is an Integer based Integrated Encryption Scheme (IES). The scheme combines a Key Encapsulation Method (KEM)
-/// with a Data Encapsulation Method (DEM) and a MAC tag. The scheme is
-/// <A HREF="http://en.wikipedia.org/wiki/ciphertext_indistinguishability">IND-CCA2</A>, which is a strong notion of security.
-/// You should prefer an Integrated Encryption Scheme over homegrown schemes.
+/// with a Data Encapsulation Method (DEM) and a MAC tag. The scheme is
+/// <A HREF="http://en.wikipedia.org/wiki/ciphertext_indistinguishability">IND-CCA2</A>, which is a strong notion of security.
+/// You should prefer an Integrated Encryption Scheme over homegrown schemes.
/// \details The library's original implementation is based on an early P1363 draft, which itself appears to be based on an early Certicom
-/// SEC-1 draft (or an early SEC-1 draft was based on a P1363 draft). Crypto++ 4.2 used the early draft in its Integrated Ecryption
-/// Schemes with <tt>NoCofactorMultiplication</tt>, <tt>DHAES_MODE=false</tt> and <tt>LABEL_OCTETS=true</tt>.
+/// SEC-1 draft (or an early SEC-1 draft was based on a P1363 draft). Crypto++ 4.2 used the early draft in its Integrated Ecryption
+/// Schemes with <tt>NoCofactorMultiplication</tt>, <tt>DHAES_MODE=false</tt> and <tt>LABEL_OCTETS=true</tt>.
/// \details If you desire an Integrated Encryption Scheme with Crypto++ 4.2 compatibility, then use the DLIES template class with
-/// <tt>NoCofactorMultiplication</tt>, <tt>DHAES_MODE=false</tt> and <tt>LABEL_OCTETS=true</tt>.
+/// <tt>NoCofactorMultiplication</tt>, <tt>DHAES_MODE=false</tt> and <tt>LABEL_OCTETS=true</tt>.
/// \details If you desire an Integrated Encryption Scheme with Bouncy Castle 1.54 and Botan 1.11 compatibility, then use the DLIES
-/// template class with <tt>NoCofactorMultiplication</tt>, <tt>DHAES_MODE=true</tt> and <tt>LABEL_OCTETS=false</tt>.
+/// template class with <tt>NoCofactorMultiplication</tt>, <tt>DHAES_MODE=true</tt> and <tt>LABEL_OCTETS=false</tt>.
/// \details The default template parameters ensure compatibility with Bouncy Castle 1.54 and Botan 1.11. The combination of
-/// <tt>IncompatibleCofactorMultiplication</tt> and <tt>DHAES_MODE=true</tt> is recommended for best efficiency and security.
-/// SHA1 is used for compatibility reasons, but it can be changed if desired. SHA-256 or another hash will likely improve the
-/// security provided by the MAC. The hash is also used in the key derivation function as a PRF.
+/// <tt>IncompatibleCofactorMultiplication</tt> and <tt>DHAES_MODE=true</tt> is recommended for best efficiency and security.
+/// SHA1 is used for compatibility reasons, but it can be changed if desired. SHA-256 or another hash will likely improve the
+/// security provided by the MAC. The hash is also used in the key derivation function as a PRF.
/// \details Below is an example of constructing a Crypto++ 4.2 compatible DLIES encryptor and decryptor.
/// <pre>
-/// AutoSeededRandomPool prng;
-/// DL_PrivateKey_GFP<DL_GroupParameters_GFP> key;
-/// key.Initialize(prng, 2048);
+/// AutoSeededRandomPool prng;
+/// DL_PrivateKey_GFP<DL_GroupParameters_GFP> key;
+/// key.Initialize(prng, 2048);
///
-/// DLIES<SHA1,NoCofactorMultiplication,true,true>::Decryptor decryptor(key);
-/// DLIES<SHA1,NoCofactorMultiplication,true,true>::Encryptor encryptor(decryptor);
+/// DLIES<SHA1,NoCofactorMultiplication,true,true>::Decryptor decryptor(key);
+/// DLIES<SHA1,NoCofactorMultiplication,true,true>::Encryptor encryptor(decryptor);
/// </pre>
/// \sa ECIES, <a href="http://www.weidai.com/scan-mirror/ca.html#DLIES">Discrete Log Integrated Encryption Scheme (DLIES)</a>,
-/// Martínez, Encinas, and Ávila's <A HREF="http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf">A Survey of the Elliptic
-/// Curve Integrated Encryption Schemes</A>
+/// Martínez, Encinas, and Ávila's <A HREF="http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf">A Survey of the Elliptic
+/// Curve Integrated Encryption Schemes</A>
/// \since Crypto++ 4.0, Crypto++ 5.7 for Bouncy Castle and Botan compatibility
template <class HASH = SHA1, class COFACTOR_OPTION = NoCofactorMultiplication, bool DHAES_MODE = true, bool LABEL_OCTETS=false>
struct DLIES