Run of fresh-snapshots for ruby-salsa20
Try this locally package):
debcheckout ruby-salsa20
cd ruby-salsa20
new-upstream --snapshot --import-only
Summary
new-upstream --snapshot --import-onlyDiff
Branch: pristine-tar
diff --git a/ruby-salsa20_0.1.3+git20200913.355af05.orig.tar.gz.delta b/ruby-salsa20_0.1.3+git20200913.355af05.orig.tar.gz.delta
new file mode 100644
index 0000000..9908786
Binary files /dev/null and b/ruby-salsa20_0.1.3+git20200913.355af05.orig.tar.gz.delta differ
diff --git a/ruby-salsa20_0.1.3+git20200913.355af05.orig.tar.gz.id b/ruby-salsa20_0.1.3+git20200913.355af05.orig.tar.gz.id
new file mode 100644
index 0000000..67655a0
--- /dev/null
+++ b/ruby-salsa20_0.1.3+git20200913.355af05.orig.tar.gz.id
@@ -0,0 +1 @@
+5724fc2fed09a255da9081141d8da49aeeb325c5
Branch: upstream
Tag: upstream/0.1.3+git20200913.355af05diff --git a/.travis.yml b/.travis.yml
index bfbd8f1..d23d4aa 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,6 +3,6 @@ sudo: false
cache: bundler
rvm:
- ruby-head
+ - 2.7
+ - 2.6
- 2.5
- - 2.4
- - 2.3
diff --git a/Rakefile b/Rakefile
index e7da303..e09d5cb 100644
--- a/Rakefile
+++ b/Rakefile
@@ -13,6 +13,7 @@ Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/*test.rb']
t.verbose = true
+ t.options = "--verbose"
end
RDoc::Task.new do |rdoc|
diff --git a/salsa20.gemspec b/salsa20.gemspec
index 716b433..49803f5 100644
--- a/salsa20.gemspec
+++ b/salsa20.gemspec
@@ -14,11 +14,10 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files test`.split("\n")
s.add_development_dependency 'minitest', "~> 5.0"
- s.add_development_dependency 'rake', '~> 12.0'
+ s.add_development_dependency 'rake', '~> 13.0'
s.add_development_dependency 'rake-compiler', '~> 1.0'
s.add_development_dependency 'rdoc', '~> 6.0'
- s.has_rdoc = true
s.rdoc_options += ['--title', 'salsa20', '--main', 'README.rdoc']
s.extra_rdoc_files += ['README.rdoc', 'LICENSE', 'CHANGELOG', 'lib/salsa20.rb']
diff --git a/test/salsa20_test.rb b/test/salsa20_test.rb
index 3a3b1a7..2b5b73d 100644
--- a/test/salsa20_test.rb
+++ b/test/salsa20_test.rb
@@ -140,4 +140,37 @@ class Salsa20Test < MiniTest::Test
encryptor.seek(large_position)
assert_equal large_position, encryptor.position
end
+
+ # https://cr.yp.to/snuffle/salsafamily-20071225.pdf section 4.1
+ def test_vector_from_salsa20_family_paper
+ # From the paper:
+ #
+ # For example, here is the starting array for key (1, 2, 3, 4, 5, ..., 32),
+ # nonce (3, 1, 4, 1, 5, 9, 2, 6), and block 7:
+ #
+ the_key = (1..32).to_a.pack("C*")
+ the_iv = [3, 1, 4, 1, 5, 9, 2, 6].pack("C*")
+ seek_block = 7
+
+ encryptor = Salsa20.new(the_key, the_iv)
+ encryptor.seek(seek_block * 64)
+ # To obtain the keystream, encrypt a plaintext of zeroes:
+ cipher_text = encryptor.encrypt("\x00" * 64)
+
+ # The encrypted test vector from section 4.1:
+ #
+ # 0xb9a205a3, 0x0695e150, 0xaa94881a, 0xadb7b12c,
+ # 0x798942d4, 0x26107016, 0x64edb1a4, 0x2d27173f,
+ # 0xb1c7f1fa, 0x62066edc, 0xe035fa23, 0xc4496f04,
+ # 0x2131e6b3, 0x810bde28, 0xf62cb407, 0x6bdede3d.
+ #
+ # The author presented it as little-endian words; here we treat it as
+ # a string of bytes:
+ expected = "\xa3\x05\xa2\xb9\x50\xe1\x95\x06\x1a\x88\x94\xaa\x2c\xb1\xb7\xad" +
+ "\xd4\x42\x89\x79\x16\x70\x10\x26\xa4\xb1\xed\x64\x3f\x17\x27\x2d" +
+ "\xfa\xf1\xc7\xb1\xdc\x6e\x06\x62\x23\xfa\x35\xe0\x04\x6f\x49\xc4" +
+ "\xb3\xe6\x31\x21\x28\xde\x0b\x81\x07\xb4\x2c\xf6\x3d\xde\xde\x6b"
+ expected.force_encoding(Encoding::BINARY)
+ assert_equal expected, cipher_text
+ end
end