summaryrefslogtreecommitdiffhomepage
path: root/gendss.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-04-28 23:17:43 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-04-28 23:17:43 +0800
commit79660f2eb1c64bcac9ba0084f9d3822ee88dbd5c (patch)
tree3a5e25381d08d23b881300c9d5c58c8ac439ea29 /gendss.c
parent5c87c6a435ab1791294c412abe32aa629b42fdc7 (diff)
more ecdsa signkey work, not correct
--HG-- branch : ecc
Diffstat (limited to 'gendss.c')
-rw-r--r--gendss.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gendss.c b/gendss.c
index 5abb4d8..be8f89f 100644
--- a/gendss.c
+++ b/gendss.c
@@ -47,6 +47,10 @@ dropbear_dss_key * gen_dss_priv_key(unsigned int size) {
dropbear_dss_key *key;
+ if (size != 1024) {
+ dropbear_exit("DSS keys have a fixed size of 1024 bits");
+ }
+
key = m_malloc(sizeof(*key));
key->p = (mp_int*)m_malloc(sizeof(mp_int));
@@ -56,10 +60,8 @@ dropbear_dss_key * gen_dss_priv_key(unsigned int size) {
key->x = (mp_int*)m_malloc(sizeof(mp_int));
m_mp_init_multi(key->p, key->q, key->g, key->y, key->x, NULL);
- seedrandom();
-
getq(key);
- getp(key, size);
+ getp(key, size/8);
getg(key);
getx(key);
gety(key);