-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·107 lines (78 loc) · 3.11 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
TESTFILE=$1
KEYFILE=$2
ENC_CLI="./yaxafileutil-cli -e -i $TESTFILE -o ${TESTFILE}.enc"
DEC_CLI="./yaxafileutil-cli -d -i ${TESTFILE}.enc -o ${TESTFILE}.plain"
ENC_GUI="./yaxafileutil-gui -q -e -i $TESTFILE -o ${TESTFILE}.enc"
DEC_GUI="./yaxafileutil-gui -q -d -i ${TESTFILE}.enc -o ${TESTFILE}.plain"
ENC_CLI_OTP="./yaxafileutil-cli -e -i $TESTFILE -o ${TESTFILE}.enc -O /dev/urandom"
DEC_CLI_OTP="./yaxafileutil-cli -d -i ${TESTFILE}.enc -o ${TESTFILE}.plain -O ${TESTFILE}.enc.pad"
ENC_GUI_OTP="./yaxafileutil-gui -q -e -i $TESTFILE -o ${TESTFILE}.enc -O /dev/urandom"
DEC_GUI_OTP="./yaxafileutil-gui -q -d -i ${TESTFILE}.enc -o ${TESTFILE}.plain -O ${TESTFILE}.enc.pad"
CMP_RES="cmp ${TESTFILE} ${TESTFILE}.plain"
echo_do() {
echo -e "\t$@"
bash -c "$@"
}
do_test() {
echo_do "$ENC_CLI $@"
echo_do "$DEC_CLI $@"
bash -c "$CMP_RES"
echo ""
echo_do "$ENC_GUI $@"
echo_do "$DEC_GUI $@"
bash -c "$CMP_RES"
echo ""
echo_do "$ENC_GUI $@"
echo_do "$DEC_CLI $@"
bash -c "$CMP_RES"
echo ""
echo_do "$ENC_CLI $@"
echo_do "$DEC_GUI $@"
bash -c "$CMP_RES"
echo ""
}
do_test_otp() {
echo_do "$ENC_CLI_OTP $@"
echo_do "$DEC_CLI_OTP $@"
bash -c "$CMP_RES"
echo ""
echo_do "$ENC_GUI_OTP $@"
echo_do "$DEC_GUI_OTP $@"
bash -c "$CMP_RES"
echo ""
echo_do "$ENC_GUI_OTP $@"
echo_do "$DEC_CLI_OTP $@"
bash -c "$CMP_RES"
echo ""
echo_do "$ENC_CLI_OTP $@"
echo_do "$DEC_GUI_OTP $@"
bash -c "$CMP_RES"
echo ""
}
echo "Testing with password and default paramaters"
do_test "-p password"
echo "Testing with password and non-default scrypt work factors"
do_test "-p password -w N=1024"
echo "Testing with password and non-default scrypt work factors, and non-default key size"
do_test "-p password -w N=1024 -s key_size=64b"
echo "Testing with password and non-default scrypt work factors, non-default key size and non-default buffers"
do_test "-p password -w N=1024 -s key_size=64b,mac_buffer=64m,message_buffer=64m"
echo "Testing with keyfile with default parameters"
do_test "-k $KEYFILE"
echo "Testing with keyfile and password with default parameters"
do_test "-k $KEYFILE -p password"
echo "Testing with keyfile and password with non-default keysize"
do_test "-k $KEYFILE -p password -s key_size=64b"
echo "Testing with keyfile and password with non-default scrypt work factors and non-default buffers"
do_test "-k $KEYFILE -p password -w N=1024 -s mac_buffer=64m,message_buffer=64m"
echo "Testing with one-time-pad and defaults"
do_test_otp ""
echo "Testing with one-time-pad and password with default parameters"
do_test_otp "-p password"
echo "Testing with one-time-pad and password with non-default scrypt parameters"
do_test_otp "-p password -w N=1024"
echo "Testing with one-time-pad and password with non-default scrypt parameters and keysize"
do_test_otp "-p password -w N=1024 -s key_size=64b"
echo "Testing with one-time-pad and password with non-default scrypt parameters, keysize and non-default buffers"
do_test_otp "-p password -w N=1024 -s key_size=64b,mac_buffer=64m,message_buffer=64m"