mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
replace tunnel encryption to AES-NI
This commit is contained in:
parent
2cdd3c3c26
commit
cc302847a8
3 changed files with 29 additions and 36 deletions
13
Tunnel.h
13
Tunnel.h
|
@ -8,8 +8,6 @@
|
|||
#include <string>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <cryptopp/modes.h>
|
||||
#include <cryptopp/aes.h>
|
||||
#include "Queue.h"
|
||||
#include "TunnelConfig.h"
|
||||
#include "TunnelPool.h"
|
||||
|
@ -51,20 +49,11 @@ namespace tunnel
|
|||
uint32_t GetNextTunnelID () const { return m_Config->GetFirstHop ()->tunnelID; };
|
||||
const i2p::data::IdentHash& GetNextIdentHash () const { return m_Config->GetFirstHop ()->router->GetIdentHash (); };
|
||||
|
||||
private:
|
||||
|
||||
void LayerDecrypt (const uint8_t * in, size_t len, const uint8_t * layerKey,
|
||||
const uint8_t * iv, uint8_t * out);
|
||||
void IVDecrypt (const uint8_t * in, const uint8_t * ivKey, uint8_t * out);
|
||||
|
||||
private:
|
||||
|
||||
TunnelConfig * m_Config;
|
||||
TunnelPool * m_Pool; // pool, tunnel belongs to, or null
|
||||
bool m_IsEstablished, m_IsFailed;
|
||||
|
||||
CryptoPP::ECB_Mode<CryptoPP::AES>::Decryption m_ECBDecryption;
|
||||
CryptoPP::CBC_Mode<CryptoPP::AES>::Decryption m_CBCDecryption;
|
||||
bool m_IsEstablished, m_IsFailed;
|
||||
};
|
||||
|
||||
class OutboundTunnel: public Tunnel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue