cf-ruby-libecp 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/libecp.rb +0 -8
- metadata +23 -7
data/lib/libecp.rb
CHANGED
@@ -33,8 +33,6 @@ module LibEcp
|
|
33
33
|
attach_function :ecp_sign_u8, [:pointer, :pointer, :buffer_in, :buffer_in, :buffer_in, :buffer_in, :buffer_in, :buffer_in, :size_t], :void
|
34
34
|
attach_function :ecp_verify_u8, [:buffer_in, :buffer_in, :buffer_in, :buffer_in, :buffer_in, :buffer_in, :buffer_in, :buffer_in, :size_t], :bool
|
35
35
|
|
36
|
-
@@cookie_secret="\xF9+\xB46h\x1Cn\x9E\x9Cu\xF1\x1F\xED{Yi".force_encoding("ASCII-8BIT")
|
37
|
-
|
38
36
|
# get the byte string of a, G, p and n
|
39
37
|
|
40
38
|
p="\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFE\xFF\xFF\xE5m".force_encoding("ASCII-8BIT")
|
@@ -51,10 +49,6 @@ module LibEcp
|
|
51
49
|
@@gb.put_bytes(0,g)
|
52
50
|
@@nb = FFI::MemoryPointer.new(:char, 29)
|
53
51
|
@@nb.put_bytes(0,n)
|
54
|
-
def self.gen_cookie(uid)#uid should be a bytestring
|
55
|
-
packed_cs=(@@cookie_secret+uid)
|
56
|
-
return Base64.encode64(OpenSSL::Digest.digest("SHA1",packed_cs)).rstrip
|
57
|
-
end
|
58
52
|
|
59
53
|
def self.gen_nonce
|
60
54
|
return SecureRandom.random_bytes.rstrip
|
@@ -93,5 +87,3 @@ module LibEcp
|
|
93
87
|
return [ rbuf.get_bytes(1, 28), sbuf.get_bytes(1, 28) ]
|
94
88
|
end
|
95
89
|
end
|
96
|
-
|
97
|
-
#=end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cf-ruby-libecp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,10 +9,26 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-01-
|
13
|
-
dependencies:
|
12
|
+
date: 2014-01-19 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: ffi
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.9.3
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.9.3
|
14
30
|
description: Libecp is a C++ elliptic curve cryptography library for signing,verifying
|
15
|
-
signatures and generating keys.
|
31
|
+
signatures and generating keys. cf-ruby-libecp is a ruby wrapper.
|
16
32
|
email: development@coinfloor.co.uk
|
17
33
|
executables: []
|
18
34
|
extensions: []
|
@@ -20,9 +36,9 @@ extra_rdoc_files: []
|
|
20
36
|
files:
|
21
37
|
- lib/libecp.rb
|
22
38
|
- lib/libecp.so
|
23
|
-
homepage:
|
39
|
+
homepage: http://coinfloor.co.uk
|
24
40
|
licenses:
|
25
|
-
-
|
41
|
+
- http://apache.org/licenses/LICENSE-2.0.html
|
26
42
|
post_install_message:
|
27
43
|
rdoc_options: []
|
28
44
|
require_paths:
|
@@ -44,6 +60,6 @@ rubyforge_project:
|
|
44
60
|
rubygems_version: 1.8.25
|
45
61
|
signing_key:
|
46
62
|
specification_version: 3
|
47
|
-
summary:
|
63
|
+
summary: Ruby libECP wrapper
|
48
64
|
test_files: []
|
49
65
|
has_rdoc:
|