package provide app-cvnts_00 1.0

package require Tcl
package require crc32
package require aes


set my_key   [binary format H* FEDCBA98FEDCBA98FEDCBA98FEDCBA98]
set my_msg_1 [binary format H* 2a666624a86d4c29de37b520781c1069]
set my_msg_2 [binary format H* 2a666624a86d4c29de37b520781c1068]
set my_msg_3 [binary format H* 2a666624a86d4c29de37b520781c106A]
set my_msg_4 [binary format H* 2a666624a86d4c29de37b520781c1059]



#msg_2
puts "\n msg_2"
puts [aes::aes -hex -mode ecb -dir decrypt -key $my_key "\x2a\x66\x66\x24\xa8\x6d\x4c\x29\xde\x37\xb5\x20\x78\x1c\x10\x68"]
puts [aes::aes -hex -mode ecb -dir decrypt -key $my_key $my_msg_2]
#msg_3
puts "\n msg_3"
puts [aes::aes -hex -mode ecb -dir decrypt -key $my_key "\x2a\x66\x66\x24\xa8\x6d\x4c\x29\xde\x37\xb5\x20\x78\x1c\x10\x6A"]
puts [aes::aes -hex -mode ecb -dir decrypt -key $my_key $my_msg_3]
#msg_4
puts "\n msg_4"
puts [aes::aes -hex -mode ecb -dir decrypt -key $my_key "\x2a\x66\x66\x24\xa8\x6d\x4c\x29\xde\x37\xb5\x20\x78\x1c\x10\x59"]
puts [aes::aes -hex -mode ecb -dir decrypt -key $my_key $my_msg_4]
#msg_1
puts "\n msg_1"
puts [aes::aes -hex -mode ecb -dir decrypt -key $my_key "\x2a\x66\x66\x24\xa8\x6d\x4c\x29\xde\x37\xb5\x20\x78\x1c\x10\x69"]
puts [aes::aes -hex -mode ecb -dir decrypt -key $my_key $my_msg_1]
# "Note: the result must be 01000000000000003D5AFBB584A29F57 "
# you can check it at http://www.unsw.adfa.edu.au/~lpb/src/AEScalc/AEScalc.html
# The problems seems related to the fact that there are a number of zero consecutives values 
