Bugfixes part 3 #209
@@ -20,6 +20,7 @@
|
||||
#include "picrypt.h"
|
||||
|
||||
#include "pitranslator.h"
|
||||
|
||||
#include <sodium.h>
|
||||
|
||||
|
||||
@@ -53,7 +54,7 @@ bool PICrypt::setKey(const PIByteArray & _key) {
|
||||
}
|
||||
|
||||
|
||||
bool PICrypt::setKey(const PIString & secret) {;
|
||||
bool PICrypt::setKey(const PIString & secret) {
|
||||
key_ = hash(secret);
|
||||
return key_.isNotEmpty();
|
||||
}
|
||||
@@ -262,7 +263,6 @@ PIByteArray PICrypt::signMessage(const PIByteArray & data, const PIByteArray & s
|
||||
bool PICrypt::verifySign(const PIByteArray & data, const PIByteArray & signature, const PIByteArray & public_key) {
|
||||
if (!init()) return false;
|
||||
return (crypto_sign_verify_detached(signature.data(), data.data(), data.size(), public_key.data()) == 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user