Make all non-API functions (except main) static

This commit is contained in:
Pieter Wuille
2023-01-09 12:02:27 -05:00
parent cbe41ac138
commit e03ef86559
15 changed files with 230 additions and 233 deletions

View File

@@ -15,7 +15,7 @@ typedef struct {
unsigned char sig[64];
} bench_recover_data;
void bench_recover(void* arg, int iters) {
static void bench_recover(void* arg, int iters) {
int i;
bench_recover_data *data = (bench_recover_data*)arg;
secp256k1_pubkey pubkey;
@@ -36,7 +36,7 @@ void bench_recover(void* arg, int iters) {
}
}
void bench_recover_setup(void* arg) {
static void bench_recover_setup(void* arg) {
int i;
bench_recover_data *data = (bench_recover_data*)arg;
@@ -48,7 +48,7 @@ void bench_recover_setup(void* arg) {
}
}
void run_recovery_bench(int iters, int argc, char** argv) {
static void run_recovery_bench(int iters, int argc, char** argv) {
bench_recover_data data;
int d = argc == 1;

View File

@@ -10,7 +10,7 @@
#include "main_impl.h"
#include "../../../include/secp256k1_recovery.h"
void test_exhaustive_recovery_sign(const secp256k1_context *ctx, const secp256k1_ge *group) {
static void test_exhaustive_recovery_sign(const secp256k1_context *ctx, const secp256k1_ge *group) {
int i, j, k;
uint64_t iter = 0;
@@ -79,7 +79,7 @@ void test_exhaustive_recovery_sign(const secp256k1_context *ctx, const secp256k1
}
}
void test_exhaustive_recovery_verify(const secp256k1_context *ctx, const secp256k1_ge *group) {
static void test_exhaustive_recovery_verify(const secp256k1_context *ctx, const secp256k1_ge *group) {
/* This is essentially a copy of test_exhaustive_verify, with recovery added */
int s, r, msg, key;
uint64_t iter = 0;

View File

@@ -28,7 +28,7 @@ static int recovery_test_nonce_function(unsigned char *nonce32, const unsigned c
return secp256k1_testrand_bits(1);
}
void test_ecdsa_recovery_api(void) {
static void test_ecdsa_recovery_api(void) {
/* Setup contexts that just count errors */
secp256k1_pubkey pubkey;
secp256k1_pubkey recpubkey;
@@ -127,7 +127,7 @@ void test_ecdsa_recovery_api(void) {
secp256k1_context_set_illegal_callback(sttc, NULL, NULL);
}
void test_ecdsa_recovery_end_to_end(void) {
static void test_ecdsa_recovery_end_to_end(void) {
unsigned char extra[32] = {0x00};
unsigned char privkey[32];
unsigned char message[32];
@@ -186,7 +186,7 @@ void test_ecdsa_recovery_end_to_end(void) {
}
/* Tests several edge cases. */
void test_ecdsa_recovery_edge_cases(void) {
static void test_ecdsa_recovery_edge_cases(void) {
const unsigned char msg32[32] = {
'T', 'h', 'i', 's', ' ', 'i', 's', ' ',
'a', ' ', 'v', 'e', 'r', 'y', ' ', 's',
@@ -359,7 +359,7 @@ void test_ecdsa_recovery_edge_cases(void) {
}
}
void run_recovery_tests(void) {
static void run_recovery_tests(void) {
int i;
for (i = 0; i < count; i++) {
test_ecdsa_recovery_api();