Arduino Cryptography Library
Public Member Functions | Protected Member Functions | List of all members
XTSSingleKeyCommon Class Reference

Concrete base class to assist with implementing single-key XTS mode for 128-bit block ciphers. More...

#include <XTS.h>

Inheritance diagram for XTSSingleKeyCommon:
XTSCommon XTSSingleKey< T >

Public Member Functions

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.
 

Protected Member Functions

 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

Concrete base class to assist with implementing single-key XTS mode for 128-bit block ciphers.

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

See also
XTSSingleKey, XTSCommon

Definition at line 66 of file XTS.h.

Member Function Documentation

◆ keySize()

size_t XTSSingleKeyCommon::keySize ( ) const
virtual

Gets the size of the key for single-pkey XTS mode.

The key size for single-key XTS mode is the same as the key size for the underlying block cipher.

See also
setKey(), tweakSize()

Reimplemented from XTSCommon.

Definition at line 315 of file XTS.cpp.

◆ setKey()

bool XTSSingleKeyCommon::setKey ( const uint8_t *  key,
size_t  len 
)
virtual

Sets the key to use for single-keyh XTS mode.

Parameters
keyPoints to the key.
lenThe size of the key in bytes which must be same as the size of the underlying block cipher.
Returns
Returns true if the key was set or false if len was incorrect.

This function should be followed by a call to setTweak() to specify the sector-specific tweak.

See also
keySize(), setTweak(), encryptSector()

Reimplemented from XTSCommon.

Definition at line 334 of file XTS.cpp.


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