def test_vectors(self):
     for password, hex_salt, expected_key, expected_iv in self.VECTORS:
         salt = crypt_util.unhexize(hex_salt)
         pb_gen = pbkdf1.PBKDF1(password, salt)
         derived_key = pb_gen.read(16)
         derived_iv = pb_gen.read(16)
         hex_derived_key = crypt_util.hexize(derived_key)
         hex_derived_iv = crypt_util.hexize(derived_iv)
         self.assertEqual(hex_derived_key, expected_key)
         self.assertEqual(hex_derived_iv, expected_iv)
Beispiel #2
0
 def test_vectors(self):
     for password, hex_salt, expected_key, expected_iv in self.VECTORS:
         salt = crypt_util.unhexize(hex_salt)
         pb_gen = pbkdf1.PBKDF1(password, salt)
         derived_key = pb_gen.read(16)
         derived_iv = pb_gen.read(16)
         hex_derived_key = crypt_util.hexize(derived_key)
         hex_derived_iv = crypt_util.hexize(derived_iv)
         self.assertEqual(hex_derived_key, expected_key)
         self.assertEqual(hex_derived_iv, expected_iv)
Beispiel #3
0
 def test_unhexize_simple(self):
     for unhexed, hexed in self.VECTORS:
         self.assertEqual(crypt_util.unhexize(hexed), unhexed)
 def test_unhexize_simple(self):
     for unhexed, hexed in self.VECTORS:
         T.assert_equal(crypt_util.unhexize(hexed), unhexed)