summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2008-10-26 15:37:31 +0000
committerBen Laurie <ben@openssl.org>2008-10-26 15:37:31 +0000
commit3b668eedda78fcf712198b3d7c433a67989da407 (patch)
tree8637c19fa6808a7d278b3361cc04388d061fbbf1 /demos
parent7471431322119f9216b7cb9d25f9181645be2f58 (diff)
Minor clarity enhancements.
Diffstat (limited to 'demos')
-rw-r--r--demos/jpake/jpakedemo.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/demos/jpake/jpakedemo.c b/demos/jpake/jpakedemo.c
index 4fd0897f15..338a8810d9 100644
--- a/demos/jpake/jpakedemo.c
+++ b/demos/jpake/jpakedemo.c
@@ -164,7 +164,8 @@ static void zkpHash(BIGNUM *h, const JPakeZKP *zkp, const BIGNUM *gx,
// Prove knowledge of x
// Note that we don't send g^x because, as it happens, we've always
-// sent it elsewhere. Also note that because of that, we could avoid calculating it here, but we don't, for clarity...
+// sent it elsewhere. Also note that because of that, we could avoid
+// calculating it here, but we don't, for clarity...
static void CreateZKP(JPakeZKP *zkp, const BIGNUM *x, const JPakeUser *us,
const BIGNUM *zkpg, const JPakeParameters *params,
int n, const char *suffix)
@@ -205,7 +206,7 @@ static void CreateZKP(JPakeZKP *zkp, const BIGNUM *x, const JPakeUser *us,
BN_free(r);
}
-static int VerifyZKP(const JPakeZKP *zkp, BIGNUM *x,
+static int VerifyZKP(const JPakeZKP *zkp, BIGNUM *gx,
const JPakeUserPublic *them, const BIGNUM *zkpg,
const JPakeParameters *params, int n, const char *suffix)
{
@@ -215,12 +216,12 @@ static int VerifyZKP(const JPakeZKP *zkp, BIGNUM *x,
BIGNUM *t3 = BN_new();
int ret = 0;
- zkpHash(h, zkp, x, them, params);
+ zkpHash(h, zkp, gx, them, params);
// t1 = g^b
BN_mod_exp(t1, zkpg, zkp->b, params->p, params->ctx);
// t2 = (g^x)^h = g^{hx}
- BN_mod_exp(t2, x, h, params->p, params->ctx);
+ BN_mod_exp(t2, gx, h, params->p, params->ctx);
// t3 = t1 * t2 = g^{hx} * g^b = g^{hx+b} = g^r (allegedly)
BN_mod_mul(t3, t1, t2, params->p, params->ctx);