comparison buffer.c @ 165:0cfba3034be5

Fixed DEBUG_TRACE macro so that we don't get semicolons left about the place
author Matt Johnston <matt@ucc.asn.au>
date Sun, 02 Jan 2005 20:25:56 +0000
parents 10f4d3319780
children 161557a9dde8
comparison
equal deleted inserted replaced
161:b9d3f725e00b 165:0cfba3034be5
256 /* for our purposes we only need positive (or 0) numbers, so will 256 /* for our purposes we only need positive (or 0) numbers, so will
257 * fail if we get negative numbers */ 257 * fail if we get negative numbers */
258 void buf_putmpint(buffer* buf, mp_int * mp) { 258 void buf_putmpint(buffer* buf, mp_int * mp) {
259 259
260 unsigned int len, pad = 0; 260 unsigned int len, pad = 0;
261 TRACE(("enter buf_putmpint")); 261 TRACE(("enter buf_putmpint"))
262 262
263 assert(mp != NULL); 263 assert(mp != NULL);
264 264
265 if (SIGN(mp) == MP_NEG) { 265 if (SIGN(mp) == MP_NEG) {
266 dropbear_exit("negative bignum"); 266 dropbear_exit("negative bignum");
292 dropbear_exit("mpint error"); 292 dropbear_exit("mpint error");
293 } 293 }
294 buf_incrwritepos(buf, len-pad); 294 buf_incrwritepos(buf, len-pad);
295 } 295 }
296 296
297 TRACE(("leave buf_putmpint")); 297 TRACE(("leave buf_putmpint"))
298 } 298 }
299 299
300 /* Retrieve an mp_int from the buffer. 300 /* Retrieve an mp_int from the buffer.
301 * Will fail for -ve since they shouldn't be required here. 301 * Will fail for -ve since they shouldn't be required here.
302 * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ 302 * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */