summaryrefslogtreecommitdiffstats
path: root/libtomcrypt/headers/tomcrypt_prng.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-09-06 17:20:33 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-09-06 17:26:58 +0200
commite6177630198eb1eea2def0374fae1196da0e40ec (patch)
tree704951804609999fb6ef7a956b04921b9f84c320 /libtomcrypt/headers/tomcrypt_prng.h
parent943f9ab50c110133a5cd1118b5b19cb09301168f (diff)
downloadcryptodev-linux-e6177630198eb1eea2def0374fae1196da0e40ec.tar.gz
cryptodev-linux-e6177630198eb1eea2def0374fae1196da0e40ec.tar.xz
cryptodev-linux-e6177630198eb1eea2def0374fae1196da0e40ec.zip
Run Lindent on libtom(*)
Diffstat (limited to 'libtomcrypt/headers/tomcrypt_prng.h')
-rw-r--r--libtomcrypt/headers/tomcrypt_prng.h45
1 files changed, 26 insertions, 19 deletions
diff --git a/libtomcrypt/headers/tomcrypt_prng.h b/libtomcrypt/headers/tomcrypt_prng.h
index 26bf711..a3fe429 100644
--- a/libtomcrypt/headers/tomcrypt_prng.h
+++ b/libtomcrypt/headers/tomcrypt_prng.h
@@ -1,72 +1,79 @@
/* ---- PRNG Stuff ---- */
typedef union Prng_state {
- char dummy[1];
+ char dummy[1];
} prng_state;
/** PRNG descriptor */
extern struct ltc_prng_descriptor {
/** Name of the PRNG */
- char *name;
+ char *name;
/** size in bytes of exported state */
- int export_size;
+ int export_size;
/** Start a PRNG state
@param prng [out] The state to initialize
@return CRYPT_OK if successful
*/
- int (*start)(prng_state *prng);
+ int (*start) (prng_state * prng);
/** Add entropy to the PRNG
@param in The entropy
@param inlen Length of the entropy (octets)\
@param prng The PRNG state
@return CRYPT_OK if successful
*/
- int (*add_entropy)(const unsigned char *in, unsigned long inlen, prng_state *prng);
+ int (*add_entropy) (const unsigned char *in, unsigned long inlen,
+ prng_state * prng);
/** Ready a PRNG state to read from
@param prng The PRNG state to ready
@return CRYPT_OK if successful
*/
- int (*ready)(prng_state *prng);
+ int (*ready) (prng_state * prng);
/** Read from the PRNG
@param out [out] Where to store the data
@param outlen Length of data desired (octets)
@param prng The PRNG state to read from
@return Number of octets read
*/
- unsigned long (*read)(unsigned char *out, unsigned long outlen, prng_state *prng);
+ unsigned long (*read) (unsigned char *out, unsigned long outlen,
+ prng_state * prng);
/** Terminate a PRNG state
@param prng The PRNG state to terminate
@return CRYPT_OK if successful
*/
- int (*done)(prng_state *prng);
+ int (*done) (prng_state * prng);
/** Export a PRNG state
@param out [out] The destination for the state
@param outlen [in/out] The max size and resulting size of the PRNG state
@param prng The PRNG to export
@return CRYPT_OK if successful
*/
- int (*pexport)(unsigned char *out, unsigned long *outlen, prng_state *prng);
+ int (*pexport) (unsigned char *out, unsigned long *outlen,
+ prng_state * prng);
/** Import a PRNG state
@param in The data to import
@param inlen The length of the data to import (octets)
@param prng The PRNG to initialize/import
@return CRYPT_OK if successful
*/
- int (*pimport)(const unsigned char *in, unsigned long inlen, prng_state *prng);
+ int (*pimport) (const unsigned char *in, unsigned long inlen,
+ prng_state * prng);
/** Self-test the PRNG
@return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled
*/
- int (*test)(void);
+ int (*test) (void);
} prng_descriptor[];
-int linux_start(prng_state *prng);
-int linux_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng);
-int linux_ready(prng_state *prng);
-unsigned long linux_read(unsigned char *out, unsigned long outlen, prng_state *prng);
-int linux_done(prng_state *prng);
-int linux_export(unsigned char *out, unsigned long *outlen, prng_state *prng);
-int linux_import(const unsigned char *in, unsigned long inlen, prng_state *prng);
-int linux_test(void);
+int linux_start(prng_state * prng);
+int linux_add_entropy(const unsigned char *in, unsigned long inlen,
+ prng_state * prng);
+int linux_ready(prng_state * prng);
+unsigned long linux_read(unsigned char *out, unsigned long outlen,
+ prng_state * prng);
+int linux_done(prng_state * prng);
+int linux_export(unsigned char *out, unsigned long *outlen, prng_state * prng);
+int linux_import(const unsigned char *in, unsigned long inlen,
+ prng_state * prng);
+int linux_test(void);
extern const struct ltc_prng_descriptor linux_desc;