diff options
Diffstat (limited to 'openssl/src/crypto/symm.rs')
| -rw-r--r-- | openssl/src/crypto/symm.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/openssl/src/crypto/symm.rs b/openssl/src/crypto/symm.rs index c0e845dc..935980f3 100644 --- a/openssl/src/crypto/symm.rs +++ b/openssl/src/crypto/symm.rs @@ -37,6 +37,9 @@ pub enum Type { AES_256_CFB128, AES_256_CFB8, + DES_CBC, + DES_ECB, + RC4_128, } @@ -362,4 +365,26 @@ mod tests { cipher_test(super::Type::AES_256_CFB8, pt, ct, key, iv); } + + #[test] + fn test_des_cbc() { + + let pt = "54686973206973206120746573742e"; + let ct = "6f2867cfefda048a4046ef7e556c7132"; + let key = "7cb66337f3d3c0fe"; + let iv = "0001020304050607"; + + cipher_test(super::Type::DES_CBC, pt, ct, key, iv); + } + + #[test] + fn test_des_ecb() { + + let pt = "54686973206973206120746573742e"; + let ct = "0050ab8aecec758843fe157b4dde938c"; + let key = "7cb66337f3d3c0fe"; + let iv = "0001020304050607"; + + cipher_test(super::Type::DES_ECB, pt, ct, key, iv); + } } |