More comments
[openssl.git] / crypto / jpake / jpake.c
index 736d3c0916d9e915c6c46e4609d56df4608c195d..10cca0d5445b4f6826e95c85c1ab05c8f7bb8daf 100644 (file)
@@ -1,9 +1,9 @@
-#include "jpake.h"
-
+#include <openssl/jpake.h>
 #include <openssl/crypto.h>
 #include <openssl/sha.h>
 #include <openssl/err.h>
 #include <memory.h>
+#include <string.h>
 
 /*
  * In the definition, (xa, xb, xc, xd) are Alice's (x1, x2, x3, x4) or
@@ -201,7 +201,7 @@ static int generate_zkp(JPAKE_STEP_PART *p, const BIGNUM *x,
     BIGNUM *h = BN_new();
     BIGNUM *t = BN_new();
 
-   /*
+   /*-
     * r in [0,q)
     * XXX: Java chooses r in [0, 2^160) - i.e. distribution not uniform
     */
@@ -370,7 +370,7 @@ int JPAKE_STEP2_generate(JPAKE_STEP2 *send, JPAKE_CTX *ctx)
     BIGNUM *t1 = BN_new();
     BIGNUM *t2 = BN_new();
 
-   /*
+   /*-
     * X = g^{(xa + xc + xd) * xb * s}
     * t1 = g^xa
     */
@@ -382,7 +382,7 @@ int JPAKE_STEP2_generate(JPAKE_STEP2 *send, JPAKE_CTX *ctx)
    /* t2 = xb * s */
     BN_mod_mul(t2, ctx->xb, ctx->secret, ctx->p.q, ctx->ctx);
 
-   /*
+   /*-
     * ZKP(xb * s)
     * XXX: this is kinda funky, because we're using
     *
@@ -407,7 +407,7 @@ static int compute_key(JPAKE_CTX *ctx, const BIGNUM *gx)
     BIGNUM *t2 = BN_new();
     BIGNUM *t3 = BN_new();
 
-   /*
+   /*-
     * K = (gx/g^{xb * xd * s})^{xb}
     *   = (g^{(xc + xa + xb) * xd * s - xb * xd *s})^{xb}
     *   = (g^{(xa + xc) * xd * s})^{xb}
@@ -440,7 +440,7 @@ int JPAKE_STEP2_process(JPAKE_CTX *ctx, const JPAKE_STEP2 *received)
     BIGNUM *t2 = BN_new();
     int ret = 0;
 
-   /*
+   /*-
     * g' = g^{xc + xa + xb} [from our POV]
     * t1 = xa + xb
     */