initialize crpto constants on demand

This commit is contained in:
orignal 2014-09-21 18:17:16 -04:00
parent 5e179c166b
commit c4c614bc3d
3 changed files with 33 additions and 13 deletions

View file

@ -7,15 +7,28 @@ namespace i2p
{
namespace crypto
{
// DH
extern const CryptoPP::Integer elgp;
extern const CryptoPP::Integer elgg;
struct CryptoConstants
{
// DH/ElGamal
const CryptoPP::Integer elgp;
const CryptoPP::Integer elgg;
// DSA
const CryptoPP::Integer dsap;
const CryptoPP::Integer dsaq;
const CryptoPP::Integer dsag;
};
const CryptoConstants& GetCryptoConstants ();
// DH/ElGamal
#define elgp GetCryptoConstants ().elgp
#define elgg GetCryptoConstants ().elgg
// DSA
extern const CryptoPP::Integer dsap;
extern const CryptoPP::Integer dsaq;
extern const CryptoPP::Integer dsag;
#define dsap GetCryptoConstants ().dsap
#define dsaq GetCryptoConstants ().dsaq
#define dsag GetCryptoConstants ().dsag
}
}