Crypto++
5.6.4
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
35 OID GetAlgorithmID()
const;
41 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
50 const Integer & GetModulus()
const {
return m_n;}
51 const Integer & GetPublicExponent()
const {
return m_e;}
53 void SetModulus(
const Integer &n) {m_n = n;}
54 void SetPublicExponent(
const Integer &e) {m_e = e;}
83 {m_n = n; m_e = e; m_d = d; m_p = p; m_q = q; m_dp = dp; m_dq = dq; m_u = u;}
111 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
115 const Integer& GetPrime1()
const {
return m_p;}
116 const Integer& GetPrime2()
const {
return m_q;}
117 const Integer& GetPrivateExponent()
const {
return m_d;}
118 const Integer& GetModPrime1PrivateExponent()
const {
return m_dp;}
119 const Integer& GetModPrime2PrivateExponent()
const {
return m_dq;}
120 const Integer& GetMultiplicativeInverseOfPrime2ModPrime1()
const {
return m_u;}
122 void SetPrime1(
const Integer &p) {m_p = p;}
123 void SetPrime2(
const Integer &q) {m_q = q;}
124 void SetPrivateExponent(
const Integer &d) {m_d = d;}
125 void SetModPrime1PrivateExponent(
const Integer &dp) {m_dp = dp;}
126 void SetModPrime2PrivateExponent(
const Integer &dq) {m_dq = dq;}
127 void SetMultiplicativeInverseOfPrime2ModPrime1(
const Integer &u) {m_u = u;}
130 Integer m_d, m_p, m_q, m_dp, m_dq, m_u;
155 CRYPTOPP_CONSTEXPR
static const char * CRYPTOPP_API StaticAlgorithmName() {
return "RSA";}
164 template <
class STANDARD>
175 template <
class STANDARD,
class H>
184 CRYPTOPP_CONSTEXPR
static const char * CRYPTOPP_API StaticAlgorithmName() {
return "RSA-ISO";}
211 #ifdef CRYPTOPP_DOXYGEN_PROCESSING
246 #endif // CRYPTOPP_DOXYGEN_PROCESSING
void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
void DEREncode(BufferedTransformation &bt) const
Encode this object into a BufferedTransformation.
RSAES<PKCS1v15>::Decryptor typedef
Applies the trapdoor function.
void Load(BufferedTransformation &bt)
Loads a key from a BufferedTransformation.
RSA trapdoor function using the public key.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
Classes and functions for various padding schemes used in public key algorithms.
This file contains helper classes/functions for implementing public key algorithms.
RSAES<PKCS1v15>::Encryptor typedef
virtual void DEREncodePrivateKey(BufferedTransformation &bt) const =0
encode privateKey part of privateKeyInfo, without the OCTET STRING header
Interface for random number generators.
Encodes and decodesprivateKeyInfo.
virtual Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const =0
Calculates the inverse of an element.
virtual bool Validate(RandomNumberGenerator &rng, unsigned int level) const =0
Check this object for errors.
Encodes and decodes subjectPublicKeyInfo.
RSASS<PKCS1v15, Weak::MD5>::Signer typedef
RSASS<PKCS1v15,SHA>::Signer typedef
RSASS<PKCS1v15,SHA>::Verifier typedef
RSAES<OAEP<SHA>>::Decryptor typedef
Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const
Calculates the inverse of an element.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
virtual bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const =0
Get a named value.
virtual void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size)=0
decode privateKey part of privateKeyInfo, without the OCTET STRING header
Applies the inverse of the trapdoor function.
RSA trapdoor function using the private key.
RSAES<OAEP<SHA>>::Encryptor typedef
Classes and functions for working with ANS.1 objects.
void BERDecode(BufferedTransformation &bt)
Decode this object from a BufferedTransformation.
RSASS<PKCS1v15, Weak::MD5>::Verifier typedef
void BERDecode(BufferedTransformation &bt)
Decode this object from a BufferedTransformation.
EME-OAEP, for use with classes derived from TF_ES
void DEREncode(BufferedTransformation &bt) const
Encode this object into a BufferedTransformation.
RSA trapdoor function using the public key.
RSASS<PKCS1v15, Weak::MD2>::Signer typedef
virtual void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms=g_nullNameValuePairs)
Generate a random key or crypto parameters.
virtual void AssignFrom(const NameValuePairs &source)=0
Assign values to this object.
Integer ImageBound() const
Returns the maximum size of a message after the trapdoor function is applied.
RSASS<PKCS1v15, Weak::MD2>::Verifier typedef
Crypto++ library namespace.
void Initialize(const Integer &n, const Integer &e, const Integer &d, const Integer &p, const Integer &q, const Integer &dp, const Integer &dq, const Integer &u)
Initialize a RSA private key with {n,e,d,p,q,dp,dq,u}.
Trapdoor Function (TF) Signature Scheme.
void Initialize(const Integer &n, const Integer &e)
Initialize a RSA public key with {n,e}.
OID GetAlgorithmID() const
Retrieves the OID of the algorithm.
Trapdoor Function (TF) encryption scheme.
Integer ApplyFunction(const Integer &x) const
Applies the trapdoor.
Namespace containing weak and wounded algorithms.
Template implementing constructors for public key algorithm classes.
RSA encryption algorithm.
Interface for retrieving values given their names.
Abstract base classes that provide a uniform interface to this library.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
Multiple precision integer with arithmetic operations.
Multiple precision integer with arithmetic operations.
OID GetAlgorithmID() const
Retrieves the OID of the algorithm.
RSA trapdoor function using the private key.