diff options
author | Jack Lloyd <[email protected]> | 2017-12-28 12:15:57 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-12-28 12:15:57 -0500 |
commit | f2d994387cf4140afcbb8673e2267ee8a78ab25d (patch) | |
tree | 95c37953679459616308e4fc6e6f4eceee286eed /src/lib/stream/rc4/rc4.cpp | |
parent | d4e9461c48d19882561577b7f2ab64aa732cbaf0 (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.cpp | 9 |
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) + ")"; } /* |