mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 12:00:56 +01:00
added c++ signature support
This commit is contained in:
@@ -52,6 +52,9 @@ string Crypto::encrypt(vector<unsigned char> message) {
|
||||
}
|
||||
|
||||
string Crypto::encrypt(unsigned char *message, size_t mlen) {
|
||||
if(S.is_encrypted())
|
||||
throw exception("Error: cannot encrypt with an encrypted secret key, decrypt it before using.");
|
||||
|
||||
size_t clen, zlen, rlen;
|
||||
unsigned char *cipher;
|
||||
|
||||
@@ -79,6 +82,9 @@ string Crypto::encrypt(unsigned char *message, size_t mlen) {
|
||||
}
|
||||
|
||||
ResultSet Crypto::decrypt(string cipher) {
|
||||
if(S.is_encrypted())
|
||||
throw exception("Error: cannot decrypt with an encrypted secret key, decrypt it before using.");
|
||||
|
||||
size_t clen;
|
||||
unsigned char *combined = pcp_z85_decode((char *)cipher.c_str(), &clen);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user