use common context for ElGamal encrypt/decrypt

This commit is contained in:
orignal 2017-03-11 16:48:54 -05:00
parent 4bb607f180
commit c0c157ecef
7 changed files with 27 additions and 19 deletions

View file

@ -153,11 +153,12 @@ namespace garlic
{
public:
GarlicDestination (): m_NumTags (32) {}; // 32 tags by default
GarlicDestination ();
~GarlicDestination ();
void CleanUp ();
void SetNumTags (int numTags) { m_NumTags = numTags; };
void SetNumTags (int numTags) { m_NumTags = numTags; };
BN_CTX * GetBNContext () const { return m_Ctx; };
std::shared_ptr<GarlicRoutingSession> GetRoutingSession (std::shared_ptr<const i2p::data::RoutingDestination> destination, bool attachLeaseSet);
void CleanupExpiredTags ();
void RemoveDeliveryStatusSession (uint32_t msgID);
@ -188,7 +189,8 @@ namespace garlic
void HandleGarlicPayload (uint8_t * buf, size_t len, std::shared_ptr<i2p::tunnel::InboundTunnel> from);
private:
BN_CTX * m_Ctx;
// outgoing sessions
int m_NumTags;
std::mutex m_SessionsMutex;