functionally / crypto-lean4

Implementation of various cryptographic functions in Lean4
MIT License
1 stars 0 forks source link

Implement additional elliptic curves #16

Open bwbush opened 4 days ago

bwbush commented 4 days ago

See https://github.com/paulmillr/noble-curves/blob/main/src/secp256k1.ts, for example.

bwbush commented 4 days ago

From OpenAI . . .

Several elliptic curves have become widely adopted as cryptographic standards due to their security, efficiency, and well-vetted properties. These curves are used in a variety of cryptographic protocols, including encryption, digital signatures, key exchange, and more.

1. Secp256k1

2. P-256 (also known as secp256r1)

3. P-384 (also known as secp384r1)

4. P-521 (also known as secp521r1)

5. Curve25519

6. Ed25519

7. BLS12-381

8. Brainpool Curves (e.g., BrainpoolP256r1, BrainpoolP384r1)

Summary Table:

Curve Name Field Size Group Order (Security Level) Key Uses
Secp256k1 256-bit ( \approx 2^{256} ) (128-bit security) Cryptocurrencies, Blockchain (e.g., Bitcoin)
P-256 256-bit ( \approx 2^{256} ) (128-bit security) TLS, HTTPS, general cryptography
P-384 384-bit ( \approx 2^{384} ) (192-bit security) TLS, government, financial systems
P-521 521-bit ( \approx 2^{521} ) (256-bit security) High-security applications, military
Curve25519 255-bit ( \approx 2^{255} ) (128-bit security) ECDH, TLS 1.3, Signal, WireGuard
Ed25519 255-bit ( \approx 2^{255} ) (128-bit security) Digital signatures (SSH, TLS, blockchain)
BLS12-381 381-bit ( \approx 2^{381} ) (128-bit security) Pairing-based crypto, zk-SNARKs, Ethereum 2.0
BrainpoolP256r1 256-bit ( \approx 2^{256} ) (128-bit security) Alternative to NIST curves, European applications

Conclusion:

The most prominently used elliptic curves include those standardized by NIST (P-256, P-384, P-521), Curve25519 and its signature variant Ed25519, and secp256k1 (especially in cryptocurrencies). For pairing-based cryptography, BLS12-381 is widely used in advanced cryptographic protocols. Each curve is designed for different cryptographic needs and security levels, depending on the use case and efficiency requirements.