Commit 5956b110 authored by Emilia Kasper's avatar Emilia Kasper
Browse files

NISTZ256: owur'ize.



__owur'ize static methods to catch calling errors within the module.

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent 6038354c
Loading
Loading
Loading
Loading
+20 −20
Original line number Diff line number Diff line
@@ -546,14 +546,14 @@ static void ecp_nistz256_mod_inverse(BN_ULONG r[P256_LIMBS],
 * ecp_nistz256_bignum_to_field_elem copies the contents of |in| to |out| and
 * returns one if it fits. Otherwise it returns zero.
 */
static int ecp_nistz256_bignum_to_field_elem(BN_ULONG out[P256_LIMBS],
__owur static int ecp_nistz256_bignum_to_field_elem(BN_ULONG out[P256_LIMBS],
                                                    const BIGNUM *in)
{
    return bn_copy_words(out, in, P256_LIMBS);
}

/* r = sum(scalar[i]*point[i]) */
static int ecp_nistz256_windowed_mul(const EC_GROUP *group,
__owur static int ecp_nistz256_windowed_mul(const EC_GROUP *group,
                                            P256_POINT *r,
                                            const BIGNUM **scalar,
                                            const EC_POINT **point,
@@ -755,7 +755,7 @@ static int ecp_nistz256_is_affine_G(const EC_POINT *generator)
        is_one(bn_get_words(generator->Z));
}

static int ecp_nistz256_mult_precompute(EC_GROUP *group, BN_CTX *ctx)
__owur static int ecp_nistz256_mult_precompute(EC_GROUP *group, BN_CTX *ctx)
{
    /*
     * We precompute a table for a Booth encoded exponent (wNAF) based
@@ -1097,7 +1097,7 @@ static void ecp_nistz256_avx2_mul_g(P256_POINT *r,
# endif
#endif

static int ecp_nistz256_set_from_affine(EC_POINT *out, const EC_GROUP *group,
__owur static int ecp_nistz256_set_from_affine(EC_POINT *out, const EC_GROUP *group,
                                               const P256_POINT_AFFINE *in,
                                               BN_CTX *ctx)
{
@@ -1130,7 +1130,7 @@ static int ecp_nistz256_set_from_affine(EC_POINT *out, const EC_GROUP *group,
}

/* r = scalar*G + sum(scalars[i]*points[i]) */
static int ecp_nistz256_points_mul(const EC_GROUP *group,
__owur static int ecp_nistz256_points_mul(const EC_GROUP *group,
                                          EC_POINT *r,
                                          const BIGNUM *scalar,
                                          size_t num,
@@ -1365,7 +1365,7 @@ err:
    return ret;
}

static int ecp_nistz256_get_affine(const EC_GROUP *group,
__owur static int ecp_nistz256_get_affine(const EC_GROUP *group,
                                          const EC_POINT *point,
                                          BIGNUM *x, BIGNUM *y, BN_CTX *ctx)
{