libkeepass 0.2.0
KeePass key database importer/exporter library
Loading...
Searching...
No Matches
keepass::Cipher< N > Class Template Referenceabstract

Abstract base class for 16-byte block ciphers. More...

#include <cipher.hh>

Public Member Functions

virtual const std::array< uint8_t, N > & InitializationVector () const =0
 Returns the initialization vector used by this cipher instance.
 
virtual void Decrypt (const std::array< uint8_t, N > &src, std::array< uint8_t, N > &dst) const =0
 Decrypts a single block.
 
virtual void Encrypt (const std::array< uint8_t, N > &src, std::array< uint8_t, N > &dst) const =0
 Encrypts a single block.
 

Detailed Description

template<std::size_t N>
class keepass::Cipher< N >

Abstract base class for 16-byte block ciphers.

Template Parameters
NThe block size in bytes (always 16 for the ciphers in this library).

Member Function Documentation

◆ Decrypt()

template<std::size_t N>
virtual void keepass::Cipher< N >::Decrypt ( const std::array< uint8_t, N > &  src,
std::array< uint8_t, N > &  dst 
) const
pure virtual

Decrypts a single block.

Parameters
srcThe ciphertext block to decrypt.
dstThe resulting plaintext block.

◆ Encrypt()

template<std::size_t N>
virtual void keepass::Cipher< N >::Encrypt ( const std::array< uint8_t, N > &  src,
std::array< uint8_t, N > &  dst 
) const
pure virtual

Encrypts a single block.

Parameters
srcThe plaintext block to encrypt.
dstThe resulting ciphertext block.

◆ InitializationVector()

template<std::size_t N>
virtual const std::array< uint8_t, N > & keepass::Cipher< N >::InitializationVector ( ) const
pure virtual

Returns the initialization vector used by this cipher instance.

Returns
A reference to the 16-byte initialization vector.

Implemented in keepass::AesCipher, and keepass::TwofishCipher.


The documentation for this class was generated from the following file: