api fixes, PIStreamPacker potential fixes
This commit is contained in:
@@ -55,6 +55,32 @@ PIEthUtilBase::~PIEthUtilBase() {
|
||||
}
|
||||
|
||||
|
||||
void PIEthUtilBase::setCryptEnabled(bool on) {
|
||||
_crypt = on;
|
||||
}
|
||||
|
||||
|
||||
void PIEthUtilBase::cryptEnable() {
|
||||
setCryptEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
void PIEthUtilBase::cryptDisable() {
|
||||
setCryptEnabled(false);
|
||||
}
|
||||
|
||||
|
||||
bool PIEthUtilBase::isCryptEnabled() const {
|
||||
return _crypt;
|
||||
}
|
||||
|
||||
|
||||
void PIEthUtilBase::setCryptKey(const PIByteArray & k) {
|
||||
_key = k;
|
||||
setCryptEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
void PIEthUtilBase::createCryptKey(const PIString & k) {
|
||||
#ifdef PIP_CRYPT
|
||||
_key = PICrypt::hash("sodium_bug");
|
||||
@@ -66,6 +92,11 @@ void PIEthUtilBase::createCryptKey(const PIString & k) {
|
||||
}
|
||||
|
||||
|
||||
PIByteArray PIEthUtilBase::cryptKey() const {
|
||||
return _key;
|
||||
}
|
||||
|
||||
|
||||
PIByteArray PIEthUtilBase::cryptData(const PIByteArray & data) {
|
||||
if (!_crypt) return data;
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user