1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
-
+
-
+
|
# Auto generated from "AES-128-CTR.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 AES_128_CTR [expr {[lsearch -nocase [tls::ciphers] AES-128-CTR] > -1}]
tcltest::test Block_AES-128-CTR-1.1 {Encrypt AES-128-CTR} \
tcltest::test Symetric_Block_AES-128-CTR-1.1 {Encrypt AES-128-CTR} \
-constraints AES_128_CTR \
-body {binary encode hex [tls::encrypt -cipher AES-128-CTR -padding 0 \
-key [binary decode hex 2b7e151628aed2a6abf7158809cf4f3c] \
-iv [binary decode hex f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff] \
-data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710]]} \
-match exact -result 874d6191b620e3261bef6864990db6ce9806f66b7970fdff8617187bb9fffdff5ae4df3edbd5d35e5b4f09020db03eab1e031dda2fbe03d1792170a0f3009cee
tcltest::test Block_AES-128-CTR-1.2 {Decrypt AES-128-CTR} \
tcltest::test Symetric_Block_AES-128-CTR-1.2 {Decrypt AES-128-CTR} \
-constraints AES_128_CTR \
-body {binary encode hex [tls::decrypt -cipher AES-128-CTR -padding 0 \
-key [binary decode hex 2b7e151628aed2a6abf7158809cf4f3c] \
-iv [binary decode hex f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff] \
-data [binary decode hex 874d6191b620e3261bef6864990db6ce9806f66b7970fdff8617187bb9fffdff5ae4df3edbd5d35e5b4f09020db03eab1e031dda2fbe03d1792170a0f3009cee]]} \
-match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710
|