Alien-libsecp256k1

 view release on metacpan or  search on metacpan

libsecp256k1/build/CMakeCache.txt  view on Meta::CPAN

# This is the CMakeCache file.
# For build in directory: /home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build
# It was generated by CMake: /usr/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.

########################
# EXTERNAL cache entries
########################

libsecp256k1/build/CMakeCache.txt  view on Meta::CPAN

//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_DLLTOOL
CMAKE_DLLTOOL-ADVANCED:INTERNAL=1
//Path to cache edit program executable.
CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/ccmake
//Executable file format
CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_COVERAGE
CMAKE_EXE_LINKER_FLAGS_COVERAGE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL

libsecp256k1/build/CMakeFiles/TargetDirectories.txt  view on Meta::CPAN

/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/CMakeFiles/install/strip.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/CMakeFiles/install/local.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/CMakeFiles/install.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/CMakeFiles/list_install_components.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/CMakeFiles/rebuild_cache.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/CMakeFiles/edit_cache.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/CMakeFiles/test.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/install/local.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/install.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/secp256k1_precomputed.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/secp256k1.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/list_install_components.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/bench.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/test.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/rebuild_cache.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/bench_ecmult.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/edit_cache.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/noverify_tests.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/tests.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/install/strip.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/bench_internal.dir
/home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build/src/CMakeFiles/exhaustive_tests.dir

libsecp256k1/build/Makefile  view on Meta::CPAN

# Special rule for the target rebuild_cache
rebuild_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
	/usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast

# Special rule for the target edit_cache
edit_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
	/usr/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast

# Special rule for the target test
test:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..."
	/usr/bin/ctest --force-new-ctest-process $(ARGS)
.PHONY : test

# Special rule for the target test
test/fast: test
.PHONY : test/fast

libsecp256k1/build/Makefile  view on Meta::CPAN

exhaustive_tests/fast:
	$(MAKE) $(MAKESILENT) -f src/CMakeFiles/exhaustive_tests.dir/build.make src/CMakeFiles/exhaustive_tests.dir/build
.PHONY : exhaustive_tests/fast

# Help Target
help:
	@echo "The following are some of the valid targets for this Makefile:"
	@echo "... all (the default if no target is provided)"
	@echo "... clean"
	@echo "... depend"
	@echo "... edit_cache"
	@echo "... install"
	@echo "... install/local"
	@echo "... install/strip"
	@echo "... list_install_components"
	@echo "... rebuild_cache"
	@echo "... test"
	@echo "... bench"
	@echo "... bench_ecmult"
	@echo "... bench_internal"
	@echo "... exhaustive_tests"

libsecp256k1/build/src/Makefile  view on Meta::CPAN

# Special rule for the target rebuild_cache
rebuild_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
	/usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast

# Special rule for the target edit_cache
edit_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
	/usr/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast

# Special rule for the target install/strip
install/strip: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
	/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip

# Special rule for the target install/strip
install/strip/fast: preinstall/fast
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."

libsecp256k1/build/src/Makefile  view on Meta::CPAN

tests_exhaustive.c.s:
	cd /home/bartosz/dox/Perl-Bitcoin/Alien-libsecp256k1/libsecp256k1/build && $(MAKE) $(MAKESILENT) -f src/CMakeFiles/exhaustive_tests.dir/build.make src/CMakeFiles/exhaustive_tests.dir/tests_exhaustive.c.s
.PHONY : tests_exhaustive.c.s

# Help Target
help:
	@echo "The following are some of the valid targets for this Makefile:"
	@echo "... all (the default if no target is provided)"
	@echo "... clean"
	@echo "... depend"
	@echo "... edit_cache"
	@echo "... install"
	@echo "... install/local"
	@echo "... install/strip"
	@echo "... list_install_components"
	@echo "... rebuild_cache"
	@echo "... test"
	@echo "... bench"
	@echo "... bench_ecmult"
	@echo "... bench_internal"
	@echo "... exhaustive_tests"

libsecp256k1/doc/safegcd_implementation.md  view on Meta::CPAN

    # always odd, so its inverse modulo a power of two always exists.
    w = (g * NEGINV16[(f & 15) // 2]) % (2**limit)
    # As w = -g/f mod (2**limit), g+w*f mod 2**limit = 0 mod 2**limit.
    g += w * f
    assert g % (2**limit) == 0
    # The next iteration will now shift out at least limit bottom zero bits from g.
```

By using a bigger table more bits can be cancelled at once. The table can also be implemented
as a formula. Several formulas are known for computing modular inverses modulo powers of two;
some can be found in Hacker's Delight second edition by Henry S. Warren, Jr. pages 245-247.
Here we need the negated modular inverse, which is a simple transformation of those:

- Instead of a 3-bit table:
  - *-f* or *f ^ 6*
- Instead of a 4-bit table:
  - *1 - f(f + 1)*
  - *-(f + (((f + 1) & 4) << 1))*
- For larger tables the following technique can be used: if *w=-1/f mod 2<sup>L</sup>*, then *w(w&thinsp;f+2)* is
  *-1/f mod 2<sup>2L</sup>*. This allows extending the previous formulas (or tables). In particular we
  have this 6-bit function (based on the 3-bit function above):

libsecp256k1/src/tests.c  view on Meta::CPAN

    memcpy(msg, "msg", 3);
    CHECK(secp256k1_tagged_sha256(CTX, hash32, tag, 3, msg, 3) == 1);
    CHECK(secp256k1_memcmp_var(hash32, hash_expected, sizeof(hash32)) == 0);
}

/***** MODINV TESTS *****/

/* Compute the modular inverse of (odd) x mod 2^64. */
static uint64_t modinv2p64(uint64_t x) {
    /* If w = 1/x mod 2^(2^L), then w*(2 - w*x) = 1/x mod 2^(2^(L+1)). See
     * Hacker's Delight second edition, Henry S. Warren, Jr., pages 245-247 for
     * why. Start with L=0, for which it is true for every odd x that
     * 1/x=1 mod 2. Iterating 6 times gives us 1/x mod 2^64. */
    int l;
    uint64_t w = 1;
    CHECK(x & 1);
    for (l = 0; l < 6; ++l) w *= (2 - w*x);
    return w;
}


libsecp256k1/src/wycheproof/WYCHEPROOF_COPYING  view on Meta::CPAN

      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of

libsecp256k1/src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.h  view on Meta::CPAN

/* Note: this file was autogenerated using tests_wycheproof_generate.py. Do not edit. */
#define SECP256K1_ECDSA_WYCHEPROOF_NUMBER_TESTVECTORS (463)

typedef struct {
    size_t pk_offset;
    size_t msg_offset;
    size_t msg_len;
    size_t sig_offset;
    size_t sig_len;
    int expected_verify;
} wycheproof_ecdsa_testvector;

libsecp256k1/tools/tests_wycheproof_generate.py  view on Meta::CPAN

    size_t pk_offset;
    size_t msg_offset;
    size_t msg_len;
    size_t sig_offset;
    size_t sig_len;
    int expected_verify;
} wycheproof_ecdsa_testvector;
"""


print("/* Note: this file was autogenerated using tests_wycheproof_generate.py. Do not edit. */")
print(f"#define SECP256K1_ECDSA_WYCHEPROOF_NUMBER_TESTVECTORS ({num_vectors})")

print(struct_definition)

print("static const unsigned char wycheproof_ecdsa_messages[]    = { " + messages + "};\n")
print("static const unsigned char wycheproof_ecdsa_public_keys[] = { " + public_keys + "};\n")
print("static const unsigned char wycheproof_ecdsa_signatures[]  = { " + signatures + "};\n")

print("static const wycheproof_ecdsa_testvector testvectors[SECP256K1_ECDSA_WYCHEPROOF_NUMBER_TESTVECTORS] = {")
print(out)



( run in 1.697 second using v1.01-cache-2.11-cpan-98d9bbf8dc8 )