1 /*---------------------------------------------------------------------------* 2 Project: TwlSDK - include 3 File: crypto/prng.h 4 5 Copyright 2008 Nintendo. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Date::$ 14 $Rev: 6844 $ 15 $Author: yasuda_kei $ 16 *---------------------------------------------------------------------------*/ 17 18 #ifndef NITRO_CRYPTO_PRNG_H_ 19 #define NITRO_CRYPTO_PRNG_H_ 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 26 /*---------------------------------------------------------------------------* 27 Constant Definitions 28 *---------------------------------------------------------------------------*/ 29 30 31 /*---------------------------------------------------------------------------* 32 Type Definitions 33 *---------------------------------------------------------------------------*/ 34 35 36 /*---------------------------------------------------------------------------* 37 Constant Structure Declarations 38 *---------------------------------------------------------------------------*/ 39 40 41 /*---------------------------------------------------------------------------* 42 Function Declarations 43 *---------------------------------------------------------------------------*/ 44 45 /*---------------------------------------------------------------------------* 46 Name: CRYPTO_PRNG_GatherEntropy 47 48 Description: Creates entropy for generating random numbers. 49 50 Arguments: None. 51 52 Returns: 0 on success and a non-zero value on failure 53 *---------------------------------------------------------------------------*/ 54 s32 CRYPTO_PRNG_GatherEntropy( void ); 55 56 /*---------------------------------------------------------------------------* 57 Name: CRYPTO_PRNG_GatherEntropy 58 59 Description: Generates random numbers. 60 61 Arguments: randomBytes: Output buffer for random numbers 62 size: Output size 63 64 Returns: 0 on success and a non-zero value on failure 65 *---------------------------------------------------------------------------*/ 66 s32 CRYPTO_PRNG_GenerateRandom( u8 *randomBytes, u32 size ); 67 68 69 /* For internal use */ 70 71 72 73 #ifdef __cplusplus 74 } 75 #endif 76 77 #endif //NITRO_CRYPTO_PRNG_H_ 78