comparison buffer.c @ 801:7dcb46da72d9 ecc

merge in HEAD
author Matt Johnston <matt@ucc.asn.au>
date Tue, 21 May 2013 12:09:35 +0800
parents f336d232fc63 9a5438271556
children bae0b34bc059 7c899f24a85b
comparison
equal deleted inserted replaced
799:c344607b7341 801:7dcb46da72d9
285 /* for our purposes we only need positive (or 0) numbers, so will 285 /* for our purposes we only need positive (or 0) numbers, so will
286 * fail if we get negative numbers */ 286 * fail if we get negative numbers */
287 void buf_putmpint(buffer* buf, mp_int * mp) { 287 void buf_putmpint(buffer* buf, mp_int * mp) {
288 288
289 unsigned int len, pad = 0; 289 unsigned int len, pad = 0;
290 TRACE(("enter buf_putmpint")) 290 TRACE2(("enter buf_putmpint"))
291 291
292 dropbear_assert(mp != NULL); 292 dropbear_assert(mp != NULL);
293 293
294 if (SIGN(mp) == MP_NEG) { 294 if (SIGN(mp) == MP_NEG) {
295 dropbear_exit("negative bignum"); 295 dropbear_exit("negative bignum");
321 dropbear_exit("mpint error"); 321 dropbear_exit("mpint error");
322 } 322 }
323 buf_incrwritepos(buf, len-pad); 323 buf_incrwritepos(buf, len-pad);
324 } 324 }
325 325
326 TRACE(("leave buf_putmpint")) 326 TRACE2(("leave buf_putmpint"))
327 } 327 }
328 328
329 /* Retrieve an mp_int from the buffer. 329 /* Retrieve an mp_int from the buffer.
330 * Will fail for -ve since they shouldn't be required here. 330 * Will fail for -ve since they shouldn't be required here.
331 * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ 331 * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */