8 #include <botan/lubyrack.h>
9 #include <botan/internal/xor_buf.h>
21 byte* buffer = &buffer_vec[0];
23 for(
size_t i = 0; i != blocks; ++i)
28 xor_buf(out + len, in + len, buffer, len);
31 hash->
update(out + len, len);
38 xor_buf(out + len, buffer, len);
41 hash->
update(out + len, len);
58 byte* buffer = &buffer_vec[0];
60 for(
size_t i = 0; i != blocks; ++i)
63 hash->
update(in + len, len);
70 xor_buf(out + len, in + len, buffer, len);
73 hash->
update(out + len, len);
80 xor_buf(out + len, buffer, len);
90 void LubyRackoff::key_schedule(
const byte key[],
size_t length)
95 copy_mem(&K2[0], key + length / 2, length / 2);
121 return "Luby-Rackoff(" + hash->
name() +
")";
LubyRackoff(HashFunction *hash)
virtual HashFunction * clone() const =0
void update(const byte in[], size_t length)
void copy_mem(T *out, const T *in, size_t n)
virtual std::string name() const =0
void encrypt_n(const byte in[], byte out[], size_t blocks) const
BlockCipher * clone() const
void decrypt_n(const byte in[], byte out[], size_t blocks) const
void xor_buf(byte out[], const byte in[], size_t length)
void zeroise(MemoryRegion< T > &vec)
virtual size_t output_length() const =0