comparison bignum.c @ 594:a98a2138364a

Improve capitalisation for all logged strings
author Matt Johnston <matt@ucc.asn.au>
date Wed, 23 Feb 2011 15:50:30 +0000
parents c9483550701b
children 2b1bb792cd4d a78a38e402d1
comparison
equal deleted inserted replaced
593:ea103e4476ce 594:a98a2138364a
29 29
30 /* wrapper for mp_init, failing fatally on errors (memory allocation) */ 30 /* wrapper for mp_init, failing fatally on errors (memory allocation) */
31 void m_mp_init(mp_int *mp) { 31 void m_mp_init(mp_int *mp) {
32 32
33 if (mp_init(mp) != MP_OKAY) { 33 if (mp_init(mp) != MP_OKAY) {
34 dropbear_exit("mem alloc error"); 34 dropbear_exit("Mem alloc error");
35 } 35 }
36 } 36 }
37 37
38 /* simplified duplication of bn_mp_multi's mp_init_multi, but die fatally 38 /* simplified duplication of bn_mp_multi's mp_init_multi, but die fatally
39 * on error */ 39 * on error */
43 va_list args; 43 va_list args;
44 44
45 va_start(args, mp); /* init args to next argument from caller */ 45 va_start(args, mp); /* init args to next argument from caller */
46 while (cur_arg != NULL) { 46 while (cur_arg != NULL) {
47 if (mp_init(cur_arg) != MP_OKAY) { 47 if (mp_init(cur_arg) != MP_OKAY) {
48 dropbear_exit("mem alloc error"); 48 dropbear_exit("Mem alloc error");
49 } 49 }
50 cur_arg = va_arg(args, mp_int*); 50 cur_arg = va_arg(args, mp_int*);
51 } 51 }
52 va_end(args); 52 va_end(args);
53 } 53 }
54 54
55 void bytes_to_mp(mp_int *mp, const unsigned char* bytes, unsigned int len) { 55 void bytes_to_mp(mp_int *mp, const unsigned char* bytes, unsigned int len) {
56 56
57 if (mp_read_unsigned_bin(mp, (unsigned char*)bytes, len) != MP_OKAY) { 57 if (mp_read_unsigned_bin(mp, (unsigned char*)bytes, len) != MP_OKAY) {
58 dropbear_exit("mem alloc error"); 58 dropbear_exit("Mem alloc error");
59 } 59 }
60 } 60 }
61 61
62 /* hash the ssh representation of the mp_int mp */ 62 /* hash the ssh representation of the mp_int mp */
63 void sha1_process_mp(hash_state *hs, mp_int *mp) { 63 void sha1_process_mp(hash_state *hs, mp_int *mp) {