1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: cx_SecureUncompression.h 4 5 Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc. 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 $Revision: 38499 $ 14 *---------------------------------------------------------------------------*/ 15 16 #ifndef NN_CX_SECURE_UNCOMPRESSION_H_ 17 #define NN_CX_SECURE_UNCOMPRESSION_H_ 18 19 #include <nn/types.h> 20 #include <nn/cx/cx_Uncompression.h> 21 22 namespace nn { 23 namespace cx { 24 25 /* Please see man pages for details 26 27 */ 28 enum ErrorCode 29 { 30 ERROR_CODE_SUCCESS = 0, // 31 ERROR_CODE_UNSUPPORTED = -1, // 32 ERROR_CODE_DATA_SHORTAGE = -2, // 33 ERROR_CODE_DATA_REMAINDER = -3, // 34 ERROR_CODE_BUFFER_OVERRUN = -4, // 35 ERROR_CODE_ILLEGAL_TABLE = -5 // 36 }; 37 38 enum 39 { 40 CX_ERR_SUCCESS = ERROR_CODE_SUCCESS, 41 CX_ERR_UNSUPPORTED = ERROR_CODE_UNSUPPORTED, 42 CX_ERR_SRC_SHORTAGE = ERROR_CODE_DATA_SHORTAGE, 43 CX_ERR_SRC_REMAINDER = ERROR_CODE_DATA_REMAINDER, 44 CX_ERR_DEST_OVERRUN = ERROR_CODE_BUFFER_OVERRUN, 45 CX_ERR_ILLEGAL_TABLE = ERROR_CODE_ILLEGAL_TABLE 46 }; 47 48 /* Please see man pages for details 49 50 51 */ 52 53 /* Please see man pages for details 54 55 56 57 58 59 60 61 62 63 64 65 66 67 */ 68 s32 SecureUncompressAny( const void* srcp, u32 srcSize, void* destp ); 69 70 71 /* Please see man pages for details 72 73 74 75 76 77 78 79 80 81 */ 82 s32 SecureUncompressRL( const void *srcp, u32 srcSize, void *destp ); 83 84 85 /* Please see man pages for details 86 87 88 89 90 91 92 93 94 95 96 97 */ 98 s32 SecureUncompressLZ( const void *srcp, u32 srcSize, void *destp ); 99 100 101 /* Please see man pages for details 102 103 104 105 106 107 108 109 110 111 112 113 */ 114 s32 SecureUncompressHuffman( const void *srcp, u32 srcSize, void *destp ); 115 116 117 /* Please see man pages for details 118 119 120 121 122 123 124 */ 125 s32 SecureUncompressLH( const u8* srcp, u32 srcSize, u8* destp, void* work ); 126 127 128 /* Please see man pages for details 129 130 131 132 133 134 135 */ 136 s32 SecureUncompressLRC( const u8* srcp, u32 srcSize, u8* destp, void* work ); 137 138 139 /* Please see man pages for details 140 141 142 143 144 145 146 147 148 149 */ 150 s32 SecureUnfilterDiff( register const void *srcp, u32 srcSize, register void *destp ); 151 152 /* 153 154 155 156 157 158 */ 159 s32 SecureUncompressBLZ(void* pData, size_t dataSize, size_t bufferSize); 160 161 /* 162 163 */ 164 165 namespace internal { 166 167 bool VerifyHuffmanTable( const void* pTable, u8 bit ); 168 bool LHVerifyTable( const void* pTable, u8 bit ); 169 170 } // namespace internal 171 172 } // namespace cx 173 } // namespace nn 174 175 /* NN_CX_SECURE_UNCOMPRESSION_H_ */ 176 #endif 177