@@ -87,17 +87,6 @@ long long EnDeTool::encodebinary( const char* src, unsigned srcsize, char* &out
87
87
if ( src == NULL )
88
88
return -1 ;
89
89
90
- #ifdef DEBUG
91
- printf ( " === encodebianry:sourcetest:begin ===\n " );
92
- printf ( " srcsize = %u\n " , srcsize );
93
- for ( size_t x=0 ; x<srcsize; x++ )
94
- {
95
- printf ( " %c" ,src[x] );
96
- }
97
- printf ( " \n === encodebianry:sourcetest:end ===\n " );
98
- fflush ( stdout );
99
- #endif
100
-
101
90
generateiv ();
102
91
AES_ctx* actx = (AES_ctx*)cryptcontext;
103
92
AES_init_ctx_iv ( actx,
@@ -116,19 +105,11 @@ long long EnDeTool::encodebinary( const char* src, unsigned srcsize, char* &out
116
105
117
106
if ( doingcompress == true )
118
107
{
119
- #ifdef DEBUG
120
- printf ( " compressbuffer( %llu bytes );\n " , encbuffsz );
121
- fflush ( stdout );
122
- #endif
123
108
encbuffsz = compressbuffer ( encbuff, encbuffsz );
124
109
if ( encbuffsz == 0 ) // / failure case.
125
110
{
126
111
return -3 ; // / decompress failure.
127
112
}
128
- #ifdef DEBUG
129
- printf ( " compressed %llu to %llu bytes.\n " , encbuffsz, srcsize + 4 );
130
- fflush ( stdout );
131
- #endif
132
113
}
133
114
134
115
unsigned tmpCiperLen = encbuffsz;
@@ -169,18 +150,6 @@ long long EnDeTool::encodebinary( const char* src, unsigned srcsize, char* &out
169
150
}
170
151
171
152
out = encbuff;
172
-
173
- #ifdef DEBUG
174
- printf ( " === encodebianry:out:begin ===\n " );
175
- printf ( " tmpCiperLen = %u\n " , tmpCiperLen );
176
- for ( size_t x=0 ; x<tmpCiperLen; x++ )
177
- {
178
- printf ( " %02X" ,(uint8_t )out[x] );
179
- }
180
- printf ( " \n === encodebianry:out:end ===\n " );
181
- fflush ( stdout );
182
- #endif // / of DEBUG
183
-
184
153
return (long long )tmpCiperLen;
185
154
}
186
155
@@ -189,17 +158,6 @@ long long EnDeTool::decodebinary( const char* src, unsigned srcsize, char* &out
189
158
if ( ( src == NULL ) || ( srcsize < AES_BLOCKLEN ) )
190
159
return -1 ;
191
160
192
- #ifdef DEBUG
193
- printf ( " === decodebinary:sourcetest:begin ===\n " );
194
- printf ( " srcsize = %u\n " , srcsize );
195
- for ( size_t x=0 ; x<srcsize; x++ )
196
- {
197
- printf ( " %02X" ,(uint8_t )src[x] );
198
- }
199
- printf ( " \n === decodebinary:sourcetest:end ===\n " );
200
- fflush ( stdout );
201
- #endif
202
-
203
161
unsigned decbuffsz = srcsize;
204
162
unsigned int realsz = 0 ;
205
163
@@ -234,23 +192,10 @@ long long EnDeTool::decodebinary( const char* src, unsigned srcsize, char* &out
234
192
// checks is it compressed ..
235
193
if ( memcmp ( decptr, &LZMAT_COMPRESS_HEADER, 4 ) == 0 )
236
194
{
237
- #ifdef DEBUG
238
- printf ( " data compressed!\n " );
239
- fflush ( stdout );
240
- #endif // / of DEBUG
241
195
unsigned worksz = srcsize - 4 ;
242
196
243
197
// reallocate buffer for decompress buffer.
244
- #ifdef DEBUG
245
- printf ( " decompressing ... " );
246
- fflush ( stdout );
247
- #endif // / of DEBUG
248
198
decbuffsz = decompressbuffer ( decptr, worksz );
249
- #ifdef DEBUG
250
- printf ( " %u bytes\n " , decbuffsz );
251
- fflush ( stdout );
252
- #endif // / of DEBUG
253
-
254
199
if ( decbuffsz < AES_BLOCKLEN )
255
200
{
256
201
delete[] decptr;
@@ -286,25 +231,7 @@ long long EnDeTool::decodebinary( const char* src, unsigned srcsize, char* &out
286
231
if ( out != NULL )
287
232
{
288
233
memset ( out, 0 , realsz + 1 );
289
- #ifdef DEBUG
290
- printf ( " #TEST#\n " );
291
- printf ( " decptr = %llX ~ %llX, size = %llu\n " ,
292
- decptr, decptr + decbuffsz, decbuffsz );
293
- printf ( " out = %llX~%llX, size = %llu\n " ,
294
- out, out + realsz + 1 , realsz );
295
- fflush ( stdout );
296
- #endif // / of DEBUG
297
234
memcpy ( out, &decptr[4 ], realsz );
298
- #ifdef DEBUG
299
- printf ( " === decodebinary:out:begin ===\n " );
300
- printf ( " realsz = %u\n " , realsz );
301
- for ( size_t x=0 ; x<realsz; x++ )
302
- {
303
- printf ( " %c" ,out[x] );
304
- }
305
- printf ( " \n === decodebinary:out:end ===\n " );
306
- fflush ( stdout );
307
- #endif // / of DEBUG
308
235
delete[] decptr;
309
236
}
310
237
else
0 commit comments