diff options
Diffstat (limited to 'crypto/encryptor.h')
-rw-r--r-- | crypto/encryptor.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/encryptor.h b/crypto/encryptor.h index a407266..6b23619 100644 --- a/crypto/encryptor.h +++ b/crypto/encryptor.h @@ -61,13 +61,15 @@ class CRYPTO_EXPORT Encryptor { // 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 |