aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-11 17:06:52 -0400
committerJack Lloyd <[email protected]>2018-08-11 17:06:52 -0400
commit7fe0cc6081c608d796cdaf0f45b195dbb42841e4 (patch)
tree6f588f0ae1ec0974a15879af11051aecd06732b3 /src/scripts
parent5cde8edd3ff9f79a9f568a803a5d5189e6993813 (diff)
Add scrypt to Python
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/test_python.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/scripts/test_python.py b/src/scripts/test_python.py
index 075560670..e7fb76f0c 100644
--- a/src/scripts/test_python.py
+++ b/src/scripts/test_python.py
@@ -45,6 +45,16 @@ def test():
print('x %s' % hex_encode(psk))
print('y %s\n' % (hex_encode(botan2.pbkdf('PBKDF2(SHA-256)', 'xyz', 32, iterations, salt)[2])))
+ def test_scrypt():
+ scrypt = botan2.scrypt(10, '', '', 16, 1, 1)
+ print(hex_encode(scrypt))
+ assert hex_encode(scrypt) == "77d6576238657b203b19"
+
+ scrypt = botan2.scrypt(32, 'password', 'NaCl', 1024, 8, 16)
+ print(hex_encode(scrypt))
+ assert hex_encode(scrypt) == "fdbabe1c9d3472007856e7190d01e9fe7c6ad7cbc8237830e77376634b373162"
+
+
def test_bcrypt():
print("Testing Bcrypt...")
r = botan2.rng()
@@ -248,6 +258,7 @@ def test():
test_version()
test_kdf()
test_pbkdf()
+ test_scrypt()
test_bcrypt()
test_hmac()
test_rng()