Commits

Kelvin Wong  committed 2fca69f Draft

Decrypt should be somewhat larger value since encryption time may not always be known

  • Participants
  • Parent commits 3a23ef0

Comments (0)

Files changed (1)

File tests/test_scrypt.py

         self.input = "message"
         self.password = "password"
         self.longinput = str(urandom(100000))
+        self.five_minutes = 300
+        self.five_seconds = 5
         self.one_byte = 1  # in Bytes
         self.one_megabyte = 1024 * 1024  # in Bytes
         self.ten_megabytes = 10 * self.one_megabyte
 
     def test_decrypt_maxtime_positional(self):
         """Test decrypt function accepts third positional argument"""
-        m = scrypt.decrypt(self.ciphertext, self.password, 1.0)
+        m = scrypt.decrypt(self.ciphertext, self.password, self.five_seconds)
         self.assertEqual(m, self.input)
 
     def test_decrypt_maxtime_keyword_argument(self):
 
     def test_decrypt_maxmem_positional(self):
         """Test decrypt function accepts fourth positional argument"""
-        m = scrypt.decrypt(self.ciphertext, self.password, 0.1, self.ten_megabytes)
+        m = scrypt.decrypt(self.ciphertext, self.password, self.five_minutes, self.ten_megabytes)
         self.assertEqual(m, self.input)
 
     def test_decrypt_maxmem_keyword_argument(self):
 
     def test_decrypt_maxmemfrac_positional(self):
         """Test decrypt function accepts maxmem keyword argument"""
-        m = scrypt.decrypt(self.ciphertext, self.password, 0.1, self.one_megabyte, 0.0625)
+        m = scrypt.decrypt(self.ciphertext, self.password, self.five_minutes, self.one_megabyte, 0.0625)
         self.assertEqual(m, self.input)
 
     def test_decrypt_maxmemfrac_keyword_argument(self):