summaryrefslogtreecommitdiff
path: root/src/InternalARC4Encryptor.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-09-26 00:11:10 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-09-26 00:11:10 +0900
commitda278225c1758562cabd802453bcbd6735772f8f (patch)
tree2c6bb1f564ad6770d6426b080a977c07f1f92ea7 /src/InternalARC4Encryptor.cc
parentf2a1d241c246312036cc37b49aff5f3468e63d13 (diff)
InternalARC4Encryptor: Fix compiler warning and remove no use ctor/dtor
Diffstat (limited to 'src/InternalARC4Encryptor.cc')
-rw-r--r--src/InternalARC4Encryptor.cc7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/InternalARC4Encryptor.cc b/src/InternalARC4Encryptor.cc
index 67c939ef..4b8e5337 100644
--- a/src/InternalARC4Encryptor.cc
+++ b/src/InternalARC4Encryptor.cc
@@ -37,11 +37,6 @@
namespace aria2 {
-ARC4Encryptor::~ARC4Encryptor()
-{
- for (auto& c : state_) c = 0;
- i = j = 0;
-}
void ARC4Encryptor::init(const unsigned char* key, size_t keyLength)
{
j = 0;
@@ -60,7 +55,7 @@ void ARC4Encryptor::init(const unsigned char* key, size_t keyLength)
void ARC4Encryptor::encrypt(size_t len, unsigned char* out,
const unsigned char* in)
{
- for (auto c = 0; c < len; ++c) {
+ for (auto c = 0u; c < len; ++c) {
i = (i + 1) & 0xff;
j = (j + state_[i]) & 0xff;
auto sj = state_[i];