Browse Source

Make local functions static.

Partially fixes build with -Wmissing-prototypes -Wmissing-declarations.

Change-Id: I6048f5b7ef31560399b25ed9880156bc7d8abac2
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Reviewed-on: https://boringssl-review.googlesource.com/7511
Reviewed-by: David Benjamin <davidben@google.com>
kris/onging/CECPQ3_patch15
Piotr Sikora 8 years ago
committed by David Benjamin
parent
commit
9bb8ba6ba1
11 changed files with 37 additions and 27 deletions
  1. +1
    -1
      crypto/asn1/asn1_test.cc
  2. +1
    -1
      crypto/bio/pair.c
  3. +2
    -1
      crypto/bn/mul.c
  4. +1
    -1
      crypto/conf/conf.c
  5. +2
    -2
      crypto/ec/ec_test.cc
  6. +1
    -1
      crypto/ec/example_mul.c
  7. +10
    -7
      crypto/ec/p224-64.c
  8. +10
    -7
      crypto/ec/p256-64.c
  9. +2
    -2
      crypto/rsa/padding.c
  10. +6
    -3
      ssl/ssl_ecdh.c
  11. +1
    -1
      tool/tool.cc

+ 1
- 1
crypto/asn1/asn1_test.cc View File

@@ -40,7 +40,7 @@ static const uint8_t kTagOverflow[] = {
0x1f, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01, 0x00,
};

bool TestLargeTags() {
static bool TestLargeTags() {
const uint8_t *p = kTag258;
ScopedASN1_TYPE obj(d2i_ASN1_TYPE(NULL, &p, sizeof(kTag258)));
if (obj) {


+ 1
- 1
crypto/bio/pair.c View File

@@ -742,7 +742,7 @@ static const BIO_METHOD methods_biop = {
bio_free, NULL /* no bio_callback_ctrl */
};

const BIO_METHOD *bio_s_bio(void) { return &methods_biop; }
static const BIO_METHOD *bio_s_bio(void) { return &methods_biop; }

int BIO_new_bio_pair(BIO** bio1_p, size_t writebuf1,
BIO** bio2_p, size_t writebuf2) {


+ 2
- 1
crypto/bn/mul.c View File

@@ -66,7 +66,8 @@
#define BN_SQR_RECURSIVE_SIZE_NORMAL BN_MUL_RECURSIVE_SIZE_NORMAL


void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) {
static void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b,
int nb) {
BN_ULONG *rr;

if (na < nb) {


+ 1
- 1
crypto/conf/conf.c View File

@@ -152,7 +152,7 @@ void NCONF_free(CONF *conf) {
OPENSSL_free(conf);
}

CONF_VALUE *NCONF_new_section(const CONF *conf, const char *section) {
static CONF_VALUE *NCONF_new_section(const CONF *conf, const char *section) {
STACK_OF(CONF_VALUE) *sk = NULL;
int ok = 0;
CONF_VALUE *v = NULL, *old_value;


+ 2
- 2
crypto/ec/ec_test.cc View File

@@ -122,7 +122,7 @@ static bool EncodeECPrivateKey(std::vector<uint8_t> *out, const EC_KEY *key) {
return true;
}

bool Testd2i_ECPrivateKey() {
static bool Testd2i_ECPrivateKey() {
ScopedEC_KEY key = DecodeECPrivateKey(kECKeyWithoutPublic,
sizeof(kECKeyWithoutPublic));
if (!key) {
@@ -438,7 +438,7 @@ static bool TestArbitraryCurve() {
return true;
}

bool TestAddingEqualPoints(int nid) {
static bool TestAddingEqualPoints(int nid) {
ScopedEC_KEY key(EC_KEY_new_by_curve_name(nid));
if (!key) {
return false;


+ 1
- 1
crypto/ec/example_mul.c View File

@@ -73,7 +73,7 @@
#include <openssl/obj.h>


int example_EC_POINT_mul(void) {
static int example_EC_POINT_mul(void) {
/* This example ensures that 10×∞ + G = G, in P-256. */
EC_GROUP *group = NULL;
EC_POINT *p = NULL, *result = NULL;


+ 10
- 7
crypto/ec/p224-64.c View File

@@ -982,10 +982,10 @@ static void batch_mul(felem x_out, felem y_out, felem z_out,

/* Takes the Jacobian coordinates (X, Y, Z) of a point and returns
* (X', Y') = (X/Z^2, Y/Z^3) */
int ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP *group,
const EC_POINT *point,
BIGNUM *x, BIGNUM *y,
BN_CTX *ctx) {
static int ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP *group,
const EC_POINT *point,
BIGNUM *x, BIGNUM *y,
BN_CTX *ctx) {
felem z1, z2, x_in, y_in, x_out, y_out;
widefelem tmp;

@@ -1024,9 +1024,12 @@ int ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP *group,
return 1;
}

int ec_GFp_nistp224_points_mul(const EC_GROUP *group, EC_POINT *r,
const BIGNUM *g_scalar, const EC_POINT *p_,
const BIGNUM *p_scalar_, BN_CTX *ctx) {
static int ec_GFp_nistp224_points_mul(const EC_GROUP *group,
EC_POINT *r,
const BIGNUM *g_scalar,
const EC_POINT *p_,
const BIGNUM *p_scalar_,
BN_CTX *ctx) {
/* TODO: This function used to take |points| and |scalars| as arrays of
* |num| elements. The code below should be simplified to work in terms of
* |p_| and |p_scalar_|. */


+ 10
- 7
crypto/ec/p256-64.c View File

@@ -1536,10 +1536,10 @@ static void batch_mul(felem x_out, felem y_out, felem z_out,

/* Takes the Jacobian coordinates (X, Y, Z) of a point and returns (X', Y') =
* (X/Z^2, Y/Z^3). */
int ec_GFp_nistp256_point_get_affine_coordinates(const EC_GROUP *group,
const EC_POINT *point,
BIGNUM *x, BIGNUM *y,
BN_CTX *ctx) {
static int ec_GFp_nistp256_point_get_affine_coordinates(const EC_GROUP *group,
const EC_POINT *point,
BIGNUM *x, BIGNUM *y,
BN_CTX *ctx) {
felem z1, z2, x_in, y_in;
smallfelem x_out, y_out;
longfelem tmp;
@@ -1575,9 +1575,12 @@ int ec_GFp_nistp256_point_get_affine_coordinates(const EC_GROUP *group,
return 1;
}

int ec_GFp_nistp256_points_mul(const EC_GROUP *group, EC_POINT *r,
const BIGNUM *g_scalar, const EC_POINT *p_,
const BIGNUM *p_scalar_, BN_CTX *ctx) {
static int ec_GFp_nistp256_points_mul(const EC_GROUP *group,
EC_POINT *r,
const BIGNUM *g_scalar,
const EC_POINT *p_,
const BIGNUM *p_scalar_,
BN_CTX *ctx) {
/* TODO: This function used to take |points| and |scalars| as arrays of
* |num| elements. The code below should be simplified to work in terms of |p|
* and |p_scalar|. */


+ 2
- 2
crypto/rsa/padding.c View File

@@ -274,8 +274,8 @@ int RSA_padding_add_none(uint8_t *to, unsigned to_len, const uint8_t *from,
return 1;
}

int PKCS1_MGF1(uint8_t *mask, unsigned len, const uint8_t *seed,
unsigned seedlen, const EVP_MD *dgst) {
static int PKCS1_MGF1(uint8_t *mask, unsigned len, const uint8_t *seed,
unsigned seedlen, const EVP_MD *dgst) {
unsigned outlen = 0;
uint32_t i;
uint8_t cnt[4];


+ 6
- 3
ssl/ssl_ecdh.c View File

@@ -84,9 +84,12 @@ err:
return ret;
}

int ssl_ec_point_compute_secret(SSL_ECDH_CTX *ctx, uint8_t **out_secret,
size_t *out_secret_len, uint8_t *out_alert,
const uint8_t *peer_key, size_t peer_key_len) {
static int ssl_ec_point_compute_secret(SSL_ECDH_CTX *ctx,
uint8_t **out_secret,
size_t *out_secret_len,
uint8_t *out_alert,
const uint8_t *peer_key,
size_t peer_key_len) {
BIGNUM *private_key = (BIGNUM *)ctx->data;
assert(private_key != NULL);
*out_alert = SSL_AD_INTERNAL_ERROR;


+ 1
- 1
tool/tool.cc View File

@@ -83,7 +83,7 @@ static void usage(const char *name) {
}
}

tool_func_t FindTool(const std::string &name) {
static tool_func_t FindTool(const std::string &name) {
for (size_t i = 0;; i++) {
const Tool &tool = kTools[i];
if (tool.func == nullptr || name == tool.name) {


Loading…
Cancel
Save