Add Elliptic Curve and docs
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# Elliptic Curves
|
||||
## Points
|
||||
::: Cryptotools.Groups.point
|
||||
|
||||
## Curves
|
||||
::: Cryptotools.Groups.curve
|
||||
@@ -0,0 +1,30 @@
|
||||
# Generating Elliptic Curves
|
||||
|
||||
In the following section, we are going to see how to generate Elliptic Curves and draw the curve with Python.
|
||||
|
||||
## A Weierstrass Curve
|
||||
The python code below draw a Weierstrass Curve:
|
||||
|
||||
```
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
from Cryptotools.Groups.curve import Curve
|
||||
|
||||
|
||||
a = 3
|
||||
b = 8
|
||||
|
||||
curve = Curve(a, b, Curve.WEIERSTRASS)
|
||||
x = curve.x
|
||||
curve.generatePoints()
|
||||
y = curve.y
|
||||
yn = curve.yn
|
||||
points = curve.getPoints()
|
||||
|
||||
plt.figure(figsize=(10, 6))
|
||||
plt.plot(x, y, color='b', label=f'$y^2 = x^3 + {a}x + {b}$')
|
||||
plt.plot(x, yn, color='b', )
|
||||
plt.legend()
|
||||
plt.show()
|
||||
```
|
||||
+3
-2
@@ -5,11 +5,12 @@
|
||||
* Low-Level Cryptographic
|
||||
* [Number Theory](/number-theory)
|
||||
* [Group Theory](/group-theory)
|
||||
* [Curves](/curves)
|
||||
* Public Keys:
|
||||
* [RSA](/rsa)
|
||||
* Utils
|
||||
* [Utils](/utils)
|
||||
* Examples:
|
||||
* [Generating RSA keys](/examples-rsa-keys)
|
||||
|
||||
* [Generating RSA keys](/example-rsa-keys)
|
||||
* [Generate curves](/example-curves)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user