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.
8 * NaCl Service Runtime. Secure RNG. Global singleton.
11 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_GLOBAL_SECURE_RANDOM_H_
12 #define NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_GLOBAL_SECURE_RANDOM_H_
14 #include "native_client/src/shared/platform/nacl_secure_random.h"
15 #include "native_client/src/shared/platform/nacl_sync.h"
17 void NaClGlobalSecureRngInit(void);
19 void NaClGlobalSecureRngSwitchRngForTesting(struct NaClSecureRng *);
21 void NaClGlobalSecureRngFini(void);
23 int32_t NaClGlobalSecureRngUniform(int32_t range_max);
25 uint32_t NaClGlobalSecureRngUint32(void);
28 * Generate a random alpha-numeric name for a socket, a semaphore or some
31 void NaClGenerateRandomPath(char *path, int length);
33 #endif /* NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_GLOBAL_SECURE_RANDOM_H_ */