mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
initialize crpto constants on demand
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user