comparison buffer.c @ 743:09c5eb71ec96 kexguess

merge from head roundtrip changes
author Matt Johnston <matt@ucc.asn.au>
date Mon, 01 Apr 2013 00:13:41 +0800
parents 9a5438271556
children 7dcb46da72d9
comparison
equal deleted inserted replaced
742:cd201dc2da9a 743:09c5eb71ec96
280 /* for our purposes we only need positive (or 0) numbers, so will 280 /* for our purposes we only need positive (or 0) numbers, so will
281 * fail if we get negative numbers */ 281 * fail if we get negative numbers */
282 void buf_putmpint(buffer* buf, mp_int * mp) { 282 void buf_putmpint(buffer* buf, mp_int * mp) {
283 283
284 unsigned int len, pad = 0; 284 unsigned int len, pad = 0;
285 TRACE(("enter buf_putmpint")) 285 TRACE2(("enter buf_putmpint"))
286 286
287 dropbear_assert(mp != NULL); 287 dropbear_assert(mp != NULL);
288 288
289 if (SIGN(mp) == MP_NEG) { 289 if (SIGN(mp) == MP_NEG) {
290 dropbear_exit("negative bignum"); 290 dropbear_exit("negative bignum");
316 dropbear_exit("mpint error"); 316 dropbear_exit("mpint error");
317 } 317 }
318 buf_incrwritepos(buf, len-pad); 318 buf_incrwritepos(buf, len-pad);
319 } 319 }
320 320
321 TRACE(("leave buf_putmpint")) 321 TRACE2(("leave buf_putmpint"))
322 } 322 }
323 323
324 /* Retrieve an mp_int from the buffer. 324 /* Retrieve an mp_int from the buffer.
325 * Will fail for -ve since they shouldn't be required here. 325 * Will fail for -ve since they shouldn't be required here.
326 * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ 326 * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */