diff 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
line wrap: on
line diff
--- a/bignum.c	Sun Apr 07 01:36:42 2013 +0800
+++ b/bignum.c	Mon Apr 08 00:10:57 2013 +0800
@@ -60,7 +60,8 @@
 }
 
 /* hash the ssh representation of the mp_int mp */
-void sha1_process_mp(hash_state *hs, mp_int *mp) {
+void hash_process_mp(const struct ltc_hash_descriptor *hash_desc, 
+				hash_state *hs, mp_int *mp) {
 
 	int i;
 	buffer * buf;
@@ -68,8 +69,6 @@
 	buf = buf_new(512 + 20); /* max buffer is a 4096 bit key, 
 								plus header + some leeway*/
 	buf_putmpint(buf, mp);
-	i = buf->pos;
-	buf_setpos(buf, 0);
-	sha1_process(hs, buf_getptr(buf, i), i);
+	hash_desc->process(hs, buf->data, buf->len);
 	buf_free(buf);
 }