Add PICrypt
git-svn-id: svn://db.shs.com.ru/pip@96 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
34
src/math/picrypt.h
Normal file
34
src/math/picrypt.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef PICRYPT_H
|
||||
#define PICRYPT_H
|
||||
|
||||
#include "pistring.h"
|
||||
|
||||
class PICrypt {
|
||||
public:
|
||||
PICrypt();
|
||||
|
||||
bool setKey(const PIByteArray &secret);
|
||||
PIByteArray setKey(const PIString &secret);
|
||||
|
||||
PIByteArray getKey();
|
||||
|
||||
PIByteArray crypt(const PIByteArray &data);
|
||||
|
||||
PIByteArray decrypt(const PIByteArray &crypt_data, bool * ok = 0);
|
||||
|
||||
static PIByteArray crypt(const PIByteArray &data, const PIByteArray &secret);
|
||||
|
||||
static PIByteArray decrypt(const PIByteArray &crypt_data, const PIByteArray &secret, bool * ok = 0);
|
||||
|
||||
static PIByteArray hash(const PIString &secret);
|
||||
|
||||
static int sizeKey();
|
||||
|
||||
static int sizeCrypt();
|
||||
|
||||
private:
|
||||
PIByteArray nonce;
|
||||
PIByteArray key;
|
||||
};
|
||||
|
||||
#endif // PICRYPT_H
|
||||
Reference in New Issue
Block a user