diff options
author | Jack Lloyd <[email protected]> | 2016-11-10 13:25:10 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-11-10 13:25:10 -0500 |
commit | b7ae8043e963467eb222a44f48d66a1df36d9371 (patch) | |
tree | f5ec4059e21d874404c60595568a4a3d4d7305c9 /src/lib/stream/shake_cipher/shake_cipher.cpp | |
parent | e6bf87b6b0d4d9c3877b79de53de58dc34a3acca (diff) |
Add SHAKE-128 and SHAKE-256 as hash functions
Diffstat (limited to 'src/lib/stream/shake_cipher/shake_cipher.cpp')
-rw-r--r-- | src/lib/stream/shake_cipher/shake_cipher.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/stream/shake_cipher/shake_cipher.cpp b/src/lib/stream/shake_cipher/shake_cipher.cpp index 5701e7802..dc3c73299 100644 --- a/src/lib/stream/shake_cipher/shake_cipher.cpp +++ b/src/lib/stream/shake_cipher/shake_cipher.cpp @@ -11,13 +11,13 @@ namespace Botan { -SHAKE_128::SHAKE_128() : +SHAKE_128_Cipher::SHAKE_128_Cipher() : m_state(25), m_buffer((1600 - 256) / 8), m_buf_pos(0) {} -void SHAKE_128::cipher(const byte in[], byte out[], size_t length) +void SHAKE_128_Cipher::cipher(const byte in[], byte out[], size_t length) { while(length >= m_buffer.size() - m_buf_pos) { @@ -35,7 +35,7 @@ void SHAKE_128::cipher(const byte in[], byte out[], size_t length) m_buf_pos += length; } -void SHAKE_128::key_schedule(const byte key[], size_t length) +void SHAKE_128_Cipher::key_schedule(const byte key[], size_t length) { zeroise(m_state); @@ -51,14 +51,14 @@ void SHAKE_128::key_schedule(const byte key[], size_t length) copy_out_le(m_buffer.data(), m_buffer.size(), m_state.data()); } -void SHAKE_128::clear() +void SHAKE_128_Cipher::clear() { zeroise(m_state); zeroise(m_buffer); m_buf_pos = 0; } -void SHAKE_128::set_iv(const byte[], size_t length) +void SHAKE_128_Cipher::set_iv(const byte[], size_t length) { /* * This could be supported in some way (say, by treating iv as @@ -68,8 +68,8 @@ void SHAKE_128::set_iv(const byte[], size_t length) throw Invalid_IV_Length(name(), length); } -void SHAKE_128::seek(u64bit) +void SHAKE_128_Cipher::seek(u64bit) { - throw Not_Implemented("SHAKE_128::seek"); + throw Not_Implemented("SHAKE_128_Cipher::seek"); } } |