salsa20 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjVhMWYxYmFjMzMwY2VmNTM4ZGNlODc2OGY4ZjI2Mzc0NWQzOGI0Mg==
5
- data.tar.gz: !binary |-
6
- MmI5NDkyMjdjY2RmODllYTk3M2RmNjFjZTM2MDg5NmJjZmU5ZjBiYQ==
2
+ SHA1:
3
+ metadata.gz: 5d966534c16ad97b8054b7c1ebb287c7543e6ea2
4
+ data.tar.gz: b963cde653fa19981b09cd435dc573e257efa267
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NzMxZWIzN2E0NTNhYjRkNTBjYjkxNThlNzQ2ZmFkOTgxYjBiZjI1NDMyYzQy
10
- MmIxMmFjNzE5ZTIwZGEyZDc3ZjA1YjQxZDZhNmY2YTg3MGU4YzY3ODg1NzRj
11
- MjJhNjRiZDcwNDEzOTNiOWYwZWZlMDljNmM5MjBlMGUzYmY4NzA=
12
- data.tar.gz: !binary |-
13
- MmE3NTVlNTU3N2FhYjllZDU4ODRiYmMxN2ExMDRjYTZhMTk3ODY0YWUxZTE4
14
- ZmRmNDJlYWNjYmQ1YjBhNmViNzg1NDIzMzgzZDU1ZDJmNzk4YTk2NmFmYWFm
15
- OTc3OTRhMzIzMjhiMDE2YmEyNjdjNjM0OGVlYjg0NmQwNGE2NjY=
6
+ metadata.gz: ee0265ac7eb9b5bf4e2d3ac77530e031b097937ed565b2d9dd30d1340170c19117180733d82ddd1e549900425f4c244609074e1f56de5fdd65c345b15e884bdb
7
+ data.tar.gz: 1c17f1ac17617fc45d72e77d4eb6bc29e834e325cd79de443c62e677c4499c3eeffeb5aa99affb8723c80a608546d803d722bf51d90b591c34b352571b005cf1
data/.travis.yml CHANGED
@@ -1,7 +1,9 @@
1
1
  language: ruby
2
+ sudo: false
3
+ cache: bundler
2
4
  rvm:
3
- - 2.1.1
4
- - 2.0.0
5
+ - ruby-head
6
+ - 2.2.3
5
7
  - 1.9.3
6
8
  - 1.8.7
7
- - rbx-2
9
+ - rbx
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.1.2 Nov 10 2015
2
+
3
+ - Use minitest for unit testing
4
+
1
5
  0.1.1 Jun 27 2014
2
6
 
3
7
  - Fix tests on Ruby 1.9.x
data/README.rdoc CHANGED
@@ -44,7 +44,7 @@ For more information, see the detailed rdoc of the Salsa20 class.
44
44
 
45
45
  == License
46
46
 
47
- BSD 2-Clause open source license (full license text in the +LICENSE+ file).
47
+ MIT open source license (full license text in the +LICENSE+ file).
48
48
 
49
49
  == Contact
50
50
 
data/salsa20.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'salsa20'
3
- s.version = '0.1.1'
3
+ s.version = '0.1.2'
4
4
 
5
5
  s.summary = "Salsa20 stream cipher algorithm."
6
6
  s.description = <<-EOF
@@ -13,6 +13,7 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.test_files = `git ls-files test`.split("\n")
15
15
 
16
+ s.add_development_dependency 'minitest', "~> 5.0"
16
17
  s.add_development_dependency 'rake', '~> 10.0'
17
18
  s.add_development_dependency 'rake-compiler', '~> 0.9'
18
19
  s.add_development_dependency 'rdoc', '~> 4.0'
data/test/salsa20_test.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "salsa20"))
2
- require 'test/unit'
2
+ require 'minitest/autorun'
3
3
 
4
- class Salsa20Test < Test::Unit::TestCase
4
+ class Salsa20Test < MiniTest::Test
5
5
  def test_salsa20_keystream
6
6
  expected = "@\x8D\x94\xF48f9Z)\e\xBD\xB8?\xCC\xEC\xD6g\xB3;\xC7ev\v\xCA]\xEE\x19I;\xA2<\\^\xCEFQn\x94B{+\x06\xE2\x85\x9F\xEC\xBBp@\xA4\x8F\xD8~\xD3\x12\x197\f\xD7'\x8C\xC8\xEF\xFC"
7
7
  if expected.respond_to?(:force_encoding)
@@ -11,31 +11,31 @@ class Salsa20Test < Test::Unit::TestCase
11
11
  end
12
12
 
13
13
  def test_bad_number_of_arguments_for_new_should_raise_exception
14
- assert_raise(ArgumentError) { Salsa20.new }
15
- assert_raise(ArgumentError) { Salsa20.new("K"*32) }
16
- assert_raise(ArgumentError) { Salsa20.new("K"*32, "I"*8, "third") }
14
+ assert_raises(ArgumentError) { Salsa20.new }
15
+ assert_raises(ArgumentError) { Salsa20.new("K"*32) }
16
+ assert_raises(ArgumentError) { Salsa20.new("K"*32, "I"*8, "third") }
17
17
  end
18
18
 
19
19
  def test_non_string_arguments_for_new_should_raise_exception
20
- assert_raise(TypeError) { Salsa20.new([1,2,3], "I"*8) }
21
- assert_raise(TypeError) { Salsa20.new("K"*32, { "a" => "b"}) }
22
- assert_raise(TypeError) { Salsa20.new([1,2,3], { "a" => "b"}) }
20
+ assert_raises(TypeError) { Salsa20.new([1,2,3], "I"*8) }
21
+ assert_raises(TypeError) { Salsa20.new("K"*32, { "a" => "b"}) }
22
+ assert_raises(TypeError) { Salsa20.new([1,2,3], { "a" => "b"}) }
23
23
  end
24
24
 
25
25
  def test_invalid_key_length_should_raise_exception
26
- assert_raise(Salsa20::InvalidKeyError) { Salsa20.new("K"*15, "I"*8) }
27
- assert_nothing_raised { Salsa20.new("K"*16, "I"*8) }
28
- assert_raise(Salsa20::InvalidKeyError) { Salsa20.new("K"*17, "I"*8) }
29
- assert_raise(Salsa20::InvalidKeyError) { Salsa20.new("K"*31, "I"*8) }
30
- assert_nothing_raised { Salsa20.new("K"*32, "I"*8) }
31
- assert_raise(Salsa20::InvalidKeyError) { Salsa20.new("K"*33, "I"*8) }
26
+ assert_raises(Salsa20::InvalidKeyError) { Salsa20.new("K"*15, "I"*8) }
27
+ Salsa20.new("K"*16, "I"*8) # No exception
28
+ assert_raises(Salsa20::InvalidKeyError) { Salsa20.new("K"*17, "I"*8) }
29
+ assert_raises(Salsa20::InvalidKeyError) { Salsa20.new("K"*31, "I"*8) }
30
+ Salsa20.new("K"*32, "I"*8) # No exception
31
+ assert_raises(Salsa20::InvalidKeyError) { Salsa20.new("K"*33, "I"*8) }
32
32
  end
33
33
 
34
34
  def test_invalid_iv_length_should_raise_exception
35
- assert_raise(Salsa20::InvalidKeyError) { Salsa20.new("K"*32, "I"*7) }
36
- assert_nothing_raised { Salsa20.new("K"*32, "I"*8) }
37
- assert_raise(Salsa20::InvalidKeyError) { Salsa20.new("K"*32, "I"*9) }
38
- assert_raise(Salsa20::InvalidKeyError) { Salsa20.new("K"*32, "I"*16) }
35
+ assert_raises(Salsa20::InvalidKeyError) { Salsa20.new("K"*32, "I"*7) }
36
+ Salsa20.new("K"*32, "I"*8) # No exception
37
+ assert_raises(Salsa20::InvalidKeyError) { Salsa20.new("K"*32, "I"*9) }
38
+ assert_raises(Salsa20::InvalidKeyError) { Salsa20.new("K"*32, "I"*16) }
39
39
  end
40
40
 
41
41
  def test_accessors
@@ -106,7 +106,7 @@ class Salsa20Test < Test::Unit::TestCase
106
106
  assert_equal false, encryptor.closed?
107
107
  encryptor.encrypt(part1)
108
108
  assert_equal true, encryptor.closed?
109
- assert_raise(Salsa20::EngineClosedError) { encryptor.encrypt(part2) }
109
+ assert_raises(Salsa20::EngineClosedError) { encryptor.encrypt(part2) }
110
110
  end
111
111
 
112
112
  def test_seek
@@ -128,7 +128,7 @@ class Salsa20Test < Test::Unit::TestCase
128
128
  the_key = "K"*32
129
129
  the_iv = "L"*8
130
130
  encryptor = Salsa20.new(the_key, the_iv)
131
- assert_raise(Salsa20::IllegalSeekError) { encryptor.seek(65) }
131
+ assert_raises(Salsa20::IllegalSeekError) { encryptor.seek(65) }
132
132
  end
133
133
 
134
134
  def test_seek_and_position_to_large_positions
metadata CHANGED
@@ -1,59 +1,74 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salsa20
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dov Murik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-27 00:00:00.000000000 Z
11
+ date: 2015-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rake
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
- - - ~>
31
+ - - "~>"
18
32
  - !ruby/object:Gem::Version
19
33
  version: '10.0'
20
34
  type: :development
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - ~>
38
+ - - "~>"
25
39
  - !ruby/object:Gem::Version
26
40
  version: '10.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake-compiler
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - ~>
45
+ - - "~>"
32
46
  - !ruby/object:Gem::Version
33
47
  version: '0.9'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - ~>
52
+ - - "~>"
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0.9'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rdoc
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ~>
59
+ - - "~>"
46
60
  - !ruby/object:Gem::Version
47
61
  version: '4.0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - ~>
66
+ - - "~>"
53
67
  - !ruby/object:Gem::Version
54
68
  version: '4.0'
55
- description: ! " Salsa20 is a stream cipher algorithm designed by Daniel Bernstein.
56
- salsa20-ruby provides\n a simple Ruby wrapper.\n"
69
+ description: |2
70
+ Salsa20 is a stream cipher algorithm designed by Daniel Bernstein. salsa20-ruby provides
71
+ a simple Ruby wrapper.
57
72
  email: dov.murik@gmail.com
58
73
  executables: []
59
74
  extensions:
@@ -64,8 +79,8 @@ extra_rdoc_files:
64
79
  - CHANGELOG
65
80
  - lib/salsa20.rb
66
81
  files:
67
- - .gitignore
68
- - .travis.yml
82
+ - ".gitignore"
83
+ - ".travis.yml"
69
84
  - CHANGELOG
70
85
  - Gemfile
71
86
  - LICENSE
@@ -87,27 +102,28 @@ licenses:
87
102
  metadata: {}
88
103
  post_install_message:
89
104
  rdoc_options:
90
- - --title
105
+ - "--title"
91
106
  - salsa20
92
- - --main
107
+ - "--main"
93
108
  - README.rdoc
94
109
  require_paths:
95
110
  - lib
96
111
  required_ruby_version: !ruby/object:Gem::Requirement
97
112
  requirements:
98
- - - ! '>='
113
+ - - ">="
99
114
  - !ruby/object:Gem::Version
100
115
  version: '0'
101
116
  required_rubygems_version: !ruby/object:Gem::Requirement
102
117
  requirements:
103
- - - ! '>='
118
+ - - ">="
104
119
  - !ruby/object:Gem::Version
105
120
  version: '0'
106
121
  requirements: []
107
122
  rubyforge_project:
108
- rubygems_version: 2.2.1
123
+ rubygems_version: 2.4.8
109
124
  signing_key:
110
125
  specification_version: 4
111
126
  summary: Salsa20 stream cipher algorithm.
112
127
  test_files:
113
128
  - test/salsa20_test.rb
129
+ has_rdoc: true