5 reference_file
="${scriptdir}/test_scrypt.good"
6 longwait_encrypted_file
="${out}/longwait.enc"
7 longwait_decrypted_file
="${out}/longwait.txt"
8 longwait_failed_log
="${out}/longwait-failed.log"
11 # Encrypt file which should take a long time to decrypt.
14 echo ${password} | ${c_valgrind_cmd} ${bindir}/scrypt \
15 enc
-P -t 10 ${reference_file} \
16 ${longwait_encrypted_file}
17 echo $?
> ${c_exitfile}
20 # Attempt to decrypt it with limited time. We want this
21 # command to fail, so we negate the normal return code.
24 echo ${password} | ${c_valgrind_cmd} ${bindir}/scrypt \
25 dec
-P -t 1 ${longwait_encrypted_file} \
26 ${longwait_decrypted_file} \
27 2> ${longwait_failed_log}
29 echo $?
> ${c_exitfile}
32 # We should have received an error message.
34 if grep -q "scrypt: Decrypting file would take too much CPU time" \
35 ${longwait_failed_log}; then
41 # Attempt to decrypt it with limited time, but force success.
44 echo ${password} | ${c_valgrind_cmd} ${bindir}/scrypt \
45 dec
-P -t 1 -f ${longwait_encrypted_file} \
46 ${longwait_decrypted_file}
47 echo $?
> ${c_exitfile}
50 # The decrypted reference file should match the reference.
52 if cmp -s ${longwait_decrypted_file} ${reference_file}; then
This page took 0.021371 seconds and 4 git commands to generate.