preserving unicode and newlines

This commit is contained in:
miodragpop
2020-06-15 20:28:39 +02:00
parent 0f30c49c4a
commit 5aa1bb1701
2 changed files with 11 additions and 4 deletions

View File

@@ -479,10 +479,17 @@ Tx MainWindow::createTxFromChatPage() {
}
// Let's try to preserve Unicode characters
QByteArray ba_memo = memoplain.toUtf8();
int ba_memo_length = ba_memo.size();
#define MESSAGE (const unsigned char *) ba_memo.data()
#define MESSAGE_LEN ba_memo_length
////////////Now lets encrypt the message Alice send to Bob//////////////////////////////
#define MESSAGE (const unsigned char *) memoplainchar
#define MESSAGE_LEN lengthmemo
//#define MESSAGE (const unsigned char *) memoplainchar
//#define MESSAGE_LEN lengthmemo
#define CIPHERTEXT_LEN (crypto_secretstream_xchacha20poly1305_ABYTES + MESSAGE_LEN)
unsigned char ciphertext[CIPHERTEXT_LEN];
unsigned char header[crypto_secretstream_xchacha20poly1305_HEADERBYTES];