Kelvin Wong avatar Kelvin Wong committed 2fca69f Draft

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

Comments (0)

Files changed (1)

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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.