Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1159)

Unified Diff: crypto/encryptor.h

Issue 8418034: Make string_util::WriteInto() DCHECK() that the supplied |length_with_null| > 1, meaning that the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « chrome_frame/utils.cc ('k') | crypto/encryptor_mac.cc » ('j') | crypto/encryptor_mac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698