aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/utils/randomizer.h
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2005-11-16 16:10:47 +0000
committerMartin Willi <martin@strongswan.org>2005-11-16 16:10:47 +0000
commit146e568fe70fc289f65cc0e8d399f9d86e13bf70 (patch)
tree94fd51fee25be8f2709158d6a85c7700b9be1d9c /Source/charon/utils/randomizer.h
parenta698ba19a4679367ed97e5c671c526e4b273aaff (diff)
downloadstrongswan-146e568fe70fc289f65cc0e8d399f9d86e13bf70.tar.bz2
strongswan-146e568fe70fc289f65cc0e8d399f9d86e13bf70.tar.xz
- added methods which will allocate mem
Diffstat (limited to 'Source/charon/utils/randomizer.h')
-rw-r--r--Source/charon/utils/randomizer.h27
1 files changed, 26 insertions, 1 deletions
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
@@ -48,6 +48,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.
*
* @param this calling randomizer_t object
@@ -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.