#include "botan-1.6/include/basefilt.h"
namespace Enctain {
namespace Botan {
Chain::Chain(Filter* f1, Filter* f2, Filter* f3, Filter* f4)
{
if(f1) { attach(f1); incr_owns(); }
if(f2) { attach(f2); incr_owns(); }
if(f3) { attach(f3); incr_owns(); }
if(f4) { attach(f4); incr_owns(); }
}
Chain::Chain(Filter* filters[], u32bit count)
{
for(u32bit j = 0; j != count; ++j)
if(filters[j])
{
attach(filters[j]);
incr_owns();
}
}
Fork::Fork(Filter* f1, Filter* f2, Filter* f3, Filter* f4)
{
Filter* filters[4] = { f1, f2, f3, f4 };
set_next(filters, 4);
}
Fork::Fork(Filter* filters[], u32bit count)
{
set_next(filters, count);
}
void Keyed_Filter::set_key(const SymmetricKey& key)
{
if(base_ptr)
base_ptr->set_key(key);
else
throw Invalid_State("Keyed_Filter::set_key: No base algorithm set");
}
bool Keyed_Filter::valid_keylength(u32bit n) const
{
if(base_ptr)
return base_ptr->valid_keylength(n);
throw Invalid_State("Keyed_Filter::valid_keylength: No base algorithm set");
}
}
}