Arduino Cryptography Library
|
Abstract base class for block ciphers. More...
#include <BlockCipher.h>
Public Member Functions | |
BlockCipher () | |
Constructs a block cipher. | |
virtual | ~BlockCipher () |
Destroys this block cipher object. More... | |
virtual size_t | blockSize () const =0 |
Size of a single block processed by this cipher, in bytes. More... | |
virtual size_t | keySize () const =0 |
Default size of the key for this block cipher, in bytes. More... | |
virtual bool | setKey (const uint8_t *key, size_t len)=0 |
Sets the key to use for future encryption and decryption operations. More... | |
virtual void | encryptBlock (uint8_t *output, const uint8_t *input)=0 |
Encrypts a single block using this cipher. More... | |
virtual void | decryptBlock (uint8_t *output, const uint8_t *input)=0 |
Decrypts a single block using this cipher. More... | |
virtual void | clear ()=0 |
Clears all security-sensitive state from this block cipher. More... | |
Abstract base class for block ciphers.
Block ciphers always operate in electronic codebook (ECB) mode. Higher-level classes such as CFB128 and CTR128 wrap the block cipher to create more useful classes for encryption and decryption of bulk data.
References: http://en.wikipedia.org/wiki/Block_cipher, http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29
Definition at line 29 of file BlockCipher.h.
|
virtual |
Destroys this block cipher object.
Subclasses are responsible for clearing temporary key schedules and other buffers so as to avoid leaking sensitive information.
Definition at line 52 of file BlockCipher.cpp.
|
pure virtual |
Size of a single block processed by this cipher, in bytes.
Implemented in SpeckTiny, Speck, AESTiny128, AESTiny256, and AESCommon.
|
pure virtual |
Clears all security-sensitive state from this block cipher.
Security-sensitive information includes key schedules and any temporary state that is used by encryptBlock() or decryptBlock() which is stored in the object itself.
Implemented in SpeckTiny, SpeckSmall, Speck, AESSmall128, AESTiny128, AESSmall256, AESTiny256, and AESCommon.
|
pure virtual |
Decrypts a single block using this cipher.
output | The output buffer to put the plaintext into. Must be at least blockSize() bytes in length. |
input | The input buffer to read the ciphertext from which is allowed to overlap with output. Must be at least blockSize() bytes in length. |
Implemented in SpeckTiny, SpeckSmall, Speck, AESSmall128, AESTiny128, AESSmall256, AESTiny256, and AESCommon.
|
pure virtual |
Encrypts a single block using this cipher.
output | The output buffer to put the ciphertext into. Must be at least blockSize() bytes in length. |
input | The input buffer to read the plaintext from which is allowed to overlap with output. Must be at least blockSize() bytes in length. |
Implemented in SpeckTiny, Speck, AESTiny128, AESTiny256, and AESCommon.
|
pure virtual |
Default size of the key for this block cipher, in bytes.
This value indicates the default, or recommended, size for the key.
Implemented in SpeckTiny, Speck, AESTiny128, AESTiny256, AES256, AES192, and AES128.
|
pure virtual |
Sets the key to use for future encryption and decryption operations.
key | The key to use. |
len | The length of the key. |
Use clear() or the destructor to remove the key and any other sensitive data from the object once encryption or decryption is complete.
Implemented in SpeckTiny, SpeckSmall, Speck, AESSmall128, AESTiny128, AESSmall256, AESTiny256, AES256, AES192, and AES128.