aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/crypto/rngs/rng.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/crypto/rngs/rng.h')
-rw-r--r--src/libstrongswan/crypto/rngs/rng.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/libstrongswan/crypto/rngs/rng.h b/src/libstrongswan/crypto/rngs/rng.h
index c72509b54..aee829d71 100644
--- a/src/libstrongswan/crypto/rngs/rng.h
+++ b/src/libstrongswan/crypto/rngs/rng.h
@@ -56,8 +56,8 @@ struct rng_t {
* @param buffer pointer where the generated bytes will be written
* @return TRUE if bytes successfully written
*/
- __attribute__((warn_unused_result))
- bool (*get_bytes) (rng_t *this, size_t len, u_int8_t *buffer);
+ bool (*get_bytes)(rng_t *this, size_t len,
+ u_int8_t *buffer) __attribute__((warn_unused_result));
/**
* Generates random bytes and allocate space for them.
@@ -66,13 +66,13 @@ struct rng_t {
* @param chunk chunk which will hold generated bytes
* @return TRUE if allocation succeeded
*/
- __attribute__((warn_unused_result))
- bool (*allocate_bytes) (rng_t *this, size_t len, chunk_t *chunk);
+ bool (*allocate_bytes)(rng_t *this, size_t len,
+ chunk_t *chunk) __attribute__((warn_unused_result));
/**
* Destroys a rng object.
*/
- void (*destroy) (rng_t *this);
+ void (*destroy)(rng_t *this);
};
/**
@@ -82,10 +82,11 @@ struct rng_t {
* @param rng rng_t object
* @param len number of bytes to get
* @param buffer pointer where the generated bytes will be written
- * @param all TRUE if all bytes have to be non-zero
+ * @param all TRUE if all bytes have to be non-zero, FALSE for first
* @return TRUE if bytes successfully written
*/
-bool rng_get_bytes_not_zero(rng_t *rng, size_t len, u_int8_t *buffer, bool all);
+bool rng_get_bytes_not_zero(rng_t *rng, size_t len, u_int8_t *buffer,
+ bool all) __attribute__((warn_unused_result));
/**
* Wrapper around rng_t.allocate_bytes() ensuring that either all bytes or at
@@ -93,12 +94,12 @@ bool rng_get_bytes_not_zero(rng_t *rng, size_t len, u_int8_t *buffer, bool all);
*
* @param rng rng_t object
* @param len number of bytes to get
- * @param buffer pointer where the generated bytes will be written
- * @param all TRUE if all bytes have to be non-zero
+ * @param chunk chunk that stores the generated bytes (allocated)
+ * @param all TRUE if all bytes have to be non-zero, FALSE for first
* @return TRUE if bytes successfully written
*/
bool rng_allocate_bytes_not_zero(rng_t *rng, size_t len, chunk_t *chunk,
- bool all);
+ bool all) __attribute__((warn_unused_result));