Artifact [764174ce91]
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA

Artifact 764174ce918b843ea346d4b08f9885d7bed3e152a1bcd23215d806e8ced917c3:


# Auto generated from "DES-OFB8.txt"
lappend auto_path [file dirname [file dirname [file dirname [file dirname [file join [pwd] [info script]]]]]]
package require tls
package require tcltest

catch {tls::provider legacy}
tcltest::testConstraint DES_OFB8 [expr {[lsearch -nocase [tls::ciphers] DES-OFB8] > -1}]

tcltest::test Block_DES-OFB8-1.1 {Encrypt DES-OFB8} \
	-constraints DES_OFB8 \
	-body {binary encode hex [tls::encrypt -cipher DES-OFB8 -padding 0 \
		 -key [binary decode hex 0123456789abcdef] \
		 -iv [binary decode hex 1234567890abcdef] \
		 -data [binary decode hex 4e6f7720697320746865]]} \
	-match exact -result f34a2850c9c64985d684

tcltest::test Block_DES-OFB8-1.2 {Decrypt DES-OFB8} \
	-constraints DES_OFB8 \
	-body {binary encode hex [tls::decrypt -cipher DES-OFB8 -padding 0 \
		 -key [binary decode hex 0123456789abcdef] \
		 -iv [binary decode hex 1234567890abcdef] \
		 -data [binary decode hex f34a2850c9c64985d684]]} \
	-match exact -result 4e6f7720697320746865

# Cleanup
::tcltest::cleanupTests
return