1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: nlib_md5_horizon.h 4 5 Copyright (C)2009 Nintendo Co., Ltd. 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 $Rev: 14703 $ 14 *---------------------------------------------------------------------------*/ 15 16 #ifndef NN_NET_COMPATIBLE_NLIB_NLIB_H_ 17 #define NN_NET_COMPATIBLE_NLIB_NLIB_H_ 18 19 /* Please see man pages for details 20 21 */ 22 23 #include <nn/types.h> 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 /* Please see man pages for details 30 31 */ 32 typedef struct NLIBMD5Context 33 { 34 union 35 { 36 struct 37 { 38 unsigned long a, b, c, d; 39 } p; 40 unsigned long state[4]; 41 } x; 42 unsigned long long length; 43 union 44 { 45 unsigned long buffer32[16]; 46 unsigned char buffer8[64]; 47 } y; 48 } NLIBMD5Context; 49 50 /* 51 Prepare the following functions. 52 ・Init functions 53 ・Update functions 54 ・Final functions 55 */ 56 void NLIB_MD5Init(NLIBMD5Context* context); 57 void NLIB_MD5Update(NLIBMD5Context* context, const void* input, u32 length); 58 void NLIB_MD5Final(u8 digest[20], NLIBMD5Context* context); 59 60 #ifdef __cplusplus 61 } 62 #endif 63 64 #endif 65