# Auto generated from "HMAC_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 HMAC [expr {[lsearch -nocase [tls::macs] HMAC] > -1}]
tcltest::testConstraint SHA3_256 [expr {[lsearch -nocase [tls::digests] SHA3-256] > -1}]
catch {tls::provider legacy}
tcltest::test MAC_HMAC-SHA3-256-1.1 {HMAC_SHA3-256} \
-constraints {HMAC SHA3_256 } \
-setup {} \
-body {string range [tls::hmac -hex -digest SHA3-256 -key [binary decode hex 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f] -data "Sample message for keylen<blocklen"] 0 63} \
-match exact -result 4fe8e202c4f058e8dddc23d8c34e467343e23555e24fc2f025d598f558f67205
tcltest::test MAC_HMAC-SHA3-256-1.2 {HMAC_SHA3-256} \
-constraints {HMAC SHA3_256 } \
-setup {} \
-body {string range [tls::hmac -hex -digest SHA3-256 -key [binary decode hex 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f8081828384858687] -data "Sample message for keylen=blocklen"] 0 63} \
-match exact -result 68b94e2e538a9be4103bebb5aa016d47961d4d1aa906061313b557f8af2c3faa
tcltest::test MAC_HMAC-SHA3-256-1.3 {HMAC_SHA3-256} \
-constraints {HMAC SHA3_256 } \
-setup {} \
-body {string range [tls::hmac -hex -digest SHA3-256 -key [binary decode hex 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7] -data "Sample message for keylen>blocklen"] 0 63} \
-match exact -result 9bcf2c238e235c3ce88404e813bd2f3a97185ac6f238c63d6229a00b07974258
tcltest::test MAC_HMAC-SHA3-256-1.4 {HMAC_SHA3-256} \
-constraints {HMAC SHA3_256 } \
-setup {} \
-body {string range [tls::hmac -hex -digest SHA3-256 -key [binary decode hex 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f] -data "Sample message for keylen<blocklen, with truncated tag"] 0 31} \
-match exact -result c8dc7148d8c1423aa549105dafdf9cad
# Cleanup
::tcltest::cleanupTests
return