Debian Codegraph @

android/app/jni/extern/macports-legacy-support/src/arc4random.h

raw
1 /*
2 * Copyright (c) 1996, David Mazieres <[email protected]>
3 * Copyright (c) 2008, Damien Miller <[email protected]>
4 * Copyright (c) 2013, Markus Friedl <[email protected]>
5 * Copyright (c) 2014, Theo de Raadt <[email protected]>
6 * Copyright (c) 2015, Sudhi Herle <[email protected]>
7 *
8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 */
20
21 #ifndef ___ARC4RANDOM_H_5000666_1462841354__
22 #define ___ARC4RANDOM_H_5000666_1462841354__ 1
23
24 /* Provide C linkage for symbols declared here .. */
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 #include <stdint.h>
30 #include <sys/types.h>
31
32 /*
33 * Generate and return a uniformly random 32-bit quantity with an
34 * upper bound of 'upper_bound'
35 */
36 extern uint32_t arc4random_uniform(uint32_t upper_bound);
37
38 /*
39 * Generate 'n' random bytes and put them in 'buf'.
40 */
41 extern void arc4random_buf(void* buf, size_t n);
42
43 #ifdef __cplusplus
44 }
45 #endif /* __cplusplus */
46
47 #endif /* ! ___ARC4RANDOM_H_5000666_1462841354__ */
48
49 /* EOF */