Commit Graph

19 Commits

Author SHA1 Message Date
3cf494709e Add standalone Schnorr signature implementation (BIP-340)
This commit introduces a new file, `schnorr_standalone.c`, which contains the complete implementation of Schnorr signatures as specified in BIP-340. The file includes core signing and verification logic, along with necessary dependencies and forward declarations from the secp256k1 library. This addition enhances the cryptographic capabilities of the library by providing a standalone solution for Schnorr signatures, ensuring compliance with the BIP-340 standard.
2025-11-02 01:45:51 +00:00
97fd24017a Update benchmark report with latest performance metrics and optimizations
This commit updates the BENCHMARK_REPORT.md to reflect the latest performance improvements following the implementation of optimized windowed multiplication for ECDH and verification. Key changes include a new generation date, updated operation times, and a detailed analysis of the performance of P256K1Signer, BtcecSigner, and NextP256K across various operations. Notably, P256K1Signer now shows significant improvements in ECDH (33% faster) and verification (20% faster), establishing it as the fastest pure Go implementation across all operations.
2025-11-02 01:40:16 +00:00
4ce2205be5 aoeu 2025-11-02 01:36:35 +00:00
9078f6a177 Enhance ECDH performance by integrating optimized windowed multiplication
This commit further optimizes the ECDH functions by implementing windowed multiplication, improving performance during key exchange operations. The changes leverage the known secret key for variable-time operations, enhancing efficiency. Additionally, updates to project configuration files are included to streamline project management and version control.
2025-11-02 00:59:58 +00:00
3323d197ab Optimize ECDH functions to use windowed multiplication for improved performance
This commit updates the ECDH and ECDHXOnly functions to utilize optimized windowed multiplication instead of constant-time multiplication. This change is justified as the secret key is already known, allowing for variable-time operations. Additionally, new .idea configuration files are added, including .gitignore, misc.xml, modules.xml, p256k1.mleku.dev.iml, and vcs.xml, to enhance project management and version control settings.
2025-11-02 00:29:51 +00:00
8164e5461f Refactor EcmultConst and add GLV implementation with associated tests
This commit updates the `EcmultConst` function to use a simple binary method for constant-time multiplication, addressing issues with the previous GLV implementation. Additionally, a new `glv.go` file is introduced, containing GLV endomorphism constants and functions, including `scalarSplitLambda` and `geMulLambda`. Comprehensive tests for these functions are added in `glv_test.go`, ensuring correctness and performance. The `boolToInt` helper function is also moved to `field.go`, and unnecessary code is removed from `scalar.go` to streamline the codebase.
2025-11-01 22:39:45 +00:00
f2ddcfacbb Refactor Ecmult functions for optimized windowed multiplication and enhance performance
This commit introduces a new `ecmultWindowedVar` function that implements optimized windowed multiplication for scalar multiplication, significantly improving performance during verification operations. The existing `Ecmult` function is updated to utilize this new implementation, converting points to affine coordinates for efficiency. Additionally, the `EcmultConst` function is retained for constant-time operations. The changes also include enhancements to the generator multiplication context, utilizing precomputed byte points for improved efficiency. Overall, these optimizations lead to a notable reduction in operation times for cryptographic computations.
2025-11-01 21:39:36 +00:00
f259c9a2e1 Remove benchmark results file and update Go module dependencies
This commit deletes the `benchmark_results.txt` file, which contained performance metrics for various cryptographic operations. Additionally, the Go module has been updated to version 1.25.0, and new dependencies have been added, including `btcec` for enhanced signing capabilities. The `go.sum` file has also been updated to reflect these changes. A new benchmark report has been introduced to provide a comprehensive comparison of signer implementations.
2025-11-01 21:03:50 +00:00
b34f0805c3 Add Schnorr signature implementation and associated tests
This commit introduces the implementation of Schnorr signatures following BIP-340, including the `SchnorrSign` and `SchnorrVerify` functions. It also adds comprehensive tests to validate the signing and verification processes, ensuring correct functionality with both standard and auxiliary randomness. The tests cover various scenarios, including signature generation, verification, and edge cases, enhancing the robustness of the secp256k1 implementation. Additionally, new files for Schnorr signature operations and tests have been created, contributing to the overall cryptographic capabilities of the library.
2025-11-01 20:26:35 +00:00
3966183137 Add benchmark results and performance analysis for ECDSA and ECDH operations
This commit introduces two new files: `BENCHMARK_RESULTS.md` and `benchmark_results.txt`, which document the performance metrics of various cryptographic operations, including ECDSA signing, verification, and ECDH key exchange. The results provide insights into operation times, memory allocations, and comparisons with C implementations. Additionally, new test files for ECDSA and ECDH functionalities have been added, ensuring comprehensive coverage and validation of the implemented algorithms. This enhances the overall robustness and performance understanding of the secp256k1 implementation.
2025-11-01 20:17:24 +00:00
5416381478 Add context tests and implement generator multiplication context
This commit introduces a new test file for context management, covering various scenarios for context creation, destruction, and capabilities. Additionally, it implements the generator multiplication context, enhancing the secp256k1 elliptic curve operations. The changes ensure comprehensive testing and improved functionality for context handling, contributing to the overall robustness of the implementation.
2025-11-01 20:01:52 +00:00
715bdff306 Add Phase 1 implementation summary and core components for secp256k1
This commit introduces a detailed summary of the Phase 1 implementation, outlining completed components such as core infrastructure files for group operations, generator point multiplication, public key operations, and context management. It also includes comprehensive test coverage for these components. The current status highlights working features and known issues, particularly a critical bug in field arithmetic that needs addressing before proceeding to further phases. The file structure is organized for modularity and performance optimization.
2025-11-01 19:25:17 +00:00
cf2fed8edf Remove deprecated files and update README to reflect current implementation status and features. This commit deletes unused context, ecmult, and test files, streamlining the codebase. The README has been revised to include architectural details, performance benchmarks, and security considerations for the secp256k1 implementation. 2025-11-01 19:10:34 +00:00
f44b16bae5 Add secp256k1 implementation with core components, context management, and testing suite
This commit introduces a complete Go implementation of the secp256k1 elliptic curve cryptographic primitives, including field and scalar arithmetic, group operations, context management for enhanced security, and a comprehensive testing suite. Key features include optimized scalar multiplication, context creation and destruction, and basic ECDSA operations. The README has been updated to reflect the new structure and usage examples.
2025-11-01 18:30:55 +00:00
6ed88596fe Clean up whitespace in secp256k1.go to improve code readability without altering functionality. 2025-11-01 18:28:16 +00:00
8e7aa50aac Refactor formatting in context.go by removing unnecessary whitespace and ensuring consistent code style. No functional changes made. 2025-11-01 18:28:01 +00:00
e7daf84626 Remove binary files for libp256k1 and add optimization summary documentation along with new context and ecmult implementations. Introduce tests for scalar multiplication and field operations, enhancing overall performance and security features. 2025-11-01 18:27:47 +00:00
93989d07be remove 32 bit limbs 2025-11-01 17:57:52 +00:00
77f747f360 initial just the nostr from the c 2025-11-01 17:49:38 +00:00