Jens Wiklander | 02389a9 | 2016-12-16 11:13:38 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016, Linaro Limited |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License Version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #ifndef __RAND_STREAM_H |
| 15 | #define __RAND_STREAM_H |
| 16 | |
| 17 | #include <sys/types.h> |
| 18 | |
| 19 | struct rand_stream; |
| 20 | |
| 21 | struct rand_stream *rand_stream_alloc(int seed, size_t stream_buffer_size); |
| 22 | void rand_stream_free(struct rand_stream *rs); |
| 23 | |
| 24 | const void *rand_stream_peek(struct rand_stream *rs, size_t *num_bytes); |
| 25 | void rand_stream_advance(struct rand_stream *rs, size_t num_bytes); |
| 26 | void rand_stream_read(struct rand_stream *rs, void *buf, size_t num_bytes); |
| 27 | |
| 28 | #endif /*__RAND_STREAM_H*/ |