- add third_party src.
[platform/framework/web/crosswalk.git] / src / native_client / src / shared / platform / nacl_global_secure_random.h
1 /*
2  * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  */
6
7 /*
8  * NaCl Service Runtime.  Secure RNG.  Global singleton.
9  */
10
11 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_GLOBAL_SECURE_RANDOM_H_
12 #define NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_GLOBAL_SECURE_RANDOM_H_
13
14 #include "native_client/src/shared/platform/nacl_secure_random.h"
15 #include "native_client/src/shared/platform/nacl_sync.h"
16
17 void NaClGlobalSecureRngInit(void);
18
19 void NaClGlobalSecureRngSwitchRngForTesting(struct NaClSecureRng *);
20
21 void NaClGlobalSecureRngFini(void);
22
23 int32_t NaClGlobalSecureRngUniform(int32_t range_max);
24
25 uint32_t NaClGlobalSecureRngUint32(void);
26
27 /*
28  * Generate a random alpha-numeric name for a socket, a semaphore or some
29  * other device.
30  */
31 void NaClGenerateRandomPath(char *path, int length);
32
33 #endif  /* NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_GLOBAL_SECURE_RANDOM_H_ */