This commit is contained in:
Markus Teich 2016-08-03 12:26:51 +02:00
parent 3dea4b69f5
commit 342d3729df

View File

@ -1511,7 +1511,13 @@ smc_zkp_dl (gcry_mpi_point_t v,
ec_point_serialize (&challenge.g, ec_gen); ec_point_serialize (&challenge.g, ec_gen);
ec_point_serialize (&challenge.v, v); ec_point_serialize (&challenge.v, v);
ec_point_serialize (&challenge.a, a); ec_point_serialize (&challenge.a, a);
GNUNET_CRYPTO_kdf_mod_mpi (&c, ec_n, NULL, 0, &challenge, sizeof (challenge), "libbrandt zkp dl"); GNUNET_CRYPTO_kdf_mod_mpi (&c,
ec_n,
NULL,
0,
&challenge,
sizeof (challenge),
"libbrandt zkp dl");
/* r = z + cx */ /* r = z + cx */
gcry_mpi_mulm (r, c, x, ec_n); gcry_mpi_mulm (r, c, x, ec_n);
@ -1554,7 +1560,13 @@ smc_zkp_dl_check (const gcry_mpi_point_t v,
ec_point_serialize (&challenge.g, ec_gen); ec_point_serialize (&challenge.g, ec_gen);
ec_point_serialize (&challenge.v, v); ec_point_serialize (&challenge.v, v);
ec_point_serialize (&challenge.a, a); ec_point_serialize (&challenge.a, a);
GNUNET_CRYPTO_kdf_mod_mpi (&c, ec_n, NULL, 0, &challenge, sizeof (challenge), "libbrandt zkp dl"); GNUNET_CRYPTO_kdf_mod_mpi (&c,
ec_n,
NULL,
0,
&challenge,
sizeof (challenge),
"libbrandt zkp dl");
/* rg =? a + cv */ /* rg =? a + cv */
gcry_mpi_ec_mul (left, r, ec_gen, ec_ctx); gcry_mpi_ec_mul (left, r, ec_gen, ec_ctx);
@ -1632,7 +1644,13 @@ smc_zkp_2dle (gcry_mpi_point_t v,
ec_point_serialize (&challenge.w, rw); ec_point_serialize (&challenge.w, rw);
ec_point_serialize (&challenge.a, a); ec_point_serialize (&challenge.a, a);
ec_point_serialize (&challenge.b, b); ec_point_serialize (&challenge.b, b);
GNUNET_CRYPTO_kdf_mod_mpi (&c, ec_n, NULL, 0, &challenge, sizeof (challenge), "libbrandt zkp 2dle"); GNUNET_CRYPTO_kdf_mod_mpi (&c,
ec_n,
NULL,
0,
&challenge,
sizeof (challenge),
"libbrandt zkp 2dle");
/* r = z + cx */ /* r = z + cx */
gcry_mpi_mulm (r, c, rx, ec_n); gcry_mpi_mulm (r, c, rx, ec_n);
@ -1694,7 +1712,13 @@ smc_zkp_2dle_check (const gcry_mpi_point_t v,
ec_point_serialize (&challenge.w, w); ec_point_serialize (&challenge.w, w);
ec_point_serialize (&challenge.a, a); ec_point_serialize (&challenge.a, a);
ec_point_serialize (&challenge.b, b); ec_point_serialize (&challenge.b, b);
GNUNET_CRYPTO_kdf_mod_mpi (&c, ec_n, NULL, 0, &challenge, sizeof (challenge), "libbrandt zkp 2dle"); GNUNET_CRYPTO_kdf_mod_mpi (&c,
ec_n,
NULL,
0,
&challenge,
sizeof (challenge),
"libbrandt zkp 2dle");
/* r*g1 =? a + cv */ /* r*g1 =? a + cv */
gcry_mpi_ec_mul (left, r, g1, ec_ctx); gcry_mpi_ec_mul (left, r, g1, ec_ctx);
@ -1825,7 +1849,13 @@ smc_zkp_0og (int m_is_gen,
ec_point_serialize (&challenge.a2, a2); ec_point_serialize (&challenge.a2, a2);
ec_point_serialize (&challenge.b1, b1); ec_point_serialize (&challenge.b1, b1);
ec_point_serialize (&challenge.b2, b2); ec_point_serialize (&challenge.b2, b2);
GNUNET_CRYPTO_kdf_mod_mpi (&c, ec_n, NULL, 0, &challenge, sizeof (challenge), "libbrandt zkp 0og"); GNUNET_CRYPTO_kdf_mod_mpi (&c,
ec_n,
NULL,
0,
&challenge,
sizeof (challenge),
"libbrandt zkp 0og");
if (!m_is_gen) if (!m_is_gen)
{ /* m == 0 */ { /* m == 0 */
@ -1918,7 +1948,13 @@ smc_zkp_0og_check (const gcry_mpi_point_t y,
ec_point_serialize (&challenge.a2, a2); ec_point_serialize (&challenge.a2, a2);
ec_point_serialize (&challenge.b1, b1); ec_point_serialize (&challenge.b1, b1);
ec_point_serialize (&challenge.b2, b2); ec_point_serialize (&challenge.b2, b2);
GNUNET_CRYPTO_kdf_mod_mpi (&c, ec_n, NULL, 0, &challenge, sizeof (challenge), "libbrandt zkp 0og"); GNUNET_CRYPTO_kdf_mod_mpi (&c,
ec_n,
NULL,
0,
&challenge,
sizeof (challenge),
"libbrandt zkp 0og");
/* c == d1 + d2 */ /* c == d1 + d2 */
gcry_mpi_addm (sum, d1, d2, ec_n); gcry_mpi_addm (sum, d1, d2, ec_n);