added versioning tests for argon2

This commit is contained in:
jhigh 2019-10-14 14:37:31 +00:00
parent d08d589de9
commit b640afc213
1 changed files with 59 additions and 0 deletions

View File

@ -58,6 +58,59 @@ argon2_argon2d_k2096_p2_t4_body() {
'echo -n 'password' | argon2 somesalt -e -d -k 2096 -p 2 -t 4'
}
atf_test_case argon2_argon2id_k2096_p1_v10
argon2_argon2id_k2096_p1_v10_head() {
atf_set "descr" "ATF test for argon2 argon2id,k=2096,p=1,v=10"
}
argon2_argon2id_k2096_p1_v10_body() {
atf_check -s exit:0 -o match:"^\\\$argon2id\\\$v=16\\\$m=2096,t=3,p=1" -x \
'echo -n 'password' | argon2 somesalt -e -id -k 2096 -p 1 -v 10'
}
atf_test_case argon2_argon2id_k2096_p1_v13
argon2_argon2id_k2096_p1_v13_head() {
atf_set "descr" "ATF test for argon2 argon2id,k=2096,p=1,v=13"
}
argon2_argon2id_k2096_p1_v13_body() {
atf_check -s exit:0 -o match:"^\\\$argon2id\\\$v=19\\\$m=2096,t=3,p=1" -x \
'echo -n 'password' | argon2 somesalt -e -id -k 2096 -p 1 -v 13'
}
atf_test_case argon2_argon2i_k2096_p1_v10
argon2_argon2i_k2096_p1_v10_head() {
atf_set "descr" "ATF test for argon2 argon2i,k=2096,p=1,v=10"
}
argon2_argon2i_k2096_p1_v10_body() {
atf_check -s exit:0 -o match:"^\\\$argon2i\\\$v=16\\\$m=2096,t=3,p=1" -x \
'echo -n 'password' | argon2 somesalt -e -i -k 2096 -p 1 -v 10'
}
atf_test_case argon2_argon2i_k2096_p1_v13
argon2_argon2i_k2096_p1_v13_head() {
atf_set "descr" "ATF test for argon2 argon2i,k=2096,p=1,v=13"
}
argon2_argon2i_k2096_p1_v13_body() {
atf_check -s exit:0 -o match:"^\\\$argon2i\\\$v=19\\\$m=2096,t=3,p=1" -x \
'echo -n 'password' | argon2 somesalt -e -i -k 2096 -p 1 -v 13'
}
atf_test_case argon2_argon2d_k2096_p1_v10
argon2_argon2d_k2096_p1_v10_head() {
atf_set "descr" "ATF test for argon2 argon2d,k=2096,p=1,v=10"
}
argon2_argon2d_k2096_p1_v10_body() {
atf_check -s exit:0 -o match:"^\\\$argon2d\\\$v=16\\\$m=2096,t=3,p=1" -x \
'echo -n 'password' | argon2 somesalt -e -d -k 2096 -p 1 -v 10'
}
atf_test_case argon2_argon2d_k2096_p1_v13
argon2_argon2d_k2096_p1_v13_head() {
atf_set "descr" "ATF test for argon2 argon2d,k=2096,p=1,v=13"
}
argon2_argon2d_k2096_p1_v13_body() {
atf_check -s exit:0 -o match:"^\\\$argon2d\\\$v=19\\\$m=2096,t=3,p=1" -x \
'echo -n 'password' | argon2 somesalt -e -d -k 2096 -p 1 -v 13'
}
atf_init_test_cases()
{
@ -67,4 +120,10 @@ atf_init_test_cases()
atf_add_test_case argon2_argon2id_k2096_p2_t3
atf_add_test_case argon2_argon2i_k2096_p1_t4
atf_add_test_case argon2_argon2d_k2096_p2_t4
atf_add_test_case argon2_argon2id_k2096_p1_v10
atf_add_test_case argon2_argon2id_k2096_p1_v13
atf_add_test_case argon2_argon2i_k2096_p1_v10
atf_add_test_case argon2_argon2i_k2096_p1_v13
atf_add_test_case argon2_argon2d_k2096_p1_v10
atf_add_test_case argon2_argon2d_k2096_p1_v13
}