change local lib headers to be relative for those pointing at "include/" dir
added relative paths to header files imported from src directory added include guards for contrib/ files when referring to secp256k1.h
This commit is contained in:
parent
d0bd2693e3
commit
3c90bdda95
@ -5,7 +5,6 @@
|
|||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <secp256k1.h>
|
|
||||||
|
|
||||||
#include "lax_der_parsing.h"
|
#include "lax_der_parsing.h"
|
||||||
|
|
||||||
|
@ -51,7 +51,9 @@
|
|||||||
#ifndef SECP256K1_CONTRIB_LAX_DER_PARSING_H
|
#ifndef SECP256K1_CONTRIB_LAX_DER_PARSING_H
|
||||||
#define SECP256K1_CONTRIB_LAX_DER_PARSING_H
|
#define SECP256K1_CONTRIB_LAX_DER_PARSING_H
|
||||||
|
|
||||||
|
#ifndef SECP256K1_H
|
||||||
#include <secp256k1.h>
|
#include <secp256k1.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <secp256k1.h>
|
|
||||||
|
|
||||||
#include "lax_der_privatekey_parsing.h"
|
#include "lax_der_privatekey_parsing.h"
|
||||||
|
|
||||||
|
@ -28,7 +28,9 @@
|
|||||||
#ifndef SECP256K1_CONTRIB_BER_PRIVATEKEY_H
|
#ifndef SECP256K1_CONTRIB_BER_PRIVATEKEY_H
|
||||||
#define SECP256K1_CONTRIB_BER_PRIVATEKEY_H
|
#define SECP256K1_CONTRIB_BER_PRIVATEKEY_H
|
||||||
|
|
||||||
|
#ifndef SECP256K1_H
|
||||||
#include <secp256k1.h>
|
#include <secp256k1.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "include/secp256k1.h"
|
#include "../include/secp256k1.h"
|
||||||
#include "include/secp256k1_ecdh.h"
|
#include "../include/secp256k1_ecdh.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "bench.h"
|
#include "bench.h"
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "secp256k1.c"
|
#include "secp256k1.c"
|
||||||
|
#include "../include/secp256k1.h"
|
||||||
|
|
||||||
#include "include/secp256k1.h"
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "hash_impl.h"
|
#include "hash_impl.h"
|
||||||
#include "field_impl.h"
|
#include "field_impl.h"
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "secp256k1.c"
|
#include "secp256k1.c"
|
||||||
|
#include "../include/secp256k1.h"
|
||||||
|
|
||||||
#include "include/secp256k1.h"
|
|
||||||
#include "assumptions.h"
|
#include "assumptions.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "hash_impl.h"
|
#include "hash_impl.h"
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
|
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include "include/secp256k1.h"
|
#include "../include/secp256k1.h"
|
||||||
#include "include/secp256k1_recovery.h"
|
#include "../include/secp256k1_recovery.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "bench.h"
|
#include "bench.h"
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
#include "include/secp256k1.h"
|
#include "../include/secp256k1.h"
|
||||||
#include "include/secp256k1_schnorrsig.h"
|
#include "../include/secp256k1_schnorrsig.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "bench.h"
|
#include "bench.h"
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
|
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include "include/secp256k1.h"
|
#include "../include/secp256k1.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "bench.h"
|
#include "bench.h"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "include/secp256k1.h"
|
#include "../include/secp256k1.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "bench.h"
|
#include "bench.h"
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
need to build the external ASM for the build and the host machine. */
|
need to build the external ASM for the build and the host machine. */
|
||||||
#undef USE_EXTERNAL_ASM
|
#undef USE_EXTERNAL_ASM
|
||||||
|
|
||||||
#include "include/secp256k1.h"
|
#include "../include/secp256k1.h"
|
||||||
#include "assumptions.h"
|
#include "assumptions.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "field_impl.h"
|
#include "field_impl.h"
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
#ifndef SECP256K1_MODULE_ECDH_MAIN_H
|
#ifndef SECP256K1_MODULE_ECDH_MAIN_H
|
||||||
#define SECP256K1_MODULE_ECDH_MAIN_H
|
#define SECP256K1_MODULE_ECDH_MAIN_H
|
||||||
|
|
||||||
#include "include/secp256k1_ecdh.h"
|
#include "../../../include/secp256k1_ecdh.h"
|
||||||
#include "ecmult_const_impl.h"
|
#include "../../ecmult_const_impl.h"
|
||||||
|
|
||||||
static int ecdh_hash_function_sha256(unsigned char *output, const unsigned char *x32, const unsigned char *y32, void *data) {
|
static int ecdh_hash_function_sha256(unsigned char *output, const unsigned char *x32, const unsigned char *y32, void *data) {
|
||||||
unsigned char version = (y32[31] & 0x01) | 0x02;
|
unsigned char version = (y32[31] & 0x01) | 0x02;
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
#ifndef SECP256K1_MODULE_EXTRAKEYS_MAIN_H
|
#ifndef SECP256K1_MODULE_EXTRAKEYS_MAIN_H
|
||||||
#define SECP256K1_MODULE_EXTRAKEYS_MAIN_H
|
#define SECP256K1_MODULE_EXTRAKEYS_MAIN_H
|
||||||
|
|
||||||
#include "include/secp256k1.h"
|
#include "../../../include/secp256k1.h"
|
||||||
#include "include/secp256k1_extrakeys.h"
|
#include "../../../include/secp256k1_extrakeys.h"
|
||||||
|
|
||||||
static SECP256K1_INLINE int secp256k1_xonly_pubkey_load(const secp256k1_context* ctx, secp256k1_ge *ge, const secp256k1_xonly_pubkey *pubkey) {
|
static SECP256K1_INLINE int secp256k1_xonly_pubkey_load(const secp256k1_context* ctx, secp256k1_ge *ge, const secp256k1_xonly_pubkey *pubkey) {
|
||||||
return secp256k1_pubkey_load(ctx, ge, (const secp256k1_pubkey *) pubkey);
|
return secp256k1_pubkey_load(ctx, ge, (const secp256k1_pubkey *) pubkey);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#define SECP256K1_MODULE_EXTRAKEYS_TESTS_EXHAUSTIVE_H
|
#define SECP256K1_MODULE_EXTRAKEYS_TESTS_EXHAUSTIVE_H
|
||||||
|
|
||||||
#include "src/modules/extrakeys/main_impl.h"
|
#include "src/modules/extrakeys/main_impl.h"
|
||||||
#include "include/secp256k1_extrakeys.h"
|
#include "../../../include/secp256k1_extrakeys.h"
|
||||||
|
|
||||||
static void test_exhaustive_extrakeys(const secp256k1_context *ctx, const secp256k1_ge* group) {
|
static void test_exhaustive_extrakeys(const secp256k1_context *ctx, const secp256k1_ge* group) {
|
||||||
secp256k1_keypair keypair[EXHAUSTIVE_TEST_ORDER - 1];
|
secp256k1_keypair keypair[EXHAUSTIVE_TEST_ORDER - 1];
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#ifndef SECP256K1_MODULE_EXTRAKEYS_TESTS_H
|
#ifndef SECP256K1_MODULE_EXTRAKEYS_TESTS_H
|
||||||
#define SECP256K1_MODULE_EXTRAKEYS_TESTS_H
|
#define SECP256K1_MODULE_EXTRAKEYS_TESTS_H
|
||||||
|
|
||||||
#include "secp256k1_extrakeys.h"
|
#include "../../../include/secp256k1_extrakeys.h"
|
||||||
|
|
||||||
static secp256k1_context* api_test_context(int flags, int *ecount) {
|
static secp256k1_context* api_test_context(int flags, int *ecount) {
|
||||||
secp256k1_context *ctx0 = secp256k1_context_create(flags);
|
secp256k1_context *ctx0 = secp256k1_context_create(flags);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#ifndef SECP256K1_MODULE_RECOVERY_MAIN_H
|
#ifndef SECP256K1_MODULE_RECOVERY_MAIN_H
|
||||||
#define SECP256K1_MODULE_RECOVERY_MAIN_H
|
#define SECP256K1_MODULE_RECOVERY_MAIN_H
|
||||||
|
|
||||||
#include "include/secp256k1_recovery.h"
|
#include "../../../include/secp256k1_recovery.h"
|
||||||
|
|
||||||
static void secp256k1_ecdsa_recoverable_signature_load(const secp256k1_context* ctx, secp256k1_scalar* r, secp256k1_scalar* s, int* recid, const secp256k1_ecdsa_recoverable_signature* sig) {
|
static void secp256k1_ecdsa_recoverable_signature_load(const secp256k1_context* ctx, secp256k1_scalar* r, secp256k1_scalar* s, int* recid, const secp256k1_ecdsa_recoverable_signature* sig) {
|
||||||
(void)ctx;
|
(void)ctx;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#define SECP256K1_MODULE_RECOVERY_EXHAUSTIVE_TESTS_H
|
#define SECP256K1_MODULE_RECOVERY_EXHAUSTIVE_TESTS_H
|
||||||
|
|
||||||
#include "src/modules/recovery/main_impl.h"
|
#include "src/modules/recovery/main_impl.h"
|
||||||
#include "include/secp256k1_recovery.h"
|
#include "../../../include/secp256k1_recovery.h"
|
||||||
|
|
||||||
void test_exhaustive_recovery_sign(const secp256k1_context *ctx, const secp256k1_ge *group) {
|
void test_exhaustive_recovery_sign(const secp256k1_context *ctx, const secp256k1_ge *group) {
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
#ifndef SECP256K1_MODULE_SCHNORRSIG_MAIN_H
|
#ifndef SECP256K1_MODULE_SCHNORRSIG_MAIN_H
|
||||||
#define SECP256K1_MODULE_SCHNORRSIG_MAIN_H
|
#define SECP256K1_MODULE_SCHNORRSIG_MAIN_H
|
||||||
|
|
||||||
#include "include/secp256k1.h"
|
#include "../../../include/secp256k1.h"
|
||||||
#include "include/secp256k1_schnorrsig.h"
|
#include "../../../include/secp256k1_schnorrsig.h"
|
||||||
#include "hash.h"
|
#include "../../hash.h"
|
||||||
|
|
||||||
/* Initializes SHA256 with fixed midstate. This midstate was computed by applying
|
/* Initializes SHA256 with fixed midstate. This midstate was computed by applying
|
||||||
* SHA256 to SHA256("BIP0340/nonce")||SHA256("BIP0340/nonce"). */
|
* SHA256 to SHA256("BIP0340/nonce")||SHA256("BIP0340/nonce"). */
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#ifndef SECP256K1_MODULE_SCHNORRSIG_TESTS_EXHAUSTIVE_H
|
#ifndef SECP256K1_MODULE_SCHNORRSIG_TESTS_EXHAUSTIVE_H
|
||||||
#define SECP256K1_MODULE_SCHNORRSIG_TESTS_EXHAUSTIVE_H
|
#define SECP256K1_MODULE_SCHNORRSIG_TESTS_EXHAUSTIVE_H
|
||||||
|
|
||||||
#include "include/secp256k1_schnorrsig.h"
|
#include "../../../include/secp256k1_schnorrsig.h"
|
||||||
#include "src/modules/schnorrsig/main_impl.h"
|
#include "src/modules/schnorrsig/main_impl.h"
|
||||||
|
|
||||||
static const unsigned char invalid_pubkey_bytes[][32] = {
|
static const unsigned char invalid_pubkey_bytes[][32] = {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#ifndef SECP256K1_MODULE_SCHNORRSIG_TESTS_H
|
#ifndef SECP256K1_MODULE_SCHNORRSIG_TESTS_H
|
||||||
#define SECP256K1_MODULE_SCHNORRSIG_TESTS_H
|
#define SECP256K1_MODULE_SCHNORRSIG_TESTS_H
|
||||||
|
|
||||||
#include "secp256k1_schnorrsig.h"
|
#include "../../../include/secp256k1_schnorrsig.h"
|
||||||
|
|
||||||
/* Checks that a bit flip in the n_flip-th argument (that has n_bytes many
|
/* Checks that a bit flip in the n_flip-th argument (that has n_bytes many
|
||||||
* bytes) changes the hash function
|
* bytes) changes the hash function
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
#define SECP256K1_BUILD
|
#define SECP256K1_BUILD
|
||||||
|
|
||||||
#include "include/secp256k1.h"
|
#include "../include/secp256k1.h"
|
||||||
#include "include/secp256k1_preallocated.h"
|
#include "../include/secp256k1_preallocated.h"
|
||||||
|
|
||||||
#include "assumptions.h"
|
#include "assumptions.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "secp256k1.c"
|
#include "secp256k1.c"
|
||||||
#include "include/secp256k1.h"
|
#include "../include/secp256k1.h"
|
||||||
#include "include/secp256k1_preallocated.h"
|
#include "../include/secp256k1_preallocated.h"
|
||||||
#include "testrand_impl.h"
|
#include "testrand_impl.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
@ -30,8 +30,8 @@ void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "contrib/lax_der_parsing.c"
|
#include "../contrib/lax_der_parsing.c"
|
||||||
#include "contrib/lax_der_privatekey_parsing.c"
|
#include "../contrib/lax_der_privatekey_parsing.c"
|
||||||
|
|
||||||
#include "modinv32_impl.h"
|
#include "modinv32_impl.h"
|
||||||
#ifdef SECP256K1_WIDEMUL_INT128
|
#ifdef SECP256K1_WIDEMUL_INT128
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#undef USE_ECMULT_STATIC_PRECOMPUTATION
|
#undef USE_ECMULT_STATIC_PRECOMPUTATION
|
||||||
@ -21,7 +20,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "secp256k1.c"
|
#include "secp256k1.c"
|
||||||
#include "include/secp256k1.h"
|
#include "../include/secp256k1.h"
|
||||||
#include "assumptions.h"
|
#include "assumptions.h"
|
||||||
#include "group.h"
|
#include "group.h"
|
||||||
#include "testrand_impl.h"
|
#include "testrand_impl.h"
|
||||||
|
@ -7,24 +7,24 @@
|
|||||||
#include <valgrind/memcheck.h>
|
#include <valgrind/memcheck.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "include/secp256k1.h"
|
#include "../include/secp256k1.h"
|
||||||
#include "assumptions.h"
|
#include "assumptions.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#ifdef ENABLE_MODULE_ECDH
|
#ifdef ENABLE_MODULE_ECDH
|
||||||
# include "include/secp256k1_ecdh.h"
|
# include "../include/secp256k1_ecdh.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_MODULE_RECOVERY
|
#ifdef ENABLE_MODULE_RECOVERY
|
||||||
# include "include/secp256k1_recovery.h"
|
# include "../include/secp256k1_recovery.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_MODULE_EXTRAKEYS
|
#ifdef ENABLE_MODULE_EXTRAKEYS
|
||||||
# include "include/secp256k1_extrakeys.h"
|
# include "../include/secp256k1_extrakeys.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_MODULE_SCHNORRSIG
|
#ifdef ENABLE_MODULE_SCHNORRSIG
|
||||||
#include "include/secp256k1_schnorrsig.h"
|
#include "../include/secp256k1_schnorrsig.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void run_tests(secp256k1_context *ctx, unsigned char *key);
|
void run_tests(secp256k1_context *ctx, unsigned char *key);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user