}\r
\r
/// Encrypt the given text with the given key. The key length must be 128 bits encoded in base64.\r
-/// Ouput format:\r
-/// Format "1" + base_64(<IV> + <hash(message)> + <aes(message)>)\r
+/// Ouput format: "1" + base_64(<IV> + <hash(message)> + <aes(message)>)\r
/// IV: 16 bytes randomized.\r
/// Mode : CBC.\r
pub fn encrypt(key: &str, plain_text: &str) -> Result<String, EncryptError> {\r
Ok(String::from("1") + &base64::encode(&result))\r
}\r
\r
-/// TODO: return a Result<string, DecryptError>\r
+/// Decrypt the given text with the given key. The key length must be 128 bits encoded in base64.\r
+/// Input format: "1" + base_64(<IV> + <hash(message)> + <aes(message)>)\r
pub fn decrypt(key: &str, cipher_text: &str) -> Result<String, DecryptError> {\r
let key_as_bytes = decode_key(key).map_err(|e| DecryptError::KeyError(e))?;\r
\r