# HG changeset patch # User Matt Johnston # Date 1497960445 -28800 # Node ID 2d937dc448511d38c4e1e00d3d485f1a90236bc6 # Parent 9236e7120c3e702441f205e7d9834ee51000e01f verify debug printing diff -r 9236e7120c3e -r 2d937dc44851 dss.c --- a/dss.c Fri Jun 16 22:35:32 2017 +0800 +++ b/dss.c Tue Jun 20 20:07:25 2017 +0800 @@ -174,6 +174,13 @@ goto out; } +#if DEBUG_DSS_VERIFY + printmpint("dss verify p", key->p); + printmpint("dss verify q", key->q); + printmpint("dss verify g", key->g); + printmpint("dss verify x", key->x); +#endif + /* hash the data */ sha1_init(&hs); sha1_process(&hs, data_buf->data, data_buf->len); @@ -183,6 +190,9 @@ /* w = (s')-1 mod q */ /* let val1 = s' */ bytes_to_mp(&val1, (const unsigned char*) &string[SHA1_HASH_SIZE], SHA1_HASH_SIZE); +#if DEBUG_DSS_VERIFY + printmpint("dss verify s'", &val1); +#endif if (mp_cmp(&val1, key->q) != MP_LT) { TRACE(("verify failed, s' >= q")) @@ -200,6 +210,9 @@ /* u1 = ((SHA(M')w) mod q */ /* let val1 = SHA(M') = msghash */ bytes_to_mp(&val1, msghash, SHA1_HASH_SIZE); +#if DEBUG_DSS_VERIFY + printmpint("dss verify r'", &val1); +#endif /* let val3 = u1 = ((SHA(M')w) mod q */ if (mp_mulmod(&val1, &val2, key->q, &val3) != MP_OKAY) {