Arduino Cryptography Library
Public Member Functions | List of all members
XTSSingleKey< T > Class Template Reference

Implementation of the single-key XTS mode for 128-bit block ciphers. More...

#include <XTS.h>

Inheritance diagram for XTSSingleKey< T >:
XTSSingleKeyCommon XTSCommon

Public Member Functions

 XTSSingleKey ()
 Constructs an object for encrypting sectors in XTS mode with a single key instead of two split keys. More...
 
 ~XTSSingleKey ()
 Clears all sensitive information and destroys this object.
 
- Public Member Functions inherited from XTSSingleKeyCommon
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. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for single-keyh XTS mode. More...
 
- Public Member Functions inherited from XTSCommon
virtual ~XTSCommon ()
 Clears all sensitive information and destroys this object.
 
size_t tweakSize () const
 Gets the maximum supported size for the tweak. More...
 
size_t sectorSize () const
 Gets the size of sectors encrypted or decrypted by this class. More...
 
bool setSectorSize (size_t size)
 Sets the size of sectors encrypted or decrypted by this class. More...
 
bool setTweak (const uint8_t *tweak, size_t len)
 Sets the tweak value for the current sector to encrypt or decrypt. More...
 
void encryptSector (uint8_t *output, const uint8_t *input)
 Encrypts an entire sector of data. More...
 
void decryptSector (uint8_t *output, const uint8_t *input)
 Decrypts an entire sector of data. More...
 
void clear ()
 Clears all security-sensitive state from this XTS object.
 

Additional Inherited Members

- Protected Member Functions inherited from XTSSingleKeyCommon
 XTSSingleKeyCommon ()
 Constructs an XTS object with a default sector size of 512 bytes.
 
- Protected Member Functions inherited from XTSCommon
 XTSCommon ()
 Constructs an XTS object with a default sector size of 512 bytes.
 
void setBlockCiphers (BlockCipher *cipher1, BlockCipher *cipher2)
 Sets the two block ciphers to use for XTS mode. More...
 

Detailed Description

template<typename T>
class XTSSingleKey< T >

Implementation of the single-key XTS mode for 128-bit block ciphers.

XTS mode normally uses two keys to encrypt plaintext and the sector-specific tweak values. This class uses the same key for both purposes, which can help save memory.

References: IEEE Std. 1619-2007, NIST SP 800-38E, a href="http://web.cs.ucdavis.edu/~rogaway/papers/offsets.pdf">XEX.

See also
XTS, XTSSingleKeyCommon

Definition at line 91 of file XTS.h.

Constructor & Destructor Documentation

◆ XTSSingleKey()

template<typename T >
XTSSingleKey< T >::XTSSingleKey ( )
inline

Constructs an object for encrypting sectors in XTS mode with a single key instead of two split keys.

This constructor should be followed by a call to setSectorSize(). The default sector size is 512 bytes.

Definition at line 94 of file XTS.h.


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