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

Unified Diff: crypto/encryptor.cc

Issue 2218903002: Remove unused private functions from Encryptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « crypto/encryptor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/encryptor.cc
diff --git a/crypto/encryptor.cc b/crypto/encryptor.cc
index 06bf00cce94bc608bf2a79aa14f4565177bd942d..fdbddb7430b1474cb4c25e7fb4b0318c28634481 100644
--- a/crypto/encryptor.cc
+++ b/crypto/encryptor.cc
@@ -135,43 +135,6 @@ bool Encryptor::SetCounter(const base::StringPiece& counter) {
return true;
}
-bool Encryptor::GenerateCounterMask(size_t plaintext_len,
- uint8_t* mask,
- size_t* mask_len) {
- DCHECK_EQ(CTR, mode_);
- CHECK(mask);
- CHECK(mask_len);
-
- const size_t kBlockLength = counter_->GetLengthInBytes();
- size_t blocks = (plaintext_len + kBlockLength - 1) / kBlockLength;
- CHECK(blocks);
-
- *mask_len = blocks * kBlockLength;
-
- for (size_t i = 0; i < blocks; ++i) {
- counter_->Write(mask);
- mask += kBlockLength;
-
- bool ret = counter_->Increment();
- if (!ret)
- return false;
- }
- return true;
-}
-
-void Encryptor::MaskMessage(const void* plaintext,
- size_t plaintext_len,
- const void* mask,
- void* ciphertext) const {
- DCHECK_EQ(CTR, mode_);
- const uint8_t* plaintext_ptr = reinterpret_cast<const uint8_t*>(plaintext);
- const uint8_t* mask_ptr = reinterpret_cast<const uint8_t*>(mask);
- uint8_t* ciphertext_ptr = reinterpret_cast<uint8_t*>(ciphertext);
-
- for (size_t i = 0; i < plaintext_len; ++i)
- ciphertext_ptr[i] = plaintext_ptr[i] ^ mask_ptr[i];
-}
-
bool Encryptor::Crypt(bool do_encrypt,
const base::StringPiece& input,
std::string* output) {
« no previous file with comments | « crypto/encryptor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698