Botan

Filters

License
Botan is released under the Simplified BSD License (see LICENSE.md)

class  StreamCipherFilter: botan.filters.key_filt.KeyedFilter, botan.filters.filter.Filterable;

Stream Cipher Filter


void  write(const(ubyte)* input, size_t length);

Write input data

Parameters
const(ubyte)* input data
size_t length length of input in bytes

void  setIv(in InitializationVector iv);

Set the initialization vector for this filter.

Parameters
InitializationVector iv the initialization vector to set

void  setKey(in SymmetricKey key);

Set the key of this filter.

Parameters
SymmetricKey key the key to set

this(StreamCipher stream_cipher);

Construct a stream cipher filter.

Parameters
StreamCipher stream_cipher a cipher object to use

this(StreamCipher stream_cipher, in SymmetricKey key);

Construct a stream cipher filter.

Parameters
StreamCipher stream_cipher a cipher object to use
SymmetricKey key the key to use inside this filter

this(in string sc_name);

Construct a stream cipher filter.

Parameters
string sc_name the name of the desired cipher

this(in string sc_name, in SymmetricKey key);

Construct a stream cipher filter.

Parameters
string sc_name the name of the desired cipher
SymmetricKey key the key to use inside this filter

class  HashFilter: botan.filters.filter.Filter, botan.filters.filter.Filterable;

Hash Filter.


this(HashFunction hash_fun, size_t len = 0);

Construct a hash filter.

Parameters
HashFunction hash_fun the hash function to use
size_t len the output length of this filter. Leave the default value 0 if you want to use the full output of the hashfunction hash. Otherwise, specify a smaller value here so that the output of the hash algorithm will be cut off.

this(in string algo_spec, size_t len = 0);

Construct a hash filter.

Parameters
string algo_spec the name of the hash algorithm to use
size_t len the output length of this filter. Leave the default value 0 if you want to use the full output of the hashfunction hash. Otherwise, specify a smaller value here so that the output of the hash algorithm will be cut off.

class  MACFilter: botan.filters.key_filt.KeyedFilter, botan.filters.filter.Filterable;

MessageAuthenticationCode Filter.


void  setKey(in SymmetricKey key);

Set the key of this filter.

Parameters
SymmetricKey key the key to set

this(MessageAuthenticationCode mac_obj, size_t out_len = 0);

Construct a MAC filter. The MAC key will be left empty.

Parameters
MessageAuthenticationCode mac_obj the MAC to use
size_t out_len the output length of this filter. Leave the default value 0 if you want to use the full output of the MAC. Otherwise, specify a smaller value here so that the output of the MAC will be cut off.

this(MessageAuthenticationCode mac_obj, in SymmetricKey key, size_t out_len = 0);

Construct a MAC filter.

Parameters
MessageAuthenticationCode mac_obj the MAC to use
SymmetricKey key the MAC key to use
size_t out_len the output length of this filter. Leave the default value 0 if you want to use the full output of the MAC. Otherwise, specify a smaller value here so that the output of the MAC will be cut off.

this(in string mac_name, size_t len = 0);

Construct a MAC filter. The MAC key will be left empty.

Parameters
string mac_name the name of the MAC to use
size_t len the output length of this filter. Leave the default value 0 if you want to use the full output of the MAC. Otherwise, specify a smaller value here so that the output of the MAC will be cut off.

this(in string mac_name, in SymmetricKey key, size_t len = 0);

Construct a MAC filter.

Parameters
string mac_name the name of the MAC to use
SymmetricKey key the MAC key to use
size_t len the output length of this filter. Leave the default value 0 if you want to use the full output of the MAC. Otherwise, specify a smaller value here so that the output of the MAC will be cut off.