comparison dss.c @ 70:b0316ce64e4b

Merging in the changes from 0.41-0.43 main Dropbear tree
author Matt Johnston <matt@ucc.asn.au>
date Thu, 12 Aug 2004 16:41:58 +0000
parents e2a1eaa19f22
children 29a5c7c62350
comparison
equal deleted inserted replaced
69:59d16db56e9f 70:b0316ce64e4b
169 int stringlen; 169 int stringlen;
170 170
171 TRACE(("enter buf_dss_verify")); 171 TRACE(("enter buf_dss_verify"));
172 assert(key != NULL); 172 assert(key != NULL);
173 173
174 m_mp_init_multi(&val1, &val2, &val3, &val4, NULL);
175
174 /* get blob, check length */ 176 /* get blob, check length */
175 string = buf_getstring(buf, &stringlen); 177 string = buf_getstring(buf, &stringlen);
176 if (stringlen != 2*SHA1_HASH_SIZE) { 178 if (stringlen != 2*SHA1_HASH_SIZE) {
177 goto out; 179 goto out;
178 } 180 }
179 181
180 /* hash the data */ 182 /* hash the data */
181 sha1_init(&hs); 183 sha1_init(&hs);
182 sha1_process(&hs, data, len); 184 sha1_process(&hs, data, len);
183 sha1_done(&hs, msghash); 185 sha1_done(&hs, msghash);
184
185 m_mp_init_multi(&val1, &val2, &val3, &val4, NULL);
186 186
187 /* create the signature - s' and r' are the received signatures in buf */ 187 /* create the signature - s' and r' are the received signatures in buf */
188 /* w = (s')-1 mod q */ 188 /* w = (s')-1 mod q */
189 /* let val1 = s' */ 189 /* let val1 = s' */
190 if (mp_read_unsigned_bin(&val1, &string[SHA1_HASH_SIZE], SHA1_HASH_SIZE) 190 if (mp_read_unsigned_bin(&val1, &string[SHA1_HASH_SIZE], SHA1_HASH_SIZE)