Fixed the comment above the extra checks. Said (g^x)%q == 1 but should be (g^x)^q == 1 (mod p), which is what the code actually checks for 1.1.x
authorstefan
Thu, 27 Jan 2011 09:46:36 -0500
branch1.1.x
changeset 384 6449ee79d57fdeeec22476f2dab3fdfe39d6aefa
parent 383 cb9ab2d13e8a7adfbfd1f6ed843d1f9af9d22ca3
child 385 49d8193e96c7d683e26284e63f532391795250d8
push id214
push userstefan@arentz.ca
push dateThu, 27 Jan 2011 14:46:40 +0000
Fixed the comment above the extra checks. Said (g^x)%q == 1 but should be (g^x)^q == 1 (mod p), which is what the code actually checks for
ExternalSources/ios-jpake/Sources/jpake.c
--- a/ExternalSources/ios-jpake/Sources/jpake.c
+++ b/ExternalSources/ios-jpake/Sources/jpake.c
@@ -222,17 +222,17 @@ static int verify_zkp(const JPAKE_STEP_P
 	BIGNUM *p_minus_one = BN_new();
 	BIGNUM *zero = BN_new();
 
     int ret = 0;
 
     zkp_hash(h, zkpg, p, ctx->p.peer_name);
 	
    /*
-    * Check the following: g^x > 0, g^x < (p-1), (g^x)%q == 1
+    * Check the following: g^x > 0, g^x < (p-1), (g^x)^q == 1 (mod p)
 	* See https://github.com/seb-m/jpake
 	*/
 	
 	BN_mod_exp(gx_modexp_q_p, p->gx, ctx->p.q, ctx->p.p, ctx->ctx);
 	BN_sub(p_minus_one, ctx->p.p, BN_value_one());
 	BN_zero(zero);
 	
 	if ((BN_cmp(p->gx, zero) == 1) &&