// Copyright 2019-2024 The Hush developers // Released under the GPLv3 #include "passwd.h" void PASSWD::show_hex_buff(unsigned char buf[]) { int i; for (uint8_t i=0; i < crypto_secretstream_xchacha20poly1305_KEYBYTES; i++) printf("%02X ", buf[i]); printf("\n"); } const unsigned char* PASSWD::key(QString password) { int length = password.length(); char *sequence = NULL; sequence = new char[length+1]; strncpy(sequence, password.toLocal8Bit(), length +1); #define MESSAGE ((const unsigned char *) sequence) #define MESSAGE_LEN length unsigned char hash[crypto_secretstream_xchacha20poly1305_KEYBYTES]; crypto_hash_sha256(hash, MESSAGE, MESSAGE_LEN); qDebug()<<"Generating SaltHash from password: " <