From b7ae8043e963467eb222a44f48d66a1df36d9371 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Thu, 10 Nov 2016 13:25:10 -0500 Subject: Add SHAKE-128 and SHAKE-256 as hash functions --- src/lib/stream/shake_cipher/shake_cipher.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/lib/stream/shake_cipher/shake_cipher.cpp') 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"); } } -- cgit v1.2.3