Botan

Symmetric Algorithm Base Class

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

interface  SymmetricAlgorithm;

This class represents a symmetric algorithm object.


final const size_t  maximumKeylength();

Returns
minimum allowed key length

final const size_t  minimumKeylength();

Returns
maxmium allowed key length

final const bool  validKeylength(size_t length);

Check whether a given key length is valid for this algorithm.

Parameters
size_t length the key length to be checked.
Returns
true if the key length is valid.

final void  setKey(in SymmetricKey key);
final void  setKey(Alloc)(auto ref const RefCounted!(Vector!(ubyte, Alloc), Alloc) key);
final void  setKey(Alloc)(auto ref const Vector!(ubyte, Alloc) key);

Set the symmetric key of this object.

Parameters
SymmetricKey key the SymmetricKey to be set.

final void  setKey(const(ubyte)* key, size_t length);

Set the symmetric key of this object.

Parameters
const(ubyte)* key the to be set as a ubyte array.
size_t length in bytes of key param

abstract void  clear();

Clear underlying buffers


abstract const KeyLengthSpecification  keySpec();

Returns
object describing limits on key size

protected abstract void  keySchedule(const(ubyte)* key, size_t length);

Run the key schedule

Parameters
const(ubyte)* key the key
size_t length of key