fix picrypt and remove crypt_frag from PIStreamPacker

This commit is contained in:
2024-10-20 18:03:25 +03:00
parent ac8efc9f88
commit 315966504e
5 changed files with 25 additions and 71 deletions

View File

@@ -80,7 +80,7 @@ public:
//! \~\brief
//! \~english Generate hash from keyphrase "secret", may be used as a key for encryption
//! \~russian Генерировать хэш из ключевой фразы "secret", может использоваться в качестве ключа для шифрования
static PIByteArray hash(const PIString & secret);
static PIByteArray hash(PIString secret);
//! \~\brief
//! \~english Generate hash from bytearray
@@ -172,7 +172,7 @@ public:
//! \~\brief
//! \~english Generate password hash from "password"
//! \~russian Генерировать хэш пароля из "password"
static PIByteArray passwordHash(const PIString & password, const PIByteArray & seed);
static PIByteArray passwordHash(PIString password, const PIByteArray & seed);
//! \~\brief
//! \~english Returns libsodium version

View File

@@ -38,9 +38,8 @@ class PIStreamPackerConfig: public PIEthUtilBase {
public:
PIStreamPackerConfig() {
crypt_frag = crypt_size = false;
crypt_size = false;
aggressive_optimization = true;
crypt_frag_size = 1 * 1024 * 1024;
max_packet_size = 1400;
packet_sign = 0xAFBE;
}
@@ -65,10 +64,6 @@ public:
//! Returns aggressive optimization
bool aggressiveOptimization() const { return aggressive_optimization; }
bool cryptFragmentationEnabled() const { return crypt_frag; }
void setCryptFragmentationEnabled(bool on) { crypt_frag = on; }
int cryptFragmentationSize() const { return crypt_frag_size; }
void setCryptFragmentationSize(int size_) { crypt_frag_size = size_; }
bool cryptSizeEnabled() const { return crypt_size; }
void setCryptSizeEnabled(bool on) { crypt_size = on; }
@@ -80,8 +75,7 @@ public:
void setConfiguration(const PIStreamPackerConfig & config) { *this = config; }
private:
bool crypt_frag, crypt_size, aggressive_optimization;
int crypt_frag_size;
bool crypt_size, aggressive_optimization;
ushort packet_sign;
int max_packet_size;
};

View File

@@ -40,7 +40,6 @@ class PIStringList;
//! \~russian Класс строки.
class PIP_EXPORT PIString {
BINARY_STREAM_FRIEND(PIString);
friend class PICrypt;
public:
typedef PIDeque<PIChar>::iterator iterator;