RNGs' get_bytes and allocate_bytes return boolean

This commit is contained in:
Tobias Brunner
2012-07-16 14:53:34 +02:00
committed by Martin Willi
parent 605985d122
commit 39e807728e
6 changed files with 39 additions and 21 deletions
+7 -2
View File
@@ -1,4 +1,5 @@
/*
* Copyright (C) 2012 Tobias Brunner
* Copyright (C) 2008 Martin Willi
* Hochschule fuer Technik Rapperswil
*
@@ -53,16 +54,20 @@ struct rng_t {
*
* @param len number of bytes to get
* @param buffer pointer where the generated bytes will be written
* @return TRUE if bytes successfully written
*/
void (*get_bytes) (rng_t *this, size_t len, u_int8_t *buffer);
__attribute__((warn_unused_result))
bool (*get_bytes) (rng_t *this, size_t len, u_int8_t *buffer);
/**
* Generates random bytes and allocate space for them.
*
* @param len number of bytes to get
* @param chunk chunk which will hold generated bytes
* @return TRUE if allocation succeeded
*/
void (*allocate_bytes) (rng_t *this, size_t len, chunk_t *chunk);
__attribute__((warn_unused_result))
bool (*allocate_bytes) (rng_t *this, size_t len, chunk_t *chunk);
/**
* Destroys a rng object.