26 #include "BlockCipher.h"
41 virtual bool setKey(
const uint8_t *key,
size_t len);
42 bool setTweak(
const uint8_t *tweak,
size_t len);
53 blockCipher1 = cipher1;
54 blockCipher2 = cipher2;
72 bool setKey(
const uint8_t *key,
size_t len);
78 template <
typename T1,
typename T2 = T1>
Abstract base class for block ciphers.
Concrete base class to assist with implementing XTS mode for 128-bit block ciphers.
size_t tweakSize() const
Gets the maximum supported size for the tweak.
virtual size_t keySize() const
Gets the size of the key for XTS mode.
virtual bool setKey(const uint8_t *key, size_t len)
Sets the key to use for XTS mode.
bool setTweak(const uint8_t *tweak, size_t len)
Sets the tweak value for the current sector to encrypt or decrypt.
size_t sectorSize() const
Gets the size of sectors encrypted or decrypted by this class.
void decryptSector(uint8_t *output, const uint8_t *input)
Decrypts an entire sector of data.
bool setSectorSize(size_t size)
Sets the size of sectors encrypted or decrypted by this class.
void encryptSector(uint8_t *output, const uint8_t *input)
Encrypts an entire sector of data.
void clear()
Clears all security-sensitive state from this XTS object.
void setBlockCiphers(BlockCipher *cipher1, BlockCipher *cipher2)
Sets the two block ciphers to use for XTS mode.
virtual ~XTSCommon()
Clears all sensitive information and destroys this object.
XTSCommon()
Constructs an XTS object with a default sector size of 512 bytes.
Concrete base class to assist with implementing single-key XTS mode for 128-bit block ciphers.
virtual ~XTSSingleKeyCommon()
Clears all sensitive information and destroys this object.
size_t keySize() const
Gets the size of the key for single-pkey XTS mode.
XTSSingleKeyCommon()
Constructs an XTS object with a default sector size of 512 bytes.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for single-keyh XTS mode.
Implementation of the single-key XTS mode for 128-bit block ciphers.
XTSSingleKey()
Constructs an object for encrypting sectors in XTS mode with a single key instead of two split keys.
~XTSSingleKey()
Clears all sensitive information and destroys this object.
Implementation of the XTS mode for 128-bit block ciphers.
~XTS()
Clears all sensitive information and destroys this object.
XTS()
Constructs an object for encrypting sectors in XTS mode.