aboutsummaryrefslogtreecommitdiffstats
path: root/src/stream
diff options
context:
space:
mode:
authorlloyd <[email protected]>2013-04-19 14:56:02 +0000
committerlloyd <[email protected]>2013-04-19 14:56:02 +0000
commitabbf2b764c6fd2339c9e4fbc4647072087683f48 (patch)
tree21495af9492a03a0707343b3a0d8ade830c0699e /src/stream
parentd6d870741bb2272b564153b26a638fb6e29ddd89 (diff)
Rename ARC4 to RC4
Diffstat (limited to 'src/stream')
-rw-r--r--src/stream/arc4/info.txt1
-rw-r--r--src/stream/rc4/info.txt1
-rw-r--r--src/stream/rc4/rc4.cpp (renamed from src/stream/arc4/arc4.cpp)20
-rw-r--r--src/stream/rc4/rc4.h (renamed from src/stream/arc4/arc4.h)16
4 files changed, 19 insertions, 19 deletions
diff --git a/src/stream/arc4/info.txt b/src/stream/arc4/info.txt
deleted file mode 100644
index e3022925c..000000000
--- a/src/stream/arc4/info.txt
+++ /dev/null
@@ -1 +0,0 @@
-define ARC4
diff --git a/src/stream/rc4/info.txt b/src/stream/rc4/info.txt
new file mode 100644
index 000000000..587a5fea8
--- /dev/null
+++ b/src/stream/rc4/info.txt
@@ -0,0 +1 @@
+define RC4
diff --git a/src/stream/arc4/arc4.cpp b/src/stream/rc4/rc4.cpp
index da1694a96..bd4c710a9 100644
--- a/src/stream/arc4/arc4.cpp
+++ b/src/stream/rc4/rc4.cpp
@@ -1,5 +1,5 @@
/*
-* ARC4
+* RC4
* (C) 1999-2007 Jack Lloyd
*
* Distributed under the terms of the Botan license
@@ -14,7 +14,7 @@ namespace Botan {
/*
* Combine cipher stream with message
*/
-void ARC4::cipher(const byte in[], byte out[], size_t length)
+void RC4::cipher(const byte in[], byte out[], size_t length)
{
while(length >= buffer.size() - position)
{
@@ -31,7 +31,7 @@ void ARC4::cipher(const byte in[], byte out[], size_t length)
/*
* Generate cipher stream
*/
-void ARC4::generate()
+void RC4::generate()
{
byte SX, SY;
for(size_t i = 0; i != buffer.size(); i += 4)
@@ -57,9 +57,9 @@ void ARC4::generate()
}
/*
-* ARC4 Key Schedule
+* RC4 Key Schedule
*/
-void ARC4::key_schedule(const byte key[], size_t length)
+void RC4::key_schedule(const byte key[], size_t length)
{
state.resize(256);
buffer.resize(round_up<size_t>(DEFAULT_BUFFERSIZE, 4));
@@ -84,9 +84,9 @@ void ARC4::key_schedule(const byte key[], size_t length)
/*
* Return the name of this type
*/
-std::string ARC4::name() const
+std::string RC4::name() const
{
- if(SKIP == 0) return "ARC4";
+ if(SKIP == 0) return "RC4";
if(SKIP == 256) return "MARK-4";
else return "RC4_skip(" + std::to_string(SKIP) + ")";
}
@@ -94,7 +94,7 @@ std::string ARC4::name() const
/*
* Clear memory of sensitive data
*/
-void ARC4::clear()
+void RC4::clear()
{
zap(state);
zap(buffer);
@@ -102,8 +102,8 @@ void ARC4::clear()
}
/*
-* ARC4 Constructor
+* RC4 Constructor
*/
-ARC4::ARC4(size_t s) : SKIP(s) {}
+RC4::RC4(size_t s) : SKIP(s) {}
}
diff --git a/src/stream/arc4/arc4.h b/src/stream/rc4/rc4.h
index 8f8de87b6..c23f8c853 100644
--- a/src/stream/arc4/arc4.h
+++ b/src/stream/rc4/rc4.h
@@ -1,12 +1,12 @@
/*
-* ARC4
+* RC4
* (C) 1999-2008 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
-#ifndef BOTAN_ARC4_H__
-#define BOTAN_ARC4_H__
+#ifndef BOTAN_RC4_H__
+#define BOTAN_RC4_H__
#include <botan/stream_cipher.h>
#include <botan/types.h>
@@ -14,9 +14,9 @@
namespace Botan {
/**
-* Alleged RC4
+* RC4 stream cipher
*/
-class BOTAN_DLL ARC4 : public StreamCipher
+class BOTAN_DLL RC4 : public StreamCipher
{
public:
void cipher(const byte in[], byte out[], size_t length);
@@ -24,7 +24,7 @@ class BOTAN_DLL ARC4 : public StreamCipher
void clear();
std::string name() const;
- StreamCipher* clone() const { return new ARC4(SKIP); }
+ StreamCipher* clone() const { return new RC4(SKIP); }
Key_Length_Specification key_spec() const
{
@@ -34,9 +34,9 @@ class BOTAN_DLL ARC4 : public StreamCipher
/**
* @param skip skip this many initial bytes in the keystream
*/
- ARC4(size_t skip = 0);
+ RC4(size_t skip = 0);
- ~ARC4() { clear(); }
+ ~RC4() { clear(); }
private:
void key_schedule(const byte[], size_t);
void generate();