Add ECP_NISTZ256 by Shay Gueron, Intel Corp.
[oweals/openssl.git] / crypto / bn / bn_gcd.c
index 5fb8090c5278986a6d528fa702bab8367c2e3e48..a808f53178fb830572a6d8c2edb4eabb5063c844 100644 (file)
@@ -203,6 +203,9 @@ err:
 
 
 /* solves ax == 1 (mod n) */
+static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
+        const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
+
 BIGNUM *BN_mod_inverse(BIGNUM *in,
        const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
        {
@@ -501,7 +504,7 @@ err:
 /* BN_mod_inverse_no_branch is a special version of BN_mod_inverse. 
  * It does not contain branches that may leak sensitive information.
  */
-BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
+static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
        const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
        {
        BIGNUM *A,*B,*X,*Y,*M,*D,*T,*R=NULL;
@@ -640,7 +643,7 @@ BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
                }
        else
                {
-               BNerr(BN_F_BN_MOD_INVERSE,BN_R_NO_INVERSE);
+               BNerr(BN_F_BN_MOD_INVERSE_NO_BRANCH,BN_R_NO_INVERSE);
                goto err;
                }
        ret=R;