RNGs' get_bytes and allocate_bytes return boolean
This commit is contained in:
committed by
Martin Willi
parent
605985d122
commit
39e807728e
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user