Merge elementsproject/secp256k1-zkp#227: Use relative #include paths and tidy header guards (as in upstream)

e444d24bcad57091746784fcea6d07e95d058cd3 Fix include guards: No _ prefix/suffix but _H suffix (as in upstream) (Tim Ruffing)
0eea7d97abba0cc07515368981c6a30b96ab2428 Use relative #include paths in tests (as in upstream) (Tim Ruffing)
c690d6df700fe63529f7dc2fc02166d107c6b686 Use relative #include paths in benchmarks (as in upstream) (Tim Ruffing)
c565827c1a332c96253d35b85accae9cda4ef00d Use relative #include paths in ctime_test (as in upstream) (Tim Ruffing)
4eca406f4c71646d1812389d684219b481098b7d Use relative #include paths in library (as in upstream) (Tim Ruffing)

Pull request description:

ACKs for top commit:
  apoelstra:
    ACK e444d24bcad57091746784fcea6d07e95d058cd3
  jonasnick:
    ACK e444d24bcad57091746784fcea6d07e95d058cd3

Tree-SHA512: 4d125cf75748f4a921b70ca933ee59c3cf5c0845c6960e6915a322e53840cb3a0955fe5952e654d133ad36991f3268aeee44430cbd6f7d83e333a554c436f39b
This commit is contained in:
Jonas Nick 2023-04-23 07:50:24 +00:00
commit 78ed0e09ca
No known key found for this signature in database
GPG Key ID: 4861DBF262123605
40 changed files with 107 additions and 107 deletions

View File

@ -1,5 +1,5 @@
#ifndef _SECP256K1_BPPP_
# define _SECP256K1_BPPP_
#ifndef SECP256K1_BPPP_H
# define SECP256K1_BPPP_H
# include "secp256k1.h"

View File

@ -1,5 +1,5 @@
#ifndef _SECP256K1_GENERATOR_
# define _SECP256K1_GENERATOR_
#ifndef SECP256K1_GENERATOR_H
# define SECP256K1_GENERATOR_H
# include "secp256k1.h"

View File

@ -1,5 +1,5 @@
#ifndef _SECP256K1_RANGEPROOF_
# define _SECP256K1_RANGEPROOF_
#ifndef SECP256K1_RANGEPROOF_H
# define SECP256K1_RANGEPROOF_H
# include "secp256k1.h"
# include "secp256k1_generator.h"

View File

@ -1,5 +1,5 @@
#ifndef _SECP256K1_SURJECTIONPROOF_
#define _SECP256K1_SURJECTIONPROOF_
#ifndef SECP256K1_SURJECTIONPROOF_H
#define SECP256K1_SURJECTIONPROOF_H
#include "secp256k1.h"
#include "secp256k1_rangeproof.h"

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef _SECP256K1_WHITELIST_
#define _SECP256K1_WHITELIST_
#ifndef SECP256K1_WHITELIST_H
#define SECP256K1_WHITELIST_H
#include "secp256k1.h"

View File

@ -6,7 +6,7 @@
#include <stdint.h>
#include "include/secp256k1_bppp.h"
#include "../include/secp256k1_bppp.h"
#include "util.h"
#include "bench.h"

View File

@ -7,7 +7,7 @@
#include <stdint.h>
#include <string.h>
#include "include/secp256k1_generator.h"
#include "../include/secp256k1_generator.h"
#include "util.h"
#include "bench.h"

View File

@ -6,7 +6,7 @@
#include <stdint.h>
#include "include/secp256k1_rangeproof.h"
#include "../include/secp256k1_rangeproof.h"
#include "util.h"
#include "bench.h"

View File

@ -5,9 +5,9 @@
**********************************************************************/
#include <stdio.h>
#include "include/secp256k1.h"
#include "../include/secp256k1.h"
#include "include/secp256k1_whitelist.h"
#include "../include/secp256k1_whitelist.h"
#include "util.h"
#include "bench.h"
#include "hash_impl.h"

View File

@ -4,18 +4,18 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef _SECP256K1_MODULE_BPPP_PP_NORM_PRODUCT_
#define _SECP256K1_MODULE_BPPP_PP_NORM_PRODUCT_
#ifndef SECP256K1_MODULE_BPPP_PP_NORM_PRODUCT_H
#define SECP256K1_MODULE_BPPP_PP_NORM_PRODUCT_H
#include "group.h"
#include "scalar.h"
#include "ecmult.h"
#include "ecmult_gen.h"
#include "hash.h"
#include "../../group.h"
#include "../../scalar.h"
#include "../../ecmult.h"
#include "../../ecmult_gen.h"
#include "../../hash.h"
#include "modules/bppp/main.h"
#include "modules/bppp/bppp_util.h"
#include "modules/bppp/bppp_transcript_impl.h"
#include "../bppp/main.h"
#include "../bppp/bppp_util.h"
#include "../bppp/bppp_transcript_impl.h"
/* Computes the inner product of two vectors of scalars
* with elements starting from offset a and offset b

View File

@ -3,11 +3,11 @@
* Distributed under the MIT software license, see the accompanying *
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef _SECP256K1_MODULE_BPPP_PP_TRANSCRIPT_IMPL_
#define _SECP256K1_MODULE_BPPP_PP_TRANSCRIPT_IMPL_
#ifndef SECP256K1_MODULE_BPPP_PP_TRANSCRIPT_IMPL_H
#define SECP256K1_MODULE_BPPP_PP_TRANSCRIPT_IMPL_H
#include "group.h"
#include "scalar.h"
#include "../../group.h"
#include "../../scalar.h"
#include "bppp_util.h"
/* Initializes SHA256 with fixed midstate. This midstate was computed by applying

View File

@ -4,13 +4,13 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef _SECP256K1_MODULE_BPPP_UTIL_
#define _SECP256K1_MODULE_BPPP_UTIL_
#ifndef SECP256K1_MODULE_BPPP_UTIL_H
#define SECP256K1_MODULE_BPPP_UTIL_H
#include "field.h"
#include "group.h"
#include "hash.h"
#include "eckey.h"
#include "../../field.h"
#include "../../group.h"
#include "../../hash.h"
#include "../../eckey.h"
/* Outputs a pair of points, amortizing the parity byte between them
* Assumes both points' coordinates have been normalized.

View File

@ -4,16 +4,16 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef _SECP256K1_MODULE_BPPP_MAIN_
#define _SECP256K1_MODULE_BPPP_MAIN_
#ifndef SECP256K1_MODULE_BPPP_MAIN_IMPL_H
#define SECP256K1_MODULE_BPPP_MAIN_IMPL_H
#include "include/secp256k1_bppp.h"
#include "include/secp256k1_generator.h"
#include "modules/generator/main_impl.h" /* for generator_{load, save} */
#include "hash.h"
#include "util.h"
#include "modules/bppp/main.h"
#include "modules/bppp/bppp_norm_product_impl.h"
#include "../../../include/secp256k1_bppp.h"
#include "../../../include/secp256k1_generator.h"
#include "../generator/main_impl.h" /* for generator_{load, save} */
#include "../../hash.h"
#include "../../util.h"
#include "../bppp/main.h"
#include "../bppp/bppp_norm_product_impl.h"
secp256k1_bppp_generators *secp256k1_bppp_generators_create(const secp256k1_context *ctx, size_t n) {
secp256k1_bppp_generators *ret;

View File

@ -4,12 +4,12 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef _SECP256K1_MODULE_BPPP_TEST_
#define _SECP256K1_MODULE_BPPP_TEST_
#ifndef SECP256K1_MODULE_BPPP_TEST_H
#define SECP256K1_MODULE_BPPP_TEST_H
#include <stdint.h>
#include "include/secp256k1_bppp.h"
#include "../../../include/secp256k1_bppp.h"
#include "bppp_norm_product_impl.h"
#include "bppp_util.h"
#include "bppp_transcript_impl.h"

View File

@ -4,8 +4,8 @@
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
***********************************************************************/
#ifndef SECP256K1_HSORT_H_
#define SECP256K1_HSORT_H_
#ifndef SECP256K1_HSORT_H
#define SECP256K1_HSORT_H
#include <stddef.h>
#include <string.h>

View File

@ -4,8 +4,8 @@
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
***********************************************************************/
#ifndef SECP256K1_HSORT_IMPL_H_
#define SECP256K1_HSORT_IMPL_H_
#ifndef SECP256K1_HSORT_IMPL_H
#define SECP256K1_HSORT_IMPL_H
#include "hsort.h"

View File

@ -7,8 +7,8 @@
#ifndef SECP256K1_MODULE_EXTRAKEYS_TESTS_EXHAUSTIVE_H
#define SECP256K1_MODULE_EXTRAKEYS_TESTS_EXHAUSTIVE_H
#include "src/modules/extrakeys/main_impl.h"
#include "../../../include/secp256k1_extrakeys.h"
#include "main_impl.h"
static void test_exhaustive_extrakeys(const secp256k1_context *ctx, const secp256k1_ge* group) {
secp256k1_keypair keypair[EXHAUSTIVE_TEST_ORDER - 1];

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef SECP256K1_MODULE_GENERATOR_MAIN
#define SECP256K1_MODULE_GENERATOR_MAIN
#ifndef SECP256K1_MODULE_GENERATOR_MAIN_H
#define SECP256K1_MODULE_GENERATOR_MAIN_H
#include <stdio.h>
@ -14,7 +14,7 @@
#include "../../hash.h"
#include "../../scalar.h"
#include "modules/generator/pedersen_impl.h"
#include "../generator/pedersen_impl.h"
/** Alternative generator for secp256k1.
* This is the sha256 of 'g' after standard encoding (without compression),

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef _SECP256K1_PEDERSEN_H_
#define _SECP256K1_PEDERSEN_H_
#ifndef SECP256K1_PEDERSEN_H
#define SECP256K1_PEDERSEN_H
#include "../../ecmult_gen.h"
#include "../../group.h"

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php. *
***********************************************************************/
#ifndef _SECP256K1_PEDERSEN_IMPL_H_
#define _SECP256K1_PEDERSEN_IMPL_H_
#ifndef SECP256K1_PEDERSEN_IMPL_H
#define SECP256K1_PEDERSEN_IMPL_H
#include <string.h>

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef SECP256K1_MODULE_GENERATOR_TESTS
#define SECP256K1_MODULE_GENERATOR_TESTS
#ifndef SECP256K1_MODULE_GENERATOR_TESTS_H
#define SECP256K1_MODULE_GENERATOR_TESTS_H
#include <string.h>
#include <stdio.h>

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef SECP256K1_MODULE_MUSIG_MAIN
#define SECP256K1_MODULE_MUSIG_MAIN
#ifndef SECP256K1_MODULE_MUSIG_MAIN_H
#define SECP256K1_MODULE_MUSIG_MAIN_H
#include "keyagg_impl.h"
#include "session_impl.h"

View File

@ -5,8 +5,8 @@
**********************************************************************/
#ifndef _SECP256K1_BORROMEAN_H_
#define _SECP256K1_BORROMEAN_H_
#ifndef SECP256K1_BORROMEAN_H
#define SECP256K1_BORROMEAN_H
#include "../../scalar.h"
#include "../../field.h"

View File

@ -5,8 +5,8 @@
**********************************************************************/
#ifndef _SECP256K1_BORROMEAN_IMPL_H_
#define _SECP256K1_BORROMEAN_IMPL_H_
#ifndef SECP256K1_BORROMEAN_IMPL_H
#define SECP256K1_BORROMEAN_IMPL_H
#include "../../scalar.h"
#include "../../field.h"

View File

@ -4,14 +4,14 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef SECP256K1_MODULE_RANGEPROOF_MAIN
#define SECP256K1_MODULE_RANGEPROOF_MAIN
#ifndef SECP256K1_MODULE_RANGEPROOF_MAIN_H
#define SECP256K1_MODULE_RANGEPROOF_MAIN_H
#include "../../group.h"
#include "modules/generator/main_impl.h"
#include "modules/rangeproof/borromean_impl.h"
#include "modules/rangeproof/rangeproof_impl.h"
#include "../generator/main_impl.h"
#include "../rangeproof/borromean_impl.h"
#include "../rangeproof/rangeproof_impl.h"
int secp256k1_rangeproof_info(const secp256k1_context* ctx, int *exp, int *mantissa,
uint64_t *min_value, uint64_t *max_value, const unsigned char *proof, size_t plen) {

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef _SECP256K1_RANGEPROOF_H_
#define _SECP256K1_RANGEPROOF_H_
#ifndef SECP256K1_RANGEPROOF_H
#define SECP256K1_RANGEPROOF_H
#include "../../scalar.h"
#include "../../group.h"

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef _SECP256K1_RANGEPROOF_IMPL_H_
#define _SECP256K1_RANGEPROOF_IMPL_H_
#ifndef SECP256K1_RANGEPROOF_IMPL_H
#define SECP256K1_RANGEPROOF_IMPL_H
#include "../../eckey.h"
#include "../../scalar.h"
@ -13,9 +13,9 @@
#include "../../hash_impl.h"
#include "../../util.h"
#include "modules/generator/pedersen.h"
#include "modules/rangeproof/borromean.h"
#include "modules/rangeproof/rangeproof.h"
#include "../generator/pedersen.h"
#include "../rangeproof/borromean.h"
#include "../rangeproof/rangeproof.h"
SECP256K1_INLINE static void secp256k1_rangeproof_pub_expand(secp256k1_gej *pubs,
int exp, size_t *rsizes, size_t rings, const secp256k1_ge* genp) {

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef SECP256K1_MODULE_RANGEPROOF_TESTS
#define SECP256K1_MODULE_RANGEPROOF_TESTS
#ifndef SECP256K1_MODULE_RANGEPROOF_TESTS_H
#define SECP256K1_MODULE_RANGEPROOF_TESTS_H
#include <string.h>

View File

@ -7,7 +7,7 @@
#ifndef SECP256K1_MODULE_RECOVERY_EXHAUSTIVE_TESTS_H
#define SECP256K1_MODULE_RECOVERY_EXHAUSTIVE_TESTS_H
#include "src/modules/recovery/main_impl.h"
#include "main_impl.h"
#include "../../../include/secp256k1_recovery.h"
void test_exhaustive_recovery_sign(const secp256k1_context *ctx, const secp256k1_ge *group) {

View File

@ -8,7 +8,7 @@
#define SECP256K1_MODULE_SCHNORRSIG_TESTS_EXHAUSTIVE_H
#include "../../../include/secp256k1_schnorrsig.h"
#include "src/modules/schnorrsig/main_impl.h"
#include "main_impl.h"
static const unsigned char invalid_pubkey_bytes[][32] = {
/* 0 */

View File

@ -3,14 +3,14 @@
* Distributed under the MIT software license, see the accompanying *
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef SECP256K1_MODULE_SURJECTION_MAIN
#define SECP256K1_MODULE_SURJECTION_MAIN
#ifndef SECP256K1_MODULE_SURJECTION_MAIN_H
#define SECP256K1_MODULE_SURJECTION_MAIN_H
#include <assert.h>
#include <string.h>
#if defined HAVE_CONFIG_H
#include "libsecp256k1-config.h"
#include "../../libsecp256k1-config.h"
#endif
#include "../../../include/secp256k1_rangeproof.h"

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef _SECP256K1_SURJECTION_H_
#define _SECP256K1_SURJECTION_H_
#ifndef SECP256K1_SURJECTION_H
#define SECP256K1_SURJECTION_H
#include "../../group.h"
#include "../../scalar.h"

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef _SECP256K1_SURJECTION_IMPL_H_
#define _SECP256K1_SURJECTION_IMPL_H_
#ifndef SECP256K1_SURJECTION_IMPL_H
#define SECP256K1_SURJECTION_IMPL_H
#include <assert.h>
#include <string.h>

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef SECP256K1_MODULE_SURJECTIONPROOF_TESTS
#define SECP256K1_MODULE_SURJECTIONPROOF_TESTS
#ifndef SECP256K1_MODULE_SURJECTIONPROOF_TESTS_H
#define SECP256K1_MODULE_SURJECTIONPROOF_TESTS_H
#include "../../testrand.h"
#include "../../group.h"

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef SECP256K1_MODULE_WHITELIST_MAIN
#define SECP256K1_MODULE_WHITELIST_MAIN
#ifndef SECP256K1_MODULE_WHITELIST_MAIN_H
#define SECP256K1_MODULE_WHITELIST_MAIN_H
#include "../../../include/secp256k1_whitelist.h"
#include "whitelist_impl.h"

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef SECP256K1_MODULE_WHITELIST_TESTS
#define SECP256K1_MODULE_WHITELIST_TESTS
#ifndef SECP256K1_MODULE_WHITELIST_TESTS_H
#define SECP256K1_MODULE_WHITELIST_TESTS_H
#include "../../../include/secp256k1_whitelist.h"

View File

@ -4,8 +4,8 @@
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
#ifndef _SECP256K1_WHITELIST_IMPL_H_
#define _SECP256K1_WHITELIST_IMPL_H_
#ifndef SECP256K1_WHITELIST_IMPL_H
#define SECP256K1_WHITELIST_IMPL_H
static int secp256k1_whitelist_hash_pubkey(secp256k1_scalar* output, secp256k1_gej* pubkey) {
unsigned char h[32];

View File

@ -33,15 +33,15 @@
#endif
#ifdef ENABLE_MODULE_GENERATOR
# include "include/secp256k1_generator.h"
# include "../include/secp256k1_generator.h"
#endif
#ifdef ENABLE_MODULE_RANGEPROOF
# include "include/secp256k1_rangeproof.h"
# include "../include/secp256k1_rangeproof.h"
#endif
#ifdef ENABLE_MODULE_ECDSA_S2C
# include "include/secp256k1_ecdsa_s2c.h"
# include "../include/secp256k1_ecdsa_s2c.h"
static void secp256k1_ecdsa_s2c_opening_save(secp256k1_ecdsa_s2c_opening* opening, secp256k1_ge* ge);
#else
typedef void secp256k1_ecdsa_s2c_opening;

View File

@ -342,15 +342,15 @@ void test_exhaustive_sign(const secp256k1_context *ctx, const secp256k1_ge *grou
}
#ifdef ENABLE_MODULE_RECOVERY
#include "src/modules/recovery/tests_exhaustive_impl.h"
#include "modules/recovery/tests_exhaustive_impl.h"
#endif
#ifdef ENABLE_MODULE_EXTRAKEYS
#include "src/modules/extrakeys/tests_exhaustive_impl.h"
#include "modules/extrakeys/tests_exhaustive_impl.h"
#endif
#ifdef ENABLE_MODULE_SCHNORRSIG
#include "src/modules/schnorrsig/tests_exhaustive_impl.h"
#include "modules/schnorrsig/tests_exhaustive_impl.h"
#endif
int main(int argc, char** argv) {

View File

@ -29,15 +29,15 @@
#endif
#ifdef ENABLE_MODULE_ECDSA_S2C
#include "include/secp256k1_ecdsa_s2c.h"
#include "../include/secp256k1_ecdsa_s2c.h"
#endif
#ifdef ENABLE_MODULE_ECDSA_ADAPTOR
#include "include/secp256k1_ecdsa_adaptor.h"
#include "../include/secp256k1_ecdsa_adaptor.h"
#endif
#ifdef ENABLE_MODULE_MUSIG
#include "include/secp256k1_musig.h"
#include "../include/secp256k1_musig.h"
#endif
void run_tests(secp256k1_context *ctx, unsigned char *key);