Commit 3472906

mokha <mo@mokhan.ca>
2018-11-24 18:27:35
try to clarify magic numbers.
1 parent aabfdb6
Changed files (1)
spec
spec/xml/kit/crypto/symmetric_cipher_spec.rb
@@ -12,17 +12,15 @@ RSpec.describe ::Xml::Kit::Crypto::SymmetricCipher do
 
       let(:key) { SecureRandom.hex(key_size[algorithm]) }
       let(:key_size) do
-        hash = Hash.new(16)
-        hash['aes128-cbc'] = 8
-        hash['aes192-cbc'] = 12
-        hash['tripledes-cbc'] = 12
+        hash = Hash.new(32/2)
+        hash['aes128-cbc'] = 16/2
+        hash['aes192-cbc'] = 24/2
+        hash['tripledes-cbc'] = 24/2
         hash
       end
       let(:uuid) { SecureRandom.uuid }
 
-      it 'encrypts/decrypts' do
-        expect(subject.decrypt(subject.encrypt(uuid))).to eql(uuid)
-      end
+      specify { expect(subject.decrypt(subject.encrypt(uuid))).to eql(uuid) }
     end
   end
 end