comparison dss.c @ 1122:aaf576b27a10

Merge pull request #13 from gazoo74/fix-warnings Fix warnings
author Matt Johnston <matt@ucc.asn.au>
date Thu, 04 Jun 2015 23:08:50 +0800
parents c45d65392c1a
children 750ec4ec4cbe
comparison
equal deleted inserted replaced
1087:1e486f368ec3 1122:aaf576b27a10
163 DEF_MP_INT(val1); 163 DEF_MP_INT(val1);
164 DEF_MP_INT(val2); 164 DEF_MP_INT(val2);
165 DEF_MP_INT(val3); 165 DEF_MP_INT(val3);
166 DEF_MP_INT(val4); 166 DEF_MP_INT(val4);
167 char * string = NULL; 167 char * string = NULL;
168 int stringlen; 168 unsigned int stringlen;
169 169
170 TRACE(("enter buf_dss_verify")) 170 TRACE(("enter buf_dss_verify"))
171 dropbear_assert(key != NULL); 171 dropbear_assert(key != NULL);
172 172
173 m_mp_init_multi(&val1, &val2, &val3, &val4, NULL); 173 m_mp_init_multi(&val1, &val2, &val3, &val4, NULL);
184 sha1_done(&hs, msghash); 184 sha1_done(&hs, msghash);
185 185
186 /* create the signature - s' and r' are the received signatures in buf */ 186 /* create the signature - s' and r' are the received signatures in buf */
187 /* w = (s')-1 mod q */ 187 /* w = (s')-1 mod q */
188 /* let val1 = s' */ 188 /* let val1 = s' */
189 bytes_to_mp(&val1, &string[SHA1_HASH_SIZE], SHA1_HASH_SIZE); 189 bytes_to_mp(&val1, (const unsigned char*) &string[SHA1_HASH_SIZE], SHA1_HASH_SIZE);
190 190
191 if (mp_cmp(&val1, key->q) != MP_LT) { 191 if (mp_cmp(&val1, key->q) != MP_LT) {
192 TRACE(("verify failed, s' >= q")) 192 TRACE(("verify failed, s' >= q"))
193 goto out; 193 goto out;
194 } 194 }
206 goto out; 206 goto out;
207 } 207 }
208 208
209 /* u2 = ((r')w) mod q */ 209 /* u2 = ((r')w) mod q */
210 /* let val1 = r' */ 210 /* let val1 = r' */
211 bytes_to_mp(&val1, &string[0], SHA1_HASH_SIZE); 211 bytes_to_mp(&val1, (const unsigned char*) &string[0], SHA1_HASH_SIZE);
212 if (mp_cmp(&val1, key->q) != MP_LT) { 212 if (mp_cmp(&val1, key->q) != MP_LT) {
213 TRACE(("verify failed, r' >= q")) 213 TRACE(("verify failed, r' >= q"))
214 goto out; 214 goto out;
215 } 215 }
216 /* let val4 = u2 = ((r')w) mod q */ 216 /* let val4 = u2 = ((r')w) mod q */