elliptic_curve 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +27 -7
- data/elliptic_curve.gemspec +2 -1
- data/lib/elliptic_curve/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fdf2755e2f03cc6623c7647268b39129c98bfa2
|
4
|
+
data.tar.gz: 108fddf54a5bec531c59edf61c1f8e36561cfea8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1e2dca08a4adb58a31c16ed61083a24bfc176e71a2fb5e87aedbb04e8a455f3469ca5497db971108416c968994f49bd80b5b1655a475d7777fe916fec6b5994
|
7
|
+
data.tar.gz: 31a9813ca2b05350f4a1e25583add234b2da74ee0862c714f9a8a6f589420e1b99fa4d89035056af44f2d2cd9bbb796bb1ec46c3caff39521d1c42c17e7bbaaa
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# EllipticCurve
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Just the bare implementation for doing some exercises with elliptic curves. See below for usage.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,13 +20,35 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
You can define elliptic curves using the EllitpicCurve::EC-class:
|
24
|
+
|
25
|
+
```
|
26
|
+
ec = EllipticCurve::EC.new( 1, 2, 11 )
|
27
|
+
```
|
26
28
|
|
27
|
-
|
29
|
+
which would create an elliptic curve in F_11 of the following form:
|
30
|
+
|
31
|
+
```
|
32
|
+
y^2 = x^3 + 1 * x + 2
|
33
|
+
```
|
28
34
|
|
29
|
-
|
35
|
+
Then you can define a point on this curve:
|
30
36
|
|
31
|
-
|
37
|
+
```
|
38
|
+
p = EllitpicCurve::P( ec, 4, 2 )
|
39
|
+
```
|
40
|
+
|
41
|
+
And do some calculations:
|
42
|
+
|
43
|
+
```
|
44
|
+
psum = p + p
|
45
|
+
psum2 = psum + p
|
46
|
+
if psum2 == p * 3
|
47
|
+
puts "is equal, x-axis is: #{psum2.x}"
|
48
|
+
else
|
49
|
+
puts 'some error'
|
50
|
+
end
|
51
|
+
```
|
32
52
|
|
33
53
|
## Contributing
|
34
54
|
|
data/elliptic_curve.gemspec
CHANGED
@@ -13,7 +13,8 @@ Gem::Specification.new do |spec|
|
|
13
13
|
elliptic curves. }
|
14
14
|
spec.description = %q{This gives the basic for representing elliptic curves of the form
|
15
15
|
y^2 = x^3 + ax + b, including adding and (p^-1 modulo q).}
|
16
|
-
spec.homepage =
|
16
|
+
spec.homepage = 'http://github.com/ineiti/elliptic_curve'
|
17
|
+
spec.license = 'GPL-3.0'
|
17
18
|
|
18
19
|
|
19
20
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elliptic_curve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linus Gasser
|
@@ -62,7 +62,8 @@ files:
|
|
62
62
|
- lib/elliptic_curve.rb
|
63
63
|
- lib/elliptic_curve/version.rb
|
64
64
|
homepage: http://github.com/ineiti/elliptic_curve
|
65
|
-
licenses:
|
65
|
+
licenses:
|
66
|
+
- GPL-3.0
|
66
67
|
metadata: {}
|
67
68
|
post_install_message:
|
68
69
|
rdoc_options: []
|