133 #ifndef OPENTXS_CORE_CRYPTO_OTPASSWORD_HPP
134 #define OPENTXS_CORE_CRYPTO_OTPASSWORD_HPP
162 #define OT_PW_DISPLAY "Enter master passphrase for wallet."
164 #define OTPASSWORD_BLOCKSIZE 128 // (128 bytes max length for a password.)
165 #define OTPASSWORD_MEMSIZE 129 // +1 for null terminator.
170 #define OT_LARGE_BLOCKSIZE 32767 // (32767 bytes max length for a password.)
171 #define OT_LARGE_MEMSIZE 32768 // +1 for null terminator.
174 #define OT_DEFAULT_BLOCKSIZE 128
175 #define OT_DEFAULT_MEMSIZE 129
213 EXPORT
OTPassword(
const char* input, uint32_t size,
216 EXPORT
OTPassword(
const uint8_t* input, uint32_t size,
219 EXPORT
OTPassword(
const void* input, uint32_t size,
232 EXPORT int32_t
setPassword(
const char* input, int32_t size);
235 EXPORT
bool addChar(uint8_t c);
245 EXPORT int32_t
setMemory(
const void* input, uint32_t size);
248 EXPORT int32_t
addMemory(
const void* append, uint32_t size);
258 EXPORT
static void zeroMemory(uint8_t* szMemory, uint32_t size);
259 EXPORT
static void zeroMemory(
void* vMemory, uint32_t size);
260 EXPORT
static void*
safe_memcpy(
void* dest, uint32_t dsize,
const void* src,
261 uint32_t ssize,
bool zeroSource =
false);
284 EXPORT
bool SetSize(uint32_t size);
297 #endif // OPENTXS_CORE_CRYPTO_OTPASSWORD_HPP
EXPORT const uint8_t * getMemory_uint8() const
EXPORT uint32_t getMemorySize() const
EXPORT OTPassword(BlockSize blockSize=DEFAULT_SIZE)
static EXPORT bool randomizePassword_uint8(uint8_t *destination, uint32_t size)
EXPORT uint8_t * getPasswordWritable()
EXPORT int32_t addMemory(const void *append, uint32_t size)
#define OT_LARGE_BLOCKSIZE
EXPORT bool isPassword() const
EXPORT char * getPasswordWritable_char()
EXPORT const void * getMemory() const
EXPORT int32_t setMemory(const void *input, uint32_t size)
EXPORT int32_t setPassword(const char *input, int32_t size)
EXPORT bool addChar(uint8_t c)
static EXPORT bool randomizeMemory_uint8(uint8_t *destination, uint32_t size)
EXPORT OTPassword & operator=(const OTPassword &rhs)
EXPORT int32_t randomizeMemory(uint32_t size=DEFAULT_SIZE)
#define OT_DEFAULT_BLOCKSIZE
EXPORT bool SetSize(uint32_t size)
static EXPORT OTPassword * CreateTextBuffer()
EXPORT uint32_t getPasswordSize() const
EXPORT const char * getPassword() const
EXPORT const uint8_t * getPassword_uint8() const
EXPORT bool isMemory() const
EXPORT void * getMemoryWritable()
EXPORT int32_t randomizePassword(uint32_t size=DEFAULT_SIZE)
EXPORT int32_t setPassword_uint8(const uint8_t *input, uint32_t size)
EXPORT uint32_t getBlockSize() const
EXPORT bool Compare(OTPassword &rhs) const
static EXPORT void * safe_memcpy(void *dest, uint32_t dsize, const void *src, uint32_t ssize, bool zeroSource=false)
#define OT_DEFAULT_MEMSIZE