ADDED tests/test_vectors/Symetric_Block/DES-EDE3-CBC.test Index: tests/test_vectors/Symetric_Block/DES-EDE3-CBC.test ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-CBC.test @@ -0,0 +1,43 @@ +# Auto generated from "DES-EDE3-CBC.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_EDE3_CBC [expr {[lsearch -nocase [tls::ciphers] DES-EDE3-CBC] > -1}] + +tcltest::test Block_DES-EDE3-CBC-1.1 {Encrypt DES-EDE3-CBC} \ + -constraints DES_EDE3_CBC \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-CBC -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 2079c3d53aa763e193b79e2569ab5262516570481f25b50f73c0bda85c8e0da7 + +tcltest::test Block_DES-EDE3-CBC-1.2 {Decrypt DES-EDE3-CBC} \ + -constraints DES_EDE3_CBC \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-CBC -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 2079c3d53aa763e193b79e2569ab5262516570481f25b50f73c0bda85c8e0da7]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +tcltest::test Block_DES-EDE3-CBC-1.3 {Encrypt DES-EDE3-CBC} \ + -constraints DES_EDE3_CBC \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-CBC -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 7401ce1eab6d003caff84bf47b36cc2154f0238f9ffecd8f6acf118392b45581 + +tcltest::test Block_DES-EDE3-CBC-1.4 {Decrypt DES-EDE3-CBC} \ + -constraints DES_EDE3_CBC \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-CBC -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 7401ce1eab6d003caff84bf47b36cc2154f0238f9ffecd8f6acf118392b45581]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +# Cleanup +::tcltest::cleanupTests +return ADDED tests/test_vectors/Symetric_Block/DES-EDE3-CBC.txt Index: tests/test_vectors/Symetric_Block/DES-EDE3-CBC.txt ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-CBC.txt @@ -0,0 +1,21 @@ +# DES-EDE3-CBC (3DES) +# From FIPS Pub 46-3 + + +# CBC-TDES.Encrypt and CBC-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 32 +Key = 0123456789abcdef23456789abcdef01456789abcdef0123 +IV = f69f2445df4f9b17 +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 2079c3d53aa763e193b79e2569ab5262516570481f25b50f73c0bda85c8e0da7 + +# CBC-TDES.Encrypt and CBC-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 32 +Key = 0123456789abcdef23456789abcdef010123456789abcdef +IV = f69f2445df4f9b17 +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 7401ce1eab6d003caff84bf47b36cc2154f0238f9ffecd8f6acf118392b45581 ADDED tests/test_vectors/Symetric_Block/DES-EDE3-CFB.test Index: tests/test_vectors/Symetric_Block/DES-EDE3-CFB.test ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-CFB.test @@ -0,0 +1,43 @@ +# Auto generated from "DES-EDE3-CFB.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_EDE3_CFB [expr {[lsearch -nocase [tls::ciphers] DES-EDE3-CFB] > -1}] + +tcltest::test Block_DES-EDE3-CFB-1.1 {Encrypt DES-EDE3-CFB} \ + -constraints DES_EDE3_CFB \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-CFB -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 078bb74e59ce7ed67666de9cf95eaf3fe9ed6bb460f451528a5f9fe4ed710918 + +tcltest::test Block_DES-EDE3-CFB-1.2 {Decrypt DES-EDE3-CFB} \ + -constraints DES_EDE3_CFB \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-CFB -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 078bb74e59ce7ed67666de9cf95eaf3fe9ed6bb460f451528a5f9fe4ed710918]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +tcltest::test Block_DES-EDE3-CFB-1.3 {Encrypt DES-EDE3-CFB} \ + -constraints DES_EDE3_CFB \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-CFB -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 6195b9c2c39909c52ef313667b5a66af688672a3993aeae55b931ae24ee24c5c + +tcltest::test Block_DES-EDE3-CFB-1.4 {Decrypt DES-EDE3-CFB} \ + -constraints DES_EDE3_CFB \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-CFB -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6195b9c2c39909c52ef313667b5a66af688672a3993aeae55b931ae24ee24c5c]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +# Cleanup +::tcltest::cleanupTests +return ADDED tests/test_vectors/Symetric_Block/DES-EDE3-CFB.txt Index: tests/test_vectors/Symetric_Block/DES-EDE3-CFB.txt ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-CFB.txt @@ -0,0 +1,21 @@ +# DES-EDE3-CFB1 (3DES) +# From FIPS Pub 46-3 + + +# CFB-TDES.Encrypt and CFB-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 32 +Key = 0123456789abcdef23456789abcdef01456789abcdef0123 +IV = f69f2445df4f9b17 +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 078bb74e59ce7ed67666de9cf95eaf3fe9ed6bb460f451528a5f9fe4ed710918 + +# CFB-TDES.Encrypt and CFB-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 32 +Key = 0123456789abcdef23456789abcdef010123456789abcdef +IV = f69f2445df4f9b17 +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 6195b9c2c39909c52ef313667b5a66af688672a3993aeae55b931ae24ee24c5c ADDED tests/test_vectors/Symetric_Block/DES-EDE3-CFB1.test Index: tests/test_vectors/Symetric_Block/DES-EDE3-CFB1.test ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-CFB1.test @@ -0,0 +1,43 @@ +# Auto generated from "DES-EDE3-CFB1.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_EDE3_CFB1 [expr {[lsearch -nocase [tls::ciphers] DES-EDE3-CFB1] > -1}] + +tcltest::test Block_DES-EDE3-CFB1-1.1 {Encrypt DES-EDE3-CFB1} \ + -constraints DES_EDE3_CFB1 \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-CFB1 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6b]]} \ + -match exact -result 5c + +tcltest::test Block_DES-EDE3-CFB1-1.2 {Decrypt DES-EDE3-CFB1} \ + -constraints DES_EDE3_CFB1 \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-CFB1 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 5c]]} \ + -match exact -result 6b + +tcltest::test Block_DES-EDE3-CFB1-1.3 {Encrypt DES-EDE3-CFB1} \ + -constraints DES_EDE3_CFB1 \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-CFB1 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6b]]} \ + -match exact -result 66 + +tcltest::test Block_DES-EDE3-CFB1-1.4 {Decrypt DES-EDE3-CFB1} \ + -constraints DES_EDE3_CFB1 \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-CFB1 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 66]]} \ + -match exact -result 6b + +# Cleanup +::tcltest::cleanupTests +return ADDED tests/test_vectors/Symetric_Block/DES-EDE3-CFB1.txt Index: tests/test_vectors/Symetric_Block/DES-EDE3-CFB1.txt ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-CFB1.txt @@ -0,0 +1,25 @@ +# DES-EDE3-CFB1 (3DES) +# From FIPS Pub 46-3 + + +# CFB1-TDES.Encrypt and CFB1-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 2 +Key = 0123456789abcdef23456789abcdef01456789abcdef0123 +IV = f69f2445df4f9b17 +# 01101011 +Plaintext = 6b +# 01011100 +Ciphertext = 5c + +# CFB1-TDES.Encrypt and CFB1-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 2 +Key = 0123456789abcdef23456789abcdef010123456789abcdef +IV = f69f2445df4f9b17 +# 01101011 +Plaintext = 6b +# 01100110 +Ciphertext = 66 ADDED tests/test_vectors/Symetric_Block/DES-EDE3-CFB8.test Index: tests/test_vectors/Symetric_Block/DES-EDE3-CFB8.test ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-CFB8.test @@ -0,0 +1,43 @@ +# Auto generated from "DES-EDE3-CFB8.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_EDE3_CFB8 [expr {[lsearch -nocase [tls::ciphers] DES-EDE3-CFB8] > -1}] + +tcltest::test Block_DES-EDE3-CFB8-1.1 {Encrypt DES-EDE3-CFB8} \ + -constraints DES_EDE3_CFB8 \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-CFB8 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6bc1bee22e409f96]]} \ + -match exact -result 07951b729dc23ab4 + +tcltest::test Block_DES-EDE3-CFB8-1.2 {Decrypt DES-EDE3-CFB8} \ + -constraints DES_EDE3_CFB8 \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-CFB8 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 07951b729dc23ab4]]} \ + -match exact -result 6bc1bee22e409f96 + +tcltest::test Block_DES-EDE3-CFB8-1.3 {Encrypt DES-EDE3-CFB8} \ + -constraints DES_EDE3_CFB8 \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-CFB8 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6bc1bee22e409f96]]} \ + -match exact -result 61d86d9aee9693fd + +tcltest::test Block_DES-EDE3-CFB8-1.4 {Decrypt DES-EDE3-CFB8} \ + -constraints DES_EDE3_CFB8 \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-CFB8 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 61d86d9aee9693fd]]} \ + -match exact -result 6bc1bee22e409f96 + +# Cleanup +::tcltest::cleanupTests +return ADDED tests/test_vectors/Symetric_Block/DES-EDE3-CFB8.txt Index: tests/test_vectors/Symetric_Block/DES-EDE3-CFB8.txt ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-CFB8.txt @@ -0,0 +1,21 @@ +# DES-EDE3-CFB1 (3DES) +# From FIPS Pub 46-3 + + +# CFB8-TDES.Encrypt and CFB8-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 8 +Key = 0123456789abcdef23456789abcdef01456789abcdef0123 +IV = f69f2445df4f9b17 +Plaintext = 6bc1bee22e409f96 +Ciphertext = 07951b729dc23ab4 + +# CFB8-TDES.Encrypt and CFB8-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 8 +Key = 0123456789abcdef23456789abcdef010123456789abcdef +IV = f69f2445df4f9b17 +Plaintext = 6bc1bee22e409f96 +Ciphertext = 61d86d9aee9693fd ADDED tests/test_vectors/Symetric_Block/DES-EDE3-CTR.test Index: tests/test_vectors/Symetric_Block/DES-EDE3-CTR.test ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-CTR.test @@ -0,0 +1,43 @@ +# Auto generated from "DES-EDE3-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 DES_EDE3_CTR [expr {[lsearch -nocase [tls::ciphers] DES-EDE3-CTR] > -1}] + +tcltest::test Block_DES-EDE3-CTR-1.1 {Encrypt DES-EDE3-CTR} \ + -constraints DES_EDE3_CTR \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-CTR -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 078bb74e59ce7ed619aa11d25004fb65a03cedf1ba0b09baa3bc81b8f69c1da9 + +tcltest::test Block_DES-EDE3-CTR-1.2 {Decrypt DES-EDE3-CTR} \ + -constraints DES_EDE3_CTR \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-CTR -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 078bb74e59ce7ed619aa11d25004fb65a03cedf1ba0b09baa3bc81b8f69c1da9]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +tcltest::test Block_DES-EDE3-CTR-1.3 {Encrypt DES-EDE3-CTR} \ + -constraints DES_EDE3_CTR \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-CTR -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 6195b9c2c39909c5dbdf92dadbad5a5d1568482bf25c42c96d3853a8e71b010e + +tcltest::test Block_DES-EDE3-CTR-1.4 {Decrypt DES-EDE3-CTR} \ + -constraints DES_EDE3_CTR \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-CTR -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6195b9c2c39909c5dbdf92dadbad5a5d1568482bf25c42c96d3853a8e71b010e]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +# Cleanup +::tcltest::cleanupTests +return ADDED tests/test_vectors/Symetric_Block/DES-EDE3-CTR.txt Index: tests/test_vectors/Symetric_Block/DES-EDE3-CTR.txt ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-CTR.txt @@ -0,0 +1,21 @@ +# DES-EDE3-CTR (3DES) +# From FIPS Pub 46-3 + + +# CTR-TDES.Encrypt and CTR-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 32 +Key = 0123456789abcdef23456789abcdef01456789abcdef0123 +IV = f69f2445df4f9b17 +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 078bb74e59ce7ed619aa11d25004fb65a03cedf1ba0b09baa3bc81b8f69c1da9 + +# CTR-TDES.Encrypt and CTR-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 32 +Key = 0123456789abcdef23456789abcdef010123456789abcdef +IV = f69f2445df4f9b17 +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 6195b9c2c39909c5dbdf92dadbad5a5d1568482bf25c42c96d3853a8e71b010e ADDED tests/test_vectors/Symetric_Block/DES-EDE3-ECB.test Index: tests/test_vectors/Symetric_Block/DES-EDE3-ECB.test ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-ECB.test @@ -0,0 +1,39 @@ +# Auto generated from "DES-EDE3-ECB.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_EDE3_ECB [expr {[lsearch -nocase [tls::ciphers] DES-EDE3-ECB] > -1}] + +tcltest::test Block_DES-EDE3-ECB-1.1 {Encrypt DES-EDE3-ECB} \ + -constraints DES_EDE3_ECB \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-ECB -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 714772f339841d34267fcc4bd2949cc3ee11c22a576a303876183f99c0b6de87 + +tcltest::test Block_DES-EDE3-ECB-1.2 {Decrypt DES-EDE3-ECB} \ + -constraints DES_EDE3_ECB \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-ECB -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -data [binary decode hex 714772f339841d34267fcc4bd2949cc3ee11c22a576a303876183f99c0b6de87]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +tcltest::test Block_DES-EDE3-ECB-1.3 {Encrypt DES-EDE3-ECB} \ + -constraints DES_EDE3_ECB \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-ECB -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 06ede3d82884090aff322c19f0518486730576972a666e58b6c88cf107340d3d + +tcltest::test Block_DES-EDE3-ECB-1.4 {Decrypt DES-EDE3-ECB} \ + -constraints DES_EDE3_ECB \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-ECB -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -data [binary decode hex 06ede3d82884090aff322c19f0518486730576972a666e58b6c88cf107340d3d]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +# Cleanup +::tcltest::cleanupTests +return ADDED tests/test_vectors/Symetric_Block/DES-EDE3-ECB.txt Index: tests/test_vectors/Symetric_Block/DES-EDE3-ECB.txt ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-ECB.txt @@ -0,0 +1,17 @@ +# DES-EDE3-ECB (3DES) +# From FIPS Pub 46-3 + + +# ECB-TDES.Encrypt and ECB-TDES.Decrypt +Klen = 24 +Len = 32 +Key = 0123456789abcdef23456789abcdef01456789abcdef0123 +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 714772f339841d34267fcc4bd2949cc3ee11c22a576a303876183f99c0b6de87 + +# ECB-TDES.Encrypt and ECB-TDES.Decrypt +Klen = 24 +Len = 32 +Key = 0123456789abcdef23456789abcdef010123456789abcdef +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 06ede3d82884090aff322c19f0518486730576972a666e58b6c88cf107340d3d ADDED tests/test_vectors/Symetric_Block/DES-EDE3-OFB.test Index: tests/test_vectors/Symetric_Block/DES-EDE3-OFB.test ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-OFB.test @@ -0,0 +1,43 @@ +# Auto generated from "DES-EDE3-OFB.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_EDE3_OFB [expr {[lsearch -nocase [tls::ciphers] DES-EDE3-OFB] > -1}] + +tcltest::test Block_DES-EDE3-OFB-1.1 {Encrypt DES-EDE3-OFB} \ + -constraints DES_EDE3_OFB \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-OFB -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 078bb74e59ce7ed6267e120692667da1a58662d7e04cbc642144d55c03db5aee + +tcltest::test Block_DES-EDE3-OFB-1.2 {Decrypt DES-EDE3-OFB} \ + -constraints DES_EDE3_OFB \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-OFB -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 078bb74e59ce7ed6267e120692667da1a58662d7e04cbc642144d55c03db5aee]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +tcltest::test Block_DES-EDE3-OFB-1.3 {Encrypt DES-EDE3-OFB} \ + -constraints DES_EDE3_OFB \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3-OFB -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 6195b9c2c39909c53334ba77ffdccc80e485e85f0a63e7646d8d732e33241f94 + +tcltest::test Block_DES-EDE3-OFB-1.4 {Decrypt DES-EDE3-OFB} \ + -constraints DES_EDE3_OFB \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3-OFB -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6195b9c2c39909c53334ba77ffdccc80e485e85f0a63e7646d8d732e33241f94]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +# Cleanup +::tcltest::cleanupTests +return ADDED tests/test_vectors/Symetric_Block/DES-EDE3-OFB.txt Index: tests/test_vectors/Symetric_Block/DES-EDE3-OFB.txt ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3-OFB.txt @@ -0,0 +1,21 @@ +# DES-EDE3-OFB (3DES) +# From FIPS Pub 46-3 + + +# OFB-TDES.Encrypt and OFB-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 32 +Key = 0123456789abcdef23456789abcdef01456789abcdef0123 +IV = f69f2445df4f9b17 +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 078bb74e59ce7ed6267e120692667da1a58662d7e04cbc642144d55c03db5aee + +# OFB-TDES.Encrypt and OFB-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 32 +Key = 0123456789abcdef23456789abcdef010123456789abcdef +IV = f69f2445df4f9b17 +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 6195b9c2c39909c53334ba77ffdccc80e485e85f0a63e7646d8d732e33241f94 ADDED tests/test_vectors/Symetric_Block/DES-EDE3.test Index: tests/test_vectors/Symetric_Block/DES-EDE3.test ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3.test @@ -0,0 +1,39 @@ +# Auto generated from "DES-EDE3.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_EDE3 [expr {[lsearch -nocase [tls::ciphers] DES-EDE3] > -1}] + +tcltest::test Block_DES-EDE3-1.1 {Encrypt DES-EDE3} \ + -constraints DES_EDE3 \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 714772f339841d34267fcc4bd2949cc3ee11c22a576a303876183f99c0b6de87 + +tcltest::test Block_DES-EDE3-1.2 {Decrypt DES-EDE3} \ + -constraints DES_EDE3 \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -data [binary decode hex 714772f339841d34267fcc4bd2949cc3ee11c22a576a303876183f99c0b6de87]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +tcltest::test Block_DES-EDE3-1.3 {Encrypt DES-EDE3} \ + -constraints DES_EDE3 \ + -body {binary encode hex [tls::encrypt -cipher DES-EDE3 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 06ede3d82884090aff322c19f0518486730576972a666e58b6c88cf107340d3d + +tcltest::test Block_DES-EDE3-1.4 {Decrypt DES-EDE3} \ + -constraints DES_EDE3 \ + -body {binary encode hex [tls::decrypt -cipher DES-EDE3 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -data [binary decode hex 06ede3d82884090aff322c19f0518486730576972a666e58b6c88cf107340d3d]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +# Cleanup +::tcltest::cleanupTests +return ADDED tests/test_vectors/Symetric_Block/DES-EDE3.txt Index: tests/test_vectors/Symetric_Block/DES-EDE3.txt ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES-EDE3.txt @@ -0,0 +1,17 @@ +# DES-EDE3-ECB (3DES) +# From FIPS Pub 46-3 + + +# ECB-TDES.Encrypt and ECB-TDES.Decrypt +Klen = 24 +Len = 32 +Key = 0123456789abcdef23456789abcdef01456789abcdef0123 +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 714772f339841d34267fcc4bd2949cc3ee11c22a576a303876183f99c0b6de87 + +# ECB-TDES.Encrypt and ECB-TDES.Decrypt +Klen = 24 +Len = 32 +Key = 0123456789abcdef23456789abcdef010123456789abcdef +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 06ede3d82884090aff322c19f0518486730576972a666e58b6c88cf107340d3d ADDED tests/test_vectors/Symetric_Block/DES3.test Index: tests/test_vectors/Symetric_Block/DES3.test ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES3.test @@ -0,0 +1,43 @@ +# Auto generated from "DES3.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 DES3 [expr {[lsearch -nocase [tls::ciphers] DES3] > -1}] + +tcltest::test Block_DES3-1.1 {Encrypt DES3} \ + -constraints DES3 \ + -body {binary encode hex [tls::encrypt -cipher DES3 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 2079c3d53aa763e193b79e2569ab5262516570481f25b50f73c0bda85c8e0da7 + +tcltest::test Block_DES3-1.2 {Decrypt DES3} \ + -constraints DES3 \ + -body {binary encode hex [tls::decrypt -cipher DES3 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef01456789abcdef0123] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 2079c3d53aa763e193b79e2569ab5262516570481f25b50f73c0bda85c8e0da7]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +tcltest::test Block_DES3-1.3 {Encrypt DES3} \ + -constraints DES3 \ + -body {binary encode hex [tls::encrypt -cipher DES3 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51]]} \ + -match exact -result 7401ce1eab6d003caff84bf47b36cc2154f0238f9ffecd8f6acf118392b45581 + +tcltest::test Block_DES3-1.4 {Decrypt DES3} \ + -constraints DES3 \ + -body {binary encode hex [tls::decrypt -cipher DES3 -padding 0 \ + -key [binary decode hex 0123456789abcdef23456789abcdef010123456789abcdef] \ + -iv [binary decode hex f69f2445df4f9b17] \ + -data [binary decode hex 7401ce1eab6d003caff84bf47b36cc2154f0238f9ffecd8f6acf118392b45581]]} \ + -match exact -result 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 + +# Cleanup +::tcltest::cleanupTests +return ADDED tests/test_vectors/Symetric_Block/DES3.txt Index: tests/test_vectors/Symetric_Block/DES3.txt ================================================================== --- /dev/null +++ tests/test_vectors/Symetric_Block/DES3.txt @@ -0,0 +1,21 @@ +# DES-EDE3-CBC (3DES) +# From FIPS Pub 46-3 + + +# CBC-TDES.Encrypt and CBC-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 32 +Key = 0123456789abcdef23456789abcdef01456789abcdef0123 +IV = f69f2445df4f9b17 +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 2079c3d53aa763e193b79e2569ab5262516570481f25b50f73c0bda85c8e0da7 + +# CBC-TDES.Encrypt and CBC-TDES.Decrypt +Klen = 24 +Ilen = 8 +Len = 32 +Key = 0123456789abcdef23456789abcdef010123456789abcdef +IV = f69f2445df4f9b17 +Plaintext = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext = 7401ce1eab6d003caff84bf47b36cc2154f0238f9ffecd8f6acf118392b45581