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)
def test_hexize_simple(self): for unhexed, hexed in self.VECTORS: self.assertEqual(crypt_util.hexize(unhexed), hexed)
def test_hexize_simple(self): for unhexed, hexed in self.VECTORS: T.assert_equal(crypt_util.hexize(unhexed), hexed)