comparison gendss.c @ 102:6571b480fa04

merge of 5c31199418631253a3d311fe3b1ff87351e1c9ca and c84edf4a78416c5c3172871d3c74d7fd64afab2d
author Matt Johnston <matt@ucc.asn.au>
date Tue, 24 Aug 2004 04:07:41 +0000
parents 29a5c7c62350 2ca590852f45
children c9483550701b
comparison
equal deleted inserted replaced
101:72dc22f56858 102:6571b480fa04
31 #include "gendss.h" 31 #include "gendss.h"
32 #include "dss.h" 32 #include "dss.h"
33 33
34 #define QSIZE 20 /* 160 bit */ 34 #define QSIZE 20 /* 160 bit */
35 35
36 /* This is just a test */
37
36 #ifdef DROPBEAR_DSS 38 #ifdef DROPBEAR_DSS
37 39
38 static void getq(dss_key *key); 40 static void getq(dss_key *key);
39 static void getp(dss_key *key, unsigned int size); 41 static void getp(dss_key *key, unsigned int size);
40 static void getg(dss_key *key); 42 static void getg(dss_key *key);
148 m_free(buf); 150 m_free(buf);
149 } 151 }
150 152
151 static void getg(dss_key * key) { 153 static void getg(dss_key * key) {
152 154
153 char printbuf[1000];
154 DEF_MP_INT(div); 155 DEF_MP_INT(div);
155 DEF_MP_INT(h); 156 DEF_MP_INT(h);
156 DEF_MP_INT(val); 157 DEF_MP_INT(val);
157 158
158 m_mp_init_multi(&div, &h, &val, NULL); 159 m_mp_init_multi(&div, &h, &val, NULL);
181 exit(1); 182 exit(1);
182 } 183 }
183 184
184 } while (mp_cmp_d(key->g, 1) != MP_GT); 185 } while (mp_cmp_d(key->g, 1) != MP_GT);
185 186
186 mp_toradix(key->g, printbuf, 10);
187
188 mp_clear_multi(&div, &h, &val, NULL); 187 mp_clear_multi(&div, &h, &val, NULL);
189 } 188 }
190 189
191 static void getx(dss_key *key) { 190 static void getx(dss_key *key) {
192 191