SHA1.test at [59eac2fc22]

File tests/test_vectors/Hash/SHA1.test artifact b788694073 part of check-in 59eac2fc22


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

tcltest::test Hash_SHA1-1.1 {SHA1} \
	-constraints SHA1 \
	-setup {set data ""} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result da39a3ee5e6b4b0d3255bfef95601890afd80709

tcltest::test Hash_SHA1-1.2 {SHA1} \
	-constraints SHA1 \
	-setup {set data "abc"} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result a9993e364706816aba3e25717850c26c9cd0d89d

tcltest::test Hash_SHA1-1.3 {SHA1} \
	-constraints SHA1 \
	-setup {set data "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result 84983e441c3bd26ebaae4aa1f95129e5e54670f1

tcltest::test Hash_SHA1-1.4 {SHA1} \
	-constraints SHA1 \
	-setup {set data "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result a49b2446a02c645bf419f995b67091253a04a259

tcltest::test Hash_SHA1-1.5 {SHA1} \
	-constraints SHA1 \
	-setup {set data [string repeat "a" 1000000]} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result 34aa973cd4c4daa4f61eeb2bdbad27316534016f

tcltest::test Hash_SHA1-1.6 {SHA1} \
	-constraints SHA1 \
	-setup {set data [string repeat "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmno" 16777216]} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result 7789f0c9ef7bfc40d93311143dfbe69e2017f592

tcltest::test Hash_SHA1-1.7 {SHA1} \
	-constraints SHA1 \
	-setup {set data "The quick brown fox jumps over the lazy dog"} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12

tcltest::test Hash_SHA1-1.8 {SHA1} \
	-constraints SHA1 \
	-setup {set data "abc"} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result a9993e364706816aba3e25717850c26c9cd0d89d

tcltest::test Hash_SHA1-1.9 {SHA1} \
	-constraints SHA1 \
	-setup {set data "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result 84983e441c3bd26ebaae4aa1f95129e5e54670f1

tcltest::test Hash_SHA1-1.10 {SHA1} \
	-constraints SHA1 \
	-setup {set data [string repeat "a" 1000000]} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result 34aa973cd4c4daa4f61eeb2bdbad27316534016f

tcltest::test Hash_SHA1-1.11 {SHA1} \
	-constraints SHA1 \
	-setup {set data [string repeat "0123456701234567012345670123456701234567012345670123456701234567" 10]} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result dea356a2cddd90c7a7ecedc5ebb563934f460452

tcltest::test Hash_SHA1-1.12 {SHA1} \
	-constraints SHA1 \
	-setup {set data [binary decode hex 5e]} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result 5e6f80a34a9798cafc6a5db96cc57ba4c4db59c2

tcltest::test Hash_SHA1-1.13 {SHA1} \
	-constraints SHA1 \
	-setup {set data [binary decode hex 9a7dfdf1ecead06ed646aa55fe757146]} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result 82abff6605dbe1c17def12a394fa22a82b544a35

tcltest::test Hash_SHA1-1.14 {SHA1} \
	-constraints SHA1 \
	-setup {set data [binary decode hex f78f92141bcd170ae89b4fba15a1d59f3fd84d223c9251bdacbbae61d05ed115a06a7ce117b7beead24421ded9c32592bd57edeae39c39fa1fe8946a84d0cf1f7beead1713e2e0959897347f67c80b0400c209815d6b10a683836fd5562a56cab1a28e81b6576654631cf16566b86e3b33a108b05307c00aff14a768ed7350606a0f85e6a91d396f5b5cbe577f9b38807c7d523d6d792f6ebc24a4ecf2b3a427cdbbfb]} \
	-body {tls::digest -digest SHA1 -data $data} \
	-match exact -result cb0082c8f197d260991ba6a460e76e202bad27b3

# Cleanup
::tcltest::cleanupTests
return