SHA3-256.test at [c0bbfde5a4]

File tests/test_vectors/Hash/SHA3-256.test artifact f3a4dd335c part of check-in c0bbfde5a4


# Auto generated from "SHA3-256.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 SHA3_256 [expr {[lsearch -nocase [tls::digests] SHA3-256] > -1}]
catch {tls::provider legacy}

tcltest::test Hash_SHA3-256-1.1 {SHA3-256} \
	-constraints SHA3_256 \
	-setup {set data ""} \
	-body {tls::digest -digest SHA3-256 -data $data} \
	-match exact -result a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a

tcltest::test Hash_SHA3-256-1.2 {SHA3-256} \
	-constraints SHA3_256 \
	-setup {set data [binary decode hex [string repeat a3 200]]} \
	-body {tls::digest -digest SHA3-256 -data $data} \
	-match exact -result 79f38adec5c20307a98ef76e8324afbfd46cfd81b22e3973c65fa1bd9de31787

tcltest::test Hash_SHA3-256-1.3 {SHA3-256} \
	-constraints SHA3_256 \
	-setup {set data "abc"} \
	-body {tls::digest -digest SHA3-256 -data $data} \
	-match exact -result 3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532

tcltest::test Hash_SHA3-256-1.4 {SHA3-256} \
	-constraints SHA3_256 \
	-setup {set data "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"} \
	-body {tls::digest -digest SHA3-256 -data $data} \
	-match exact -result 41c0dba2a9d6240849100376a8235e2c82e1b9998a999e21db32dd97496d3376

tcltest::test Hash_SHA3-256-1.5 {SHA3-256} \
	-constraints SHA3_256 \
	-setup {set data "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"} \
	-body {tls::digest -digest SHA3-256 -data $data} \
	-match exact -result 916f6061fe879741ca6469b43971dfdb28b1a32dc36cb3254e812be27aad1d18

tcltest::test Hash_SHA3-256-1.6 {SHA3-256} \
	-constraints SHA3_256 \
	-setup {set data [string repeat "a" 1000000]} \
	-body {tls::digest -digest SHA3-256 -data $data} \
	-match exact -result 5c8875ae474a3634ba4fd55ec85bffd661f32aca75c6d699d0cdcb6c115891c1

tcltest::test Hash_SHA3-256-1.7 {SHA3-256} \
	-constraints SHA3_256 \
	-setup {set data [string repeat "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmno" 16777216]} \
	-body {tls::digest -digest SHA3-256 -data $data} \
	-match exact -result ecbbc42cbf296603acb2c6bc0410ef4378bafb24b710357f12df607758b33e2b

# Cleanup
::tcltest::cleanupTests
return