rbnacl 3.1.2 → 3.2.0

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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +27 -0
  3. data/.travis.yml +4 -3
  4. data/CHANGES.md +5 -0
  5. data/Gemfile +8 -3
  6. data/Guardfile +1 -1
  7. data/README.md +5 -6
  8. data/Rakefile +3 -2
  9. data/lib/rbnacl.rb +1 -1
  10. data/lib/rbnacl/auth.rb +21 -8
  11. data/lib/rbnacl/boxes/curve25519xsalsa20poly1305.rb +17 -13
  12. data/lib/rbnacl/boxes/curve25519xsalsa20poly1305/private_key.rb +68 -65
  13. data/lib/rbnacl/boxes/curve25519xsalsa20poly1305/public_key.rb +49 -47
  14. data/lib/rbnacl/group_elements/curve25519.rb +14 -8
  15. data/lib/rbnacl/hash.rb +2 -2
  16. data/lib/rbnacl/hash/blake2b.rb +13 -13
  17. data/lib/rbnacl/hash/sha256.rb +5 -5
  18. data/lib/rbnacl/hash/sha512.rb +5 -5
  19. data/lib/rbnacl/hmac/sha256.rb +12 -11
  20. data/lib/rbnacl/hmac/sha512256.rb +11 -10
  21. data/lib/rbnacl/init.rb +1 -1
  22. data/lib/rbnacl/key_comparator.rb +3 -3
  23. data/lib/rbnacl/one_time_auths/poly1305.rb +4 -4
  24. data/lib/rbnacl/password_hash/scrypt.rb +10 -11
  25. data/lib/rbnacl/random.rb +2 -2
  26. data/lib/rbnacl/secret_boxes/xsalsa20poly1305.rb +28 -14
  27. data/lib/rbnacl/self_test.rb +17 -37
  28. data/lib/rbnacl/serializable.rb +9 -4
  29. data/lib/rbnacl/signatures/ed25519.rb +1 -0
  30. data/lib/rbnacl/signatures/ed25519/signing_key.rb +17 -9
  31. data/lib/rbnacl/signatures/ed25519/verify_key.rb +17 -6
  32. data/lib/rbnacl/simple_box.rb +6 -3
  33. data/lib/rbnacl/sodium.rb +6 -7
  34. data/lib/rbnacl/sodium/version.rb +3 -2
  35. data/lib/rbnacl/test_vectors.rb +57 -55
  36. data/lib/rbnacl/util.rb +12 -11
  37. data/lib/rbnacl/version.rb +3 -1
  38. data/rbnacl.gemspec +6 -8
  39. data/spec/rbnacl/authenticators/poly1305_spec.rb +1 -1
  40. data/spec/rbnacl/boxes/curve25519xsalsa20poly1305/private_key_spec.rb +1 -1
  41. data/spec/rbnacl/boxes/curve25519xsalsa20poly1305/public_key_spec.rb +1 -1
  42. data/spec/rbnacl/boxes/curve25519xsalsa20poly1305_spec.rb +2 -2
  43. data/spec/rbnacl/group_element_spec.rb +1 -1
  44. data/spec/rbnacl/hash/blake2b_spec.rb +1 -1
  45. data/spec/rbnacl/hash_spec.rb +1 -1
  46. data/spec/rbnacl/hmac/sha256_spec.rb +1 -1
  47. data/spec/rbnacl/hmac/sha512256_spec.rb +1 -1
  48. data/spec/rbnacl/password_hash/scrypt_spec.rb +3 -3
  49. data/spec/rbnacl/secret_box_spec.rb +3 -3
  50. data/spec/rbnacl/signatures/ed25519/signing_key_spec.rb +2 -2
  51. data/spec/rbnacl/signatures/ed25519/verify_key_spec.rb +12 -7
  52. data/spec/rbnacl/simple_box_spec.rb +2 -2
  53. data/spec/rbnacl/util_spec.rb +28 -29
  54. data/spec/shared/authenticator.rb +12 -12
  55. data/spec/shared/box.rb +2 -4
  56. data/spec/spec_helper.rb +11 -18
  57. data/tasks/rspec.rake +2 -2
  58. data/tasks/rubocop.rake +1 -1
  59. metadata +4 -5
  60. data/lib/rbnacl/rake_tasks.rb +0 -57
  61. data/tasks/ci.rake +0 -11
@@ -1,5 +1,5 @@
1
- gem 'rspec'
2
- require 'rspec/core/rake_task'
1
+ gem "rspec"
2
+ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new
5
5
 
@@ -1,3 +1,3 @@
1
- require 'rubocop/rake_task'
1
+ require "rubocop/rake_task"
2
2
 
3
3
  RuboCop::RakeTask.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbnacl
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain:
12
12
  - bascule.cert
13
- date: 2014-08-30 00:00:00.000000000 Z
13
+ date: 2015-06-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ffi
@@ -79,6 +79,7 @@ files:
79
79
  - ".coveralls.yml"
80
80
  - ".gitignore"
81
81
  - ".rspec"
82
+ - ".rubocop.yml"
82
83
  - ".travis.yml"
83
84
  - ".yardopts"
84
85
  - CHANGES.md
@@ -110,7 +111,6 @@ files:
110
111
  - lib/rbnacl/one_time_auths/poly1305.rb
111
112
  - lib/rbnacl/password_hash.rb
112
113
  - lib/rbnacl/password_hash/scrypt.rb
113
- - lib/rbnacl/rake_tasks.rb
114
114
  - lib/rbnacl/random.rb
115
115
  - lib/rbnacl/secret_boxes/xsalsa20poly1305.rb
116
116
  - lib/rbnacl/self_test.rb
@@ -146,7 +146,6 @@ files:
146
146
  - spec/shared/key_equality.rb
147
147
  - spec/shared/serializable.rb
148
148
  - spec/spec_helper.rb
149
- - tasks/ci.rake
150
149
  - tasks/rspec.rake
151
150
  - tasks/rubocop.rake
152
151
  homepage: https://github.com/cryptosphere/rbnacl
@@ -169,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
168
  version: '0'
170
169
  requirements: []
171
170
  rubyforge_project:
172
- rubygems_version: 2.2.2
171
+ rubygems_version: 2.4.6
173
172
  signing_key:
174
173
  specification_version: 4
175
174
  summary: The Networking and Cryptography (NaCl) library provides a high-level toolkit
@@ -1,57 +0,0 @@
1
- # encoding: binary
2
- require 'rake'
3
- require 'rake/clean'
4
- require 'digest/sha2'
5
-
6
- LIBSODIUM_VERSION = "0.7.0"
7
- LIBSODIUM_DIGEST = "4ccaffd1a15be67786e28a61b602492a97eb5bcb83455ed53c02fa038b8e9168"
8
-
9
- def sh_hidden(command)
10
- STDERR.puts("*** Executing: #{command}")
11
- output = `#{command}`
12
-
13
- if !$?.success?
14
- STDERR.puts "!!! Error executing: #{command}"
15
- STDERR.puts output
16
- exit 1
17
- end
18
- end
19
-
20
- libsodium_tarball = "libsodium-#{LIBSODIUM_VERSION}.tar.gz"
21
-
22
- file libsodium_tarball do
23
- sh "curl -L -O https://github.com/jedisct1/libsodium/releases/download/#{LIBSODIUM_VERSION}/#{libsodium_tarball}"
24
-
25
- digest = Digest::SHA256.hexdigest(File.read(libsodium_tarball))
26
- if digest != LIBSODIUM_DIGEST
27
- rm libsodium_tarball
28
- raise "#{libsodium_tarball} failed checksum! Got #{digest}"
29
- end
30
- end
31
-
32
- file "libsodium" => libsodium_tarball do
33
- sh "tar -zxf #{libsodium_tarball}"
34
- mv "libsodium-#{LIBSODIUM_VERSION}", "libsodium"
35
- end
36
-
37
- file "libsodium/Makefile" => "libsodium" do
38
- sh_hidden "cd libsodium && ./configure"
39
- end
40
-
41
- file "libsodium/src/libsodium/.libs/libsodium.a" => "libsodium/Makefile" do
42
- sh_hidden "cd libsodium && make"
43
- end
44
-
45
- if `uname` == 'Darwin'
46
- libsodium_lib = "libsodium.bundle"
47
- else
48
- libsodium_lib = "libsodium.so"
49
- end
50
-
51
- file "libsodium/src/libsodium/.libs/#{libsodium_lib}" => "libsodium/src/libsodium/.libs/libsodium.a"
52
-
53
- task :build_libsodium => "libsodium/src/libsodium/.libs/#{libsodium_lib}" do
54
- $LIBSODIUM_PATH = "libsodium/src/libsodium/.libs/#{libsodium_lib}"
55
- end
56
-
57
- CLEAN.add "libsodium", "libsodium-*.tar.gz"
@@ -1,11 +0,0 @@
1
- require "rake/clean"
2
-
3
- file "lib/libsodium.so" => :build_libsodium do
4
- cp $LIBSODIUM_PATH, "lib/libsodium.so"
5
- end
6
-
7
- task "ci:sodium" => "lib/libsodium.so"
8
-
9
- task :ci => %w(ci:sodium spec)
10
-
11
- CLEAN.add "lib/libsodium.*"