cf-ruby-libecp 0.1.2 → 0.1.3

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.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/lib/libecp.rb +5 -25
  3. metadata +15 -21
  4. data/lib/libecp.so +0 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c4f27c3a6c06808402180260ca2403df1b936fef
4
+ data.tar.gz: 213418a4289f4a74d24070d629de76599f329bba
5
+ SHA512:
6
+ metadata.gz: e8cf6270d559c4d8c555905c92a8cb91d95c61ab96612049298a89fc2884b7700ddbe7aee6c448edea925fef1c41c6aca5c3759185058591d8f0d932e4539f1d
7
+ data.tar.gz: 51e11d81fdaa98ca73541b8b663fe185c26f14e48c2eace7cc5db9d969a33979323470f72cc5adbaf7fb1738e4128fab7851f0baff02197c7e3244e5d39437b0
data/lib/libecp.rb CHANGED
@@ -1,27 +1,8 @@
1
1
  # encoding: UTF-8
2
-
3
- =begin
4
- This library is a ruby wrapper for the C++ libecp library. It supports signing and generating public/private key pairs specific to coinfloor.
5
-
6
- Copyright 2014 Coinfloor LTD.
7
-
8
- Licensed under the Apache License, Version 2.0 (the "License");
9
- you may not use this file except in compliance with the License.
10
- You may obtain a copy of the License at
11
-
12
- http://www.apache.org/licenses/LICENSE-2.0
13
-
14
- Unless required by applicable law or agreed to in writing, software
15
- distributed under the License is distributed on an "AS IS" BASIS,
16
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- See the License for the specific language governing permissions and
18
- limitations under the License.
19
- =end
20
-
21
- require 'base64'
22
- require 'securerandom'
23
- require 'openssl'
24
- require 'ffi'
2
+ require "base64"
3
+ require "ffi"
4
+ require "openssl"
5
+ require "securerandom"
25
6
 
26
7
  module LibEcp
27
8
  extend FFI::Library
@@ -34,7 +15,6 @@ module LibEcp
34
15
  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
16
 
36
17
  # get the byte string of a, G, p and n
37
-
38
18
  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")
39
19
  a="\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".force_encoding("ASCII-8BIT")
40
20
  g="\x00\xA1E[3M\xF0\x99\xDF0\xFC(\xA1i\xA4g\xE9\xE4pu\xA9\x0F~e\x0E\xB6\xB7\xA4\\\x00~\b\x9F\xED\x7F\xBA4B\x82\xCA\xFB\xD6\xF7\xE3\x19\xF7\xC0\xB0\xBDY\xE2\xCAK\xDBUma\xA5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01".force_encoding("ASCII-8BIT")
@@ -51,7 +31,7 @@ module LibEcp
51
31
  @@nb.put_bytes(0,n)
52
32
 
53
33
  def self.gen_nonce
54
- return SecureRandom.random_bytes.rstrip
34
+ SecureRandom.random_bytes(16)
55
35
  end
56
36
 
57
37
  # Generates user id as a bytestring
metadata CHANGED
@@ -1,65 +1,59 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf-ruby-libecp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
5
- prerelease:
4
+ version: 0.1.3
6
5
  platform: ruby
7
6
  authors:
8
- - Coinfloor
7
+ - Coinfloor LTD
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-01-19 00:00:00.000000000 Z
11
+ date: 2014-09-19 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: ffi
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: 1.9.3
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: 1.9.3
30
- description: Libecp is a C++ elliptic curve cryptography library for signing,verifying
31
- signatures and generating keys. cf-ruby-libecp is a ruby wrapper.
27
+ description: Libecp is a C++ elliptic curve cryptography library for signing, verifying
28
+ signatures and generating keys.
32
29
  email: development@coinfloor.co.uk
33
30
  executables: []
34
31
  extensions: []
35
32
  extra_rdoc_files: []
36
33
  files:
37
34
  - lib/libecp.rb
38
- - lib/libecp.so
39
- homepage: http://coinfloor.co.uk
35
+ homepage: https://github.com/coinfloor/ruby-libecp
40
36
  licenses:
41
- - http://apache.org/licenses/LICENSE-2.0.html
37
+ - Apache License Version 2.0
38
+ metadata: {}
42
39
  post_install_message:
43
40
  rdoc_options: []
44
41
  require_paths:
45
42
  - lib
46
43
  required_ruby_version: !ruby/object:Gem::Requirement
47
- none: false
48
44
  requirements:
49
- - - ! '>='
45
+ - - ">="
50
46
  - !ruby/object:Gem::Version
51
47
  version: 1.9.3
52
48
  required_rubygems_version: !ruby/object:Gem::Requirement
53
- none: false
54
49
  requirements:
55
- - - ! '>='
50
+ - - ">="
56
51
  - !ruby/object:Gem::Version
57
52
  version: '0'
58
53
  requirements: []
59
54
  rubyforge_project:
60
- rubygems_version: 1.8.25
55
+ rubygems_version: 2.4.1
61
56
  signing_key:
62
- specification_version: 3
63
- summary: Ruby libECP wrapper
57
+ specification_version: 4
58
+ summary: Ruby LibECP wrapper
64
59
  test_files: []
65
- has_rdoc:
data/lib/libecp.so DELETED
Binary file