Index: crypto/encryptor.h |
=================================================================== |
--- crypto/encryptor.h (revision 107404) |
+++ crypto/encryptor.h (working copy) |
@@ -61,13 +61,15 @@ |
// Initializes the encryptor using |key| and |iv|. Returns false if either the |
// key or the initialization vector cannot be used. |
// |
- // When |mode| is CTR then |iv| should be empty. |
+ // If |mode| is CBC, |iv| must not be empty; if it is CTR, then |iv| must be |
+ // empty. |
bool Init(SymmetricKey* key, Mode mode, const base::StringPiece& iv); |
- // Encrypts |plaintext| into |ciphertext|. |
+ // Encrypts |plaintext| into |ciphertext|. |plaintext| may only be empty if |
+ // the mode is CBC. |
bool Encrypt(const base::StringPiece& plaintext, std::string* ciphertext); |
- // Decrypts |ciphertext| into |plaintext|. |
+ // Decrypts |ciphertext| into |plaintext|. |ciphertext| must not be empty. |
bool Decrypt(const base::StringPiece& ciphertext, std::string* plaintext); |
// Sets the counter value when in CTR mode. Currently only 128-bits |