aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-09-07 18:12:35 +0100
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-09-07 18:12:35 +0100
commit611562806cf3fd3028e24e6c5a8e8dcb8805be38 (patch)
tree8664fa7a12899d879cab995b49d9457b22accf9d /src
parent41797f8ab9932279689b6731f8826f08db68ba16 (diff)
downloadbitcoin-611562806cf3fd3028e24e6c5a8e8dcb8805be38.tar.xz
Squashed 'src/secp256k1/' changes from 642c885b61..2f2ccc4695
2f2ccc4695 Merge bitcoin-core/secp256k1#1600: cmake: Introduce `SECP256K1_APPEND_LDFLAGS` variable 421ed1b46f cmake: Introduce `SECP256K1_APPEND_LDFLAGS` variable 1988855079 Merge bitcoin-core/secp256k1#1586: fix: remove duplicate 'the' from header file comment b307614401 Merge bitcoin-core/secp256k1#1583: ci: Bump GCC_SNAPSHOT_MAJOR to 15 fa67b6752d refactor: Use array initialization for unterminated strings 9b0f37bff1 fix: remove duplicate 'the' from header file comment e34b476730 ci: Bump GCC_SNAPSHOT_MAJOR to 15 3fdf146bad Merge bitcoin-core/secp256k1#1578: ci: Silent Homebrew's noisy reinstall warnings f8c1b0e0e6 Merge bitcoin-core/secp256k1#1577: release cleanup: bump version after 0.5.1 7057d3c9af ci: Silent Homebrew's noisy reinstall warnings c3e40d75db release cleanup: bump version after 0.5.1 git-subtree-dir: src/secp256k1 git-subtree-split: 2f2ccc469540fde6495959cec061e95aab033148
Diffstat (limited to 'src')
-rw-r--r--src/modules/ellswift/tests_impl.h6
-rw-r--r--src/modules/schnorrsig/main_impl.h2
-rw-r--r--src/modules/schnorrsig/tests_impl.h10
-rw-r--r--src/testrand_impl.h2
4 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/ellswift/tests_impl.h b/src/modules/ellswift/tests_impl.h
index ed5658f34c..3c314c9b50 100644
--- a/src/modules/ellswift/tests_impl.h
+++ b/src/modules/ellswift/tests_impl.h
@@ -406,9 +406,9 @@ void run_ellswift_tests(void) {
/* Test hash initializers. */
{
secp256k1_sha256 sha, sha_optimized;
- static const unsigned char encode_tag[25] = "secp256k1_ellswift_encode";
- static const unsigned char create_tag[25] = "secp256k1_ellswift_create";
- static const unsigned char bip324_tag[26] = "bip324_ellswift_xonly_ecdh";
+ static const unsigned char encode_tag[] = {'s', 'e', 'c', 'p', '2', '5', '6', 'k', '1', '_', 'e', 'l', 'l', 's', 'w', 'i', 'f', 't', '_', 'e', 'n', 'c', 'o', 'd', 'e'};
+ static const unsigned char create_tag[] = {'s', 'e', 'c', 'p', '2', '5', '6', 'k', '1', '_', 'e', 'l', 'l', 's', 'w', 'i', 'f', 't', '_', 'c', 'r', 'e', 'a', 't', 'e'};
+ static const unsigned char bip324_tag[] = {'b', 'i', 'p', '3', '2', '4', '_', 'e', 'l', 'l', 's', 'w', 'i', 'f', 't', '_', 'x', 'o', 'n', 'l', 'y', '_', 'e', 'c', 'd', 'h'};
/* Check that hash initialized by
* secp256k1_ellswift_sha256_init_encode has the expected
diff --git a/src/modules/schnorrsig/main_impl.h b/src/modules/schnorrsig/main_impl.h
index 26727e4651..57f7eadd3c 100644
--- a/src/modules/schnorrsig/main_impl.h
+++ b/src/modules/schnorrsig/main_impl.h
@@ -45,7 +45,7 @@ static void secp256k1_nonce_function_bip340_sha256_tagged_aux(secp256k1_sha256 *
/* algo argument for nonce_function_bip340 to derive the nonce exactly as stated in BIP-340
* by using the correct tagged hash function. */
-static const unsigned char bip340_algo[13] = "BIP0340/nonce";
+static const unsigned char bip340_algo[] = {'B', 'I', 'P', '0', '3', '4', '0', '/', 'n', 'o', 'n', 'c', 'e'};
static const unsigned char schnorrsig_extraparams_magic[4] = SECP256K1_SCHNORRSIG_EXTRAPARAMS_MAGIC;
diff --git a/src/modules/schnorrsig/tests_impl.h b/src/modules/schnorrsig/tests_impl.h
index aa4fc38270..2d716a01f8 100644
--- a/src/modules/schnorrsig/tests_impl.h
+++ b/src/modules/schnorrsig/tests_impl.h
@@ -21,9 +21,9 @@ static void nonce_function_bip340_bitflip(unsigned char **args, size_t n_flip, s
}
static void run_nonce_function_bip340_tests(void) {
- unsigned char tag[13] = "BIP0340/nonce";
- unsigned char aux_tag[11] = "BIP0340/aux";
- unsigned char algo[13] = "BIP0340/nonce";
+ unsigned char tag[] = {'B', 'I', 'P', '0', '3', '4', '0', '/', 'n', 'o', 'n', 'c', 'e'};
+ unsigned char aux_tag[] = {'B', 'I', 'P', '0', '3', '4', '0', '/', 'a', 'u', 'x'};
+ unsigned char algo[] = {'B', 'I', 'P', '0', '3', '4', '0', '/', 'n', 'o', 'n', 'c', 'e'};
size_t algolen = sizeof(algo);
secp256k1_sha256 sha;
secp256k1_sha256 sha_optimized;
@@ -158,7 +158,7 @@ static void test_schnorrsig_api(void) {
/* Checks that hash initialized by secp256k1_schnorrsig_sha256_tagged has the
* expected state. */
static void test_schnorrsig_sha256_tagged(void) {
- unsigned char tag[17] = "BIP0340/challenge";
+ unsigned char tag[] = {'B', 'I', 'P', '0', '3', '4', '0', '/', 'c', 'h', 'a', 'l', 'l', 'e', 'n', 'g', 'e'};
secp256k1_sha256 sha;
secp256k1_sha256 sha_optimized;
@@ -806,7 +806,7 @@ static void test_schnorrsig_sign(void) {
unsigned char sk[32];
secp256k1_xonly_pubkey pk;
secp256k1_keypair keypair;
- const unsigned char msg[32] = "this is a msg for a schnorrsig..";
+ const unsigned char msg[] = {'t', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 'm', 's', 'g', ' ', 'f', 'o', 'r', ' ', 'a', ' ', 's', 'c', 'h', 'n', 'o', 'r', 'r', 's', 'i', 'g', '.', '.'};
unsigned char sig[64];
unsigned char sig2[64];
unsigned char zeros64[64] = { 0 };
diff --git a/src/testrand_impl.h b/src/testrand_impl.h
index 07564f7f3f..b84f5730a9 100644
--- a/src/testrand_impl.h
+++ b/src/testrand_impl.h
@@ -18,7 +18,7 @@
static uint64_t secp256k1_test_state[4];
SECP256K1_INLINE static void testrand_seed(const unsigned char *seed16) {
- static const unsigned char PREFIX[19] = "secp256k1 test init";
+ static const unsigned char PREFIX[] = {'s', 'e', 'c', 'p', '2', '5', '6', 'k', '1', ' ', 't', 'e', 's', 't', ' ', 'i', 'n', 'i', 't'};
unsigned char out32[32];
secp256k1_sha256 hash;
int i;