HMAC_SHA256.test at [94f8408d0d]

File tests/test_vectors/MAC/HMAC_SHA256.test artifact 42297378eb part of check-in 94f8408d0d


# Auto generated from "HMAC_SHA256.txt"
package require tls
package require tcltest

tcltest::testConstraint HMAC [expr {[lsearch -nocase [tls::macs] HMAC] > -1}]
tcltest::testConstraint SHA256 [expr {[lsearch -nocase [tls::digests] SHA256] > -1}]

tcltest::test MAC_HMAC-SHA256-1.1 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f] -data "Sample message for keylen=blocklen"] 0 63} \
	-match exact -result 8bb9a1db9806f20df7f77b82138c7914d174d59e13dc4d0169c9057b133e1d62

tcltest::test MAC_HMAC-SHA256-1.2 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f] -data "Sample message for keylen<blocklen"] 0 63} \
	-match exact -result a28cf43130ee696a98f14a37678b56bcfcbdd9e5cf69717fecf5480f0ebdf790

tcltest::test MAC_HMAC-SHA256-1.3 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f60616263] -data "Sample message for keylen=blocklen"] 0 63} \
	-match exact -result bdccb6c72ddeadb500ae768386cb38cc41c63dbb0878ddb9c7a38a431b78378d

tcltest::test MAC_HMAC-SHA256-1.4 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f30] -data "Sample message for keylen<blocklen, with truncated tag"] 0 31} \
	-match exact -result 27a8b157839efeac98df070b331d5936

tcltest::test MAC_HMAC-SHA256-1.5 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b] -data "Hi There"] 0 63} \
	-match exact -result b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7

tcltest::test MAC_HMAC-SHA256-1.6 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key "Jefe" -data "what do ya want for nothing?"] 0 63} \
	-match exact -result 5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843

tcltest::test MAC_HMAC-SHA256-1.7 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] -data [binary decode hex dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd]] 0 63} \
	-match exact -result 773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe

tcltest::test MAC_HMAC-SHA256-1.8 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex 0102030405060708090a0b0c0d0e0f10111213141516171819] -data [binary decode hex cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd]] 0 63} \
	-match exact -result 82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b

tcltest::test MAC_HMAC-SHA256-1.9 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex 0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c] -data "Test With Truncation"] 0 31} \
	-match exact -result a3b6167473100ee06e0c796c2955552b

tcltest::test MAC_HMAC-SHA256-1.10 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] -data "Test Using Larger Than Block-Size Key - Hash Key First"] 0 63} \
	-match exact -result 60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54

tcltest::test MAC_HMAC-SHA256-1.11 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] -data "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm."] 0 63} \
	-match exact -result 9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2

tcltest::test MAC_HMAC-SHA256-1.12 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key "key" -data "The quick brown fox jumps over the lazy dog"] 0 63} \
	-match exact -result f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8

tcltest::test MAC_HMAC-SHA256-1.13 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b] -data "Hi There"] 0 63} \
	-match exact -result b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7

tcltest::test MAC_HMAC-SHA256-1.14 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key "Jefe" -data "what do ya want for nothing?"] 0 63} \
	-match exact -result 5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843

tcltest::test MAC_HMAC-SHA256-1.15 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] -data [binary decode hex dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd]] 0 63} \
	-match exact -result 773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe

tcltest::test MAC_HMAC-SHA256-1.16 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex 0102030405060708090a0b0c0d0e0f10111213141516171819] -data [binary decode hex cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd]] 0 63} \
	-match exact -result 82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b

tcltest::test MAC_HMAC-SHA256-1.17 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex 0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c] -data "Test With Truncation"] 0 31} \
	-match exact -result a3b6167473100ee06e0c796c2955552b

tcltest::test MAC_HMAC-SHA256-1.18 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] -data "Test Using Larger Than Block-Size Key - Hash Key First"] 0 63} \
	-match exact -result 60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54

tcltest::test MAC_HMAC-SHA256-1.19 {HMAC_SHA256} \
	-constraints {HMAC SHA256 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA256 -key [binary decode hex aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] -data "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm."] 0 63} \
	-match exact -result 9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2

# Cleanup
::tcltest::cleanupTests
return