Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
8ef79d34
Commit
8ef79d34
authored
Oct 22, 2000
by
Niels Möller
Browse files
* src/randomness.h (random_poll): New class.
Rev: src/randomness.h:1.10
parent
e1ddfed6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/randomness.h
View file @
8ef79d34
...
...
@@ -42,6 +42,24 @@
#define RANDOM(r, length, dst) ((r)->random((r), length, dst))
/* A class polling the environment for randomness. Following Peter
* Gutmann's ideas, there are two methods for a slow more thorough
* poll done at startup, and a faster poll performed from time to time
* as a generator is used. */
/* GABA:
(class
(name random_poll)
(vars
;; Both functions return an entropy estimate, and adds the
;; randomness to the given hash instance.
(slow method unsigned "struct hash_instance *")
(fast method unsigned "struct hash_instance *"))) */
#define RANDOM_POLL_SLOW(p, h) ((p)->slow((p), (h)))
#define RANDOM_POLL_FAST(p, h) ((p)->fast((p), (h)))
/* Consumes the init string (which may be NULL). */
struct
randomness
*
make_poor_random
(
struct
hash_algorithm
*
hash
,
struct
lsh_string
*
init
);
...
...
@@ -49,4 +67,8 @@ struct randomness *make_poor_random(struct hash_algorithm *hash,
struct
randomness
*
make_device_random
(
const
char
*
device
);
struct
randomness
*
make_reasonably_random
(
void
);
struct
randomness
*
make_arcfour_random
(
struct
random_poll
*
poller
,
struct
hash_algorithm
*
hash
);
#endif
/* LSH_RANDOMNESS_H_INCLUDED */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment