blackberry release

git-svn-id: svn://db.shs.com.ru/pip@134 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-05-21 06:24:21 +00:00
parent 0ab3bb388f
commit e6dde535b9
4 changed files with 30 additions and 18 deletions

View File

@@ -136,18 +136,15 @@ PIByteArray PICrypt::decrypt(const PIByteArray & crypt_data, PIByteArray key, bo
return ret;
}
#include <QDebug>
PIByteArray PICrypt::hash(const PIString & secret) {
PIByteArray hash;
qDebug() << "hash start";
#ifdef PIP_CRYPT
sodium_init();
qDebug() << "sodium_init ok";
hash.resize(crypto_generichash_BYTES);
PIByteArray s(secret.data(), secret.size());
crypto_generichash(hash.data(), hash.size(), s.data(), s.size(), (const uchar*)hash_def_key, sizeof(hash_def_key) - 1);
#endif
qDebug() << "hash end";
return hash;
}