You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
mleku e56bf76257
Add NIP-11 relay synchronization and group management features
2 months ago
..
precomps Migrate internal module imports to unified package path. 4 months ago
LICENSE initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
README.md Refactor export functionality in App.svelte to support both GET and POST methods for event exports, enhancing flexibility in user permissions. Update server-side handling to accommodate pubkey filtering and improve response handling for file downloads. Adjust UI components to reflect these changes, ensuring a seamless user experience. 3 months ago
bench_test.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
curve.go Migrate internal module imports to unified package path. 4 months ago
curve_test.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
doc.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
ecdh.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
ecdh_test.go Migrate internal module imports to unified package path. 4 months ago
ellipticadaptor.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
ellipticadaptor_bench_test.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
ellipticadaptor_test.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
error.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
error_test.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
example_test.go Add NIP-11 relay synchronization and group management features 2 months ago
field.go Migrate internal module imports to unified package path. 4 months ago
field_bench_test.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
field_test.go Migrate internal module imports to unified package path. 4 months ago
loadprecomputed.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
modnscalar.go Migrate internal module imports to unified package path. 4 months ago
modnscalar_bench_test.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
modnscalar_test.go Migrate internal module imports to unified package path. 4 months ago
nonce.go Add NIP-11 relay synchronization and group management features 2 months ago
nonce_test.go Add NIP-11 relay synchronization and group management features 2 months ago
precomps.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
pubkey.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
pubkey_test.go Migrate internal module imports to unified package path. 4 months ago
rawbytepoints.bin initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
seckey.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
seckey_bench_test.go initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
seckey_test.go Migrate internal module imports to unified package path. 4 months ago

README.md

secp256k1

Due to the terrible state of the btcec library, and the ethical character of dcred, the two main secp256k1 EC libraries in the Go language, it has become necessary to refactor and clean up the mess of btcec's module versioning.

In addition, the code has been updated to use several new features of Go that were added to the language since these libraries were first created, notably the precomps are here directly generated as binary data instead of nasty base64 source code.

Package secp256k1 implements optimized secp256k1 elliptic curve operations.

This package provides an optimized pure Go implementation of elliptic curve cryptography operations over the secp256k1 curve as well as data structures and functions for working with public and secret secp256k1 keys. See https://www.secg.org/sec2-v2.pdf for details on the standard.

In addition, sub packages are provided to produce, verify, parse, and serialize ECDSA signatures and EC-Schnorr-DCRv0 (a custom Schnorr-based signature scheme specific to Decred) signatures. See the README.md files in the relevant sub packages for more details about those aspects.

An overview of the features provided by this package are as follows:

  • Secret key generation, serialization, and parsing
  • Public key generation, serialization and parsing per ANSI X9.62-1998
    • Parses uncompressed, compressed, and hybrid public keys
    • Serializes uncompressed and compressed public keys
  • Specialized types for performing optimized and constant time field operations
    • FieldVal type for working modulo the secp256k1 field prime
    • ModNScalar type for working modulo the secp256k1 group order
  • Elliptic curve operations in Jacobian projective coordinates
    • Point addition
    • Point doubling
    • Scalar multiplication with an arbitrary point
    • Scalar multiplication with the base point (group generator)
  • Point decompression from a given x coordinate
  • Nonce generation via RFC6979 with support for extra data and version information that can be used to prevent nonce reuse between signing algorithms

It also provides an implementation of the Go standard library crypto/elliptic Curve interface via the S256 function so that it may be used with other packages in the standard library such as crypto/tls, crypto/x509, and crypto/ecdsa. However, in the case of ECDSA, it is highly recommended to use the ecdsa sub package of this package instead since it is optimized specifically for secp256k1 and is significantly faster as a result.

Although this package was primarily written for dcrd, it has intentionally been designed so it can be used as a standalone package for any projects needing to use optimized secp256k1 elliptic curve cryptography.

Finally, a comprehensive suite of tests is provided to provide a high level of quality assurance.