From 146e568fe70fc289f65cc0e8d399f9d86e13bf70 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 16 Nov 2005 16:10:47 +0000 Subject: - added methods which will allocate mem --- Source/charon/utils/randomizer.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'Source/charon/utils/randomizer.h') diff --git a/Source/charon/utils/randomizer.h b/Source/charon/utils/randomizer.h index ae2bb539c..cf6870aa5 100644 --- a/Source/charon/utils/randomizer.h +++ b/Source/charon/utils/randomizer.h @@ -47,6 +47,19 @@ struct randomizer_s { */ status_t (*get_random_bytes) (randomizer_t *this,size_t bytes, u_int8_t *buffer); + /** + * @brief Allocates space and writes in random bytes + * + * @param this calling randomizer_t object + * @param bytes Number of bytes to allocate + * @param[out] chunk chunk which will hold the allocated random bytes + * @return + * - SUCCESS + * - OUT_OF_RES + * - FAILED + */ + status_t (*allocate_random_bytes) (randomizer_t *this, size_t bytes, chunk_t *chunk); + /** * @brief Reads a specific number of bytes from pseudo random device. * @@ -59,7 +72,19 @@ struct randomizer_s { * - FAILED */ status_t (*get_pseudo_random_bytes) (randomizer_t *this,size_t bytes, u_int8_t *buffer); - + + /** + * @brief Allocates space and writes in pseudo random bytes + * + * @param this calling randomizer_t object + * @param bytes Number of bytes to allocate + * @param[out] chunk chunk which will hold the allocated random bytes + * @return + * - SUCCESS + * - OUT_OF_RES + * - FAILED + */ + status_t (*allocate_pseudo_random_bytes) (randomizer_t *this, size_t bytes, chunk_t *chunk); /** * @brief Destroys a randomizer_t object. -- cgit v1.2.3