| 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) {
|
|
|