Permalink
Browse files

feistel is now tested

  • Loading branch information...
Robert Sosinski
Robert Sosinski committed Jul 30, 2008
1 parent 8242f18 commit b10da4af05123048559451f4903aca0275f9fe5f
Showing with 22 additions and 2 deletions.
  1. +18 −0 test/feistel.yml
  2. +4 −2 test/feistel_test.rb
View
@@ -0,0 +1,18 @@
+half_block: [0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 0, 1, 0, 1]
+
+sub_key: [1, 0, 1, 0, 1, 1,
+ 0, 1, 1, 1, 0, 1,
+ 1, 0, 1, 1, 0, 1,
+ 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 0, 1, 0,
+ 0, 0, 0, 1, 0, 0,
+ 0, 0, 0, 1, 1, 0,
+ 1, 0, 1, 1, 1, 1]
+
+output: [1, 0, 0, 1, 1, 1, 0, 0,
+ 0, 1, 1, 0, 0, 1, 0, 0,
+ 0, 1, 0, 1, 1, 1, 1, 0,
+ 1, 0, 1, 1, 0, 0, 0, 0]
View
@@ -1,7 +1,9 @@
require 'test_helper'
class FeistelTest < Test::Unit::TestCase
- def test_truth
- assert true
+ fixtures :feistel
+
+ def test_run
+ assert_equal feistel(:output), Feistel.run(feistel(:half_block), feistel(:sub_key))
end
end

0 comments on commit b10da4a

Please sign in to comment.