2014-10-10 13:50:55 +04:00
|
|
|
// Part of ZBackup. Licensed under GNU GPLv2 or later + OpenSSL, see LICENSE
|
2013-07-18 21:33:25 +04:00
|
|
|
|
|
|
|
#ifndef RANDOM_HH_INCLUDED__
|
|
|
|
#define RANDOM_HH_INCLUDED__
|
|
|
|
|
|
|
|
#include <exception>
|
|
|
|
|
|
|
|
#include "ex.hh"
|
|
|
|
|
|
|
|
namespace Random {
|
|
|
|
DEF_EX( exCantGenerate, "Error generating random sequence, try later", std::exception )
|
|
|
|
|
|
|
|
/// This one fills the buffer with true randomness, suitable for a key
|
|
|
|
void genarateTrue( void * buf, unsigned size );
|
|
|
|
/// This one fills the buffer with pseudo randomness, suitable for salts but not
|
|
|
|
/// keys
|
|
|
|
void genaratePseudo( void * buf, unsigned size );
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|