comparison bignum.c @ 762:a78a38e402d1 ecc

- Fix various hardcoded uses of SHA1 - rename curves to nistp256 etc - fix svr-auth.c TRACE problem
author Matt Johnston <matt@ucc.asn.au>
date Mon, 08 Apr 2013 00:10:57 +0800
parents a98a2138364a
children 724c3e0c8734
comparison
equal deleted inserted replaced
761:ac2158e3e403 762:a78a38e402d1
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 hash_process_mp(const struct ltc_hash_descriptor *hash_desc,
64 hash_state *hs, mp_int *mp) {
64 65
65 int i; 66 int i;
66 buffer * buf; 67 buffer * buf;
67 68
68 buf = buf_new(512 + 20); /* max buffer is a 4096 bit key, 69 buf = buf_new(512 + 20); /* max buffer is a 4096 bit key,
69 plus header + some leeway*/ 70 plus header + some leeway*/
70 buf_putmpint(buf, mp); 71 buf_putmpint(buf, mp);
71 i = buf->pos; 72 hash_desc->process(hs, buf->data, buf->len);
72 buf_setpos(buf, 0);
73 sha1_process(hs, buf_getptr(buf, i), i);
74 buf_free(buf); 73 buf_free(buf);
75 } 74 }