# Auto generated from "PBKDF2-SHA1.txt"
lappend auto_path [file dirname [file dirname [file dirname [file dirname [file join [pwd] [info script]]]]]]
package require tls
package require tcltest
tcltest::testConstraint PBKDF2 [expr {[lsearch -nocase [tls::kdfs] PBKDF2] > -1}]
tcltest::testConstraint SHA1 [expr {[lsearch -nocase [tls::digests] SHA1] > -1}]
catch {tls::provider legacy}
tcltest::test KDF_PBKDF2-SHA1-1.1 {PBKDF2-SHA1} \
-constraints {PBKDF2 SHA1} \
-setup {} \
-body {binary encode hex [tls::pbkdf2 -digest SHA1 -password "password" -salt "salt" -iterations 1 -size 20]} \
-match exact -result 0c60c80f961f0e71f3a9b524af6012062fe037a6
tcltest::test KDF_PBKDF2-SHA1-1.2 {PBKDF2-SHA1} \
-constraints {PBKDF2 SHA1} \
-setup {} \
-body {binary encode hex [tls::pbkdf2 -digest SHA1 -password "password" -salt "salt" -iterations 2 -size 20]} \
-match exact -result ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957
tcltest::test KDF_PBKDF2-SHA1-1.3 {PBKDF2-SHA1} \
-constraints {PBKDF2 SHA1} \
-setup {} \
-body {binary encode hex [tls::pbkdf2 -digest SHA1 -password "password" -salt "salt" -iterations 4096 -size 20]} \
-match exact -result 4b007901b765489abead49d926f721d065a429c1
tcltest::test KDF_PBKDF2-SHA1-1.4 {PBKDF2-SHA1} \
-constraints {PBKDF2 SHA1} \
-setup {} \
-body {binary encode hex [tls::pbkdf2 -digest SHA1 -password "password" -salt "salt" -iterations 16777216 -size 20]} \
-match exact -result eefe3d61cd4da4e4e9945b3d6ba2158c2634e984
tcltest::test KDF_PBKDF2-SHA1-1.5 {PBKDF2-SHA1} \
-constraints {PBKDF2 SHA1} \
-setup {} \
-body {binary encode hex [tls::pbkdf2 -digest SHA1 -password "passwordPASSWORDpassword" -salt "saltSALTsaltSALTsaltSALTsaltSALTsalt" -iterations 4096 -size 25]} \
-match exact -result 3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038
tcltest::test KDF_PBKDF2-SHA1-1.6 {PBKDF2-SHA1} \
-constraints {PBKDF2 SHA1} \
-setup {} \
-body {binary encode hex [tls::pbkdf2 -digest SHA1 -password "pass\0word" -salt "sa\0lt" -iterations 4096 -size 16]} \
-match exact -result 56fa6aa75548099dcc37d7f03425e0c3
# Cleanup
::tcltest::cleanupTests
return