projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added SILC Thread Queue API
[silc.git]
/
lib
/
silccrypt
/
silcrng.h
diff --git
a/lib/silccrypt/silcrng.h
b/lib/silccrypt/silcrng.h
index 7dbdcbf6a692655716b955db638ccb8893e36823..bf32fd8fcac2e9d9802613331b7559f03e86e49c 100644
(file)
--- a/
lib/silccrypt/silcrng.h
+++ b/
lib/silccrypt/silcrng.h
@@
-1,10
+1,10
@@
/*
/*
- silcrng.h
+ silcrng.h
Author: Pekka Riikonen <priikone@silcnet.org>
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 200
2
Pekka Riikonen
+ Copyright (C) 1997 - 200
7
Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-39,7
+39,7
@@
/****s* silccrypt/SilcRNGAPI/SilcRng
*
* NAME
/****s* silccrypt/SilcRNGAPI/SilcRng
*
* NAME
- *
+ *
* typedef struct SilcRngStruct *SilcRng;
*
* DESCRIPTION
* typedef struct SilcRngStruct *SilcRng;
*
* DESCRIPTION
@@
-174,7
+174,8
@@
SilcUInt32 silc_rng_get_rn32(SilcRng rng);
* DESCRIPTION
*
* Returns random string in HEX form of the length of `len' bytes.
* DESCRIPTION
*
* Returns random string in HEX form of the length of `len' bytes.
- * The caller must free returned data buffer.
+ * The caller must free returned data buffer. It is guaranteed the
+ * data string goes not include any zero (0x00) bytes.
*
***/
unsigned char *silc_rng_get_rn_string(SilcRng rng, SilcUInt32 len);
*
***/
unsigned char *silc_rng_get_rn_string(SilcRng rng, SilcUInt32 len);
@@
-183,15
+184,18
@@
unsigned char *silc_rng_get_rn_string(SilcRng rng, SilcUInt32 len);
*
* SYNOPSIS
*
*
* SYNOPSIS
*
- * unsigned char *silc_rng_get_rn_data(SilcRng rng, SilcUInt32 len);
+ * SilcBool silc_rng_get_rn_data(SilcRng rng, SilcUInt32 len,
+ * unsigned char *buf, SilcUInt32 buf_size);
*
* DESCRIPTION
*
*
* DESCRIPTION
*
- * Returns random binary data of the length of `len' bytes. The
- * caller must free returned data buffer.
+ * Returns random binary data of the length of `len' bytes to the `buf'
+ * of maximum size of `buf_size'. It is guaranteed the data buffer does
+ * not include any zero (0x00) bytes.
*
***/
*
***/
-unsigned char *silc_rng_get_rn_data(SilcRng rng, SilcUInt32 len);
+SilcBool silc_rng_get_rn_data(SilcRng rng, SilcUInt32 len,
+ unsigned char *buf, SilcUInt32 buf_size);
/****f* silccrypt/SilcRNGAPI/silc_rng_add_noise
*
/****f* silccrypt/SilcRNGAPI/silc_rng_add_noise
*
@@
-201,7
+205,7
@@
unsigned char *silc_rng_get_rn_data(SilcRng rng, SilcUInt32 len);
*
* DESCRIPTION
*
*
* DESCRIPTION
*
- * Add the data buffer indicated by `buffer' of length of `len' bytes
+ * Add the data buffer indicated by `buffer' of length of `len' bytes
* as noise to the random number generator. The random number generator
* is restirred (reseeded) when this function is called.
*
* as noise to the random number generator. The random number generator
* is restirred (reseeded) when this function is called.
*
@@
-212,7
+216,7
@@
void silc_rng_add_noise(SilcRng rng, unsigned char *buffer, SilcUInt32 len);
*
* SYNOPSIS
*
*
* SYNOPSIS
*
- *
b
ool silc_rng_global_init(SilcRng rng);
+ *
SilcB
ool silc_rng_global_init(SilcRng rng);
*
* DESCRIPTION
*
*
* DESCRIPTION
*
@@
-232,13
+236,13
@@
void silc_rng_add_noise(SilcRng rng, unsigned char *buffer, SilcUInt32 len);
* the RNG as argument.
*
***/
* the RNG as argument.
*
***/
-
b
ool silc_rng_global_init(SilcRng rng);
+
SilcB
ool silc_rng_global_init(SilcRng rng);
/****f* silccrypt/SilcRNGAPI/silc_rng_global_uninit
*
* SYNOPSIS
*
/****f* silccrypt/SilcRNGAPI/silc_rng_global_uninit
*
* SYNOPSIS
*
- *
b
ool silc_rng_global_uninit(void);
+ *
SilcB
ool silc_rng_global_uninit(void);
*
* DESCRIPTION
*
*
* DESCRIPTION
*
@@
-246,7
+250,7
@@
bool silc_rng_global_init(SilcRng rng);
* be called if silc_rng_global_init was called with non-NULL RNG.
*
***/
* be called if silc_rng_global_init was called with non-NULL RNG.
*
***/
-
b
ool silc_rng_global_uninit(void);
+
SilcB
ool silc_rng_global_uninit(void);
/****f* silccrypt/SilcRNGAPI/silc_rng_global_get_byte
*
/****f* silccrypt/SilcRNGAPI/silc_rng_global_get_byte
*
@@
-317,7
+321,8
@@
SilcUInt32 silc_rng_global_get_rn32(void);
* DESCRIPTION
*
* Returns random string in HEX form of the length of `len' bytes.
* DESCRIPTION
*
* Returns random string in HEX form of the length of `len' bytes.
- * The caller must free returned data buffer.
+ * The caller must free returned data buffer. It is guaranteed the
+ * data string goes not include any zero (0x00) bytes.
*
***/
unsigned char *silc_rng_global_get_rn_string(SilcUInt32 len);
*
***/
unsigned char *silc_rng_global_get_rn_string(SilcUInt32 len);
@@
-326,15
+331,19
@@
unsigned char *silc_rng_global_get_rn_string(SilcUInt32 len);
*
* SYNOPSIS
*
*
* SYNOPSIS
*
- * unsigned char *silc_rng_global_get_rn_data(SilcUInt32 len);
+ * SilcBool silc_rng_global_get_rn_data(SilcRng rng, SilcUInt32 len,
+ * unsigned char *buf,
+ * SilcUInt32 buf_size);
*
* DESCRIPTION
*
*
* DESCRIPTION
*
- * Returns random binary data of the length of `len' bytes. The
- * caller must free returned data buffer.
+ * Returns random binary data of the length of `len' bytes to the `buf'
+ * of maximum size of `buf_size'. It is guaranteed the data buffer does
+ * not include any zero (0x00) bytes.
*
***/
*
***/
-unsigned char *silc_rng_global_get_rn_data(SilcUInt32 len);
+SilcBool silc_rng_global_get_rn_data(SilcRng rng, SilcUInt32 len,
+ unsigned char *buf, SilcUInt32 buf_size);
/****f* silccrypt/SilcRNGAPI/silc_rng_global_add_noise
*
/****f* silccrypt/SilcRNGAPI/silc_rng_global_add_noise
*
@@
-344,7
+353,7
@@
unsigned char *silc_rng_global_get_rn_data(SilcUInt32 len);
*
* DESCRIPTION
*
*
* DESCRIPTION
*
- * Add the data buffer indicated by `buffer' of length of `len' bytes
+ * Add the data buffer indicated by `buffer' of length of `len' bytes
* as noise to the random number generator. The random number generator
* is restirred (reseeded) when this function is called.
*
* as noise to the random number generator. The random number generator
* is restirred (reseeded) when this function is called.
*