aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/stream/rc4/rc4.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-12-28 12:15:57 -0500
committerJack Lloyd <[email protected]>2017-12-28 12:15:57 -0500
commitf2d994387cf4140afcbb8673e2267ee8a78ab25d (patch)
tree95c37953679459616308e4fc6e6f4eceee286eed /src/lib/stream/rc4/rc4.cpp
parentd4e9461c48d19882561577b7f2ab64aa732cbaf0 (diff)
Fix RC4 name in case of skipped bytes
Add a test to detect that. Add test that stream ciphers throw if they are asked to use a nonce of a size they don't support. Remove "In = 00...00" blocks since that's implicit in the stream cipher tests.
Diffstat (limited to 'src/lib/stream/rc4/rc4.cpp')
-rw-r--r--src/lib/stream/rc4/rc4.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/stream/rc4/rc4.cpp b/src/lib/stream/rc4/rc4.cpp
index cce09d183..9f0a44d6e 100644
--- a/src/lib/stream/rc4/rc4.cpp
+++ b/src/lib/stream/rc4/rc4.cpp
@@ -93,9 +93,12 @@ void RC4::key_schedule(const uint8_t key[], size_t length)
*/
std::string RC4::name() const
{
- if(m_SKIP == 0) return "RC4";
- if(m_SKIP == 256) return "MARK-4";
- else return "RC4_skip(" + std::to_string(m_SKIP) + ")";
+ if(m_SKIP == 0)
+ return "RC4";
+ else if(m_SKIP == 256)
+ return "MARK-4";
+ else
+ return "RC4(" + std::to_string(m_SKIP) + ")";
}
/*