Artifact [97f8b6bb77]

Artifact 97f8b6bb77dfc715b9979deed2998bb454acb86975400045cc7313b35fae77a9:


# Auto generated from "HMAC_SHA384.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 HMAC [expr {[lsearch -nocase [tls::macs] HMAC] > -1}]
tcltest::testConstraint SHA384 [expr {[lsearch -nocase [tls::digests] SHA384] > -1}]
catch {tls::provider legacy}

tcltest::test MAC_HMAC-SHA384-1.1 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -key [binary decode hex 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f] -data "Sample message for keylen=blocklen"] 0 95} \
	-match exact -result 63c5daa5e651847ca897c95814ab830bededc7d25e83eef9195cd45857a37f448947858f5af50cc2b1b730ddf29671a9

tcltest::test MAC_HMAC-SHA384-1.2 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -key [binary decode hex 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f] -data "Sample message for keylen<blocklen"] 0 95} \
	-match exact -result 6eb242bdbb582ca17bebfa481b1e23211464d2b7f8c20b9ff2201637b93646af5ae9ac316e98db45d9cae773675eeed0

tcltest::test MAC_HMAC-SHA384-1.3 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -key [binary decode hex 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7] -data "Sample message for keylen=blocklen"] 0 95} \
	-match exact -result 5b664436df69b0ca22551231a3f0a3d5b4f97991713cfa84bff4d0792eff96c27dccbbb6f79b65d548b40e8564cef594

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

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

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

tcltest::test MAC_HMAC-SHA384-1.7 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -key [binary decode hex aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] -data [binary decode hex dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd]] 0 95} \
	-match exact -result 88062608d3e6ad8a0aa2ace014c8a86f0aa635d947ac9febe83ef4e55966144b2a5ab39dc13814b94e3ab6e101a34f27

tcltest::test MAC_HMAC-SHA384-1.8 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -key [binary decode hex 0102030405060708090a0b0c0d0e0f10111213141516171819] -data [binary decode hex cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd]] 0 95} \
	-match exact -result 3e8a69b7783c25851933ab6290af6ca77a9981480850009cc5577c6e1f573b4e6801dd23c4a7d679ccf8a386c674cffb

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

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

tcltest::test MAC_HMAC-SHA384-1.11 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -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 95} \
	-match exact -result 6617178e941f020d351e2f254e8fd32c602420feb0b8fb9adccebb82461e99c5a678cc31e799176d3860e6110c46523e

tcltest::test MAC_HMAC-SHA384-1.12 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -key [binary decode hex 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b] -data "Hi There"] 0 95} \
	-match exact -result afd03944d84895626b0825f4ab46907f15f9dadbe4101ec682aa034c7cebc59cfaea9ea9076ede7f4af152e8b2fa9cb6

tcltest::test MAC_HMAC-SHA384-1.13 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -key "Jefe" -data "what do ya want for nothing?"] 0 95} \
	-match exact -result af45d2e376484031617f78d2b58a6b1b9c7ef464f5a01b47e42ec3736322445e8e2240ca5e69e2c78b3239ecfab21649

tcltest::test MAC_HMAC-SHA384-1.14 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -key [binary decode hex aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] -data [binary decode hex dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd]] 0 95} \
	-match exact -result 88062608d3e6ad8a0aa2ace014c8a86f0aa635d947ac9febe83ef4e55966144b2a5ab39dc13814b94e3ab6e101a34f27

tcltest::test MAC_HMAC-SHA384-1.15 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -key [binary decode hex 0102030405060708090a0b0c0d0e0f10111213141516171819] -data [binary decode hex cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd]] 0 95} \
	-match exact -result 3e8a69b7783c25851933ab6290af6ca77a9981480850009cc5577c6e1f573b4e6801dd23c4a7d679ccf8a386c674cffb

tcltest::test MAC_HMAC-SHA384-1.16 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -key [binary decode hex 0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c] -data "Test With Truncation"] 0 31} \
	-match exact -result 3abf34c3503b2a23a46efc619baef897

tcltest::test MAC_HMAC-SHA384-1.17 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -key [binary decode hex aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] -data "Test Using Larger Than Block-Size Key - Hash Key First"] 0 95} \
	-match exact -result 4ece084485813e9088d2c63a041bc5b44f9ef1012a2b588f3cd11f05033ac4c60c2ef6ab4030fe8296248df163f44952

tcltest::test MAC_HMAC-SHA384-1.18 {HMAC_SHA384} \
	-constraints {HMAC SHA384 } \
	-setup {} \
	-body {string range [tls::hmac -hex -digest SHA384 -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 95} \
	-match exact -result 6617178e941f020d351e2f254e8fd32c602420feb0b8fb9adccebb82461e99c5a678cc31e799176d3860e6110c46523e

# Cleanup
::tcltest::cleanupTests
return