Arduino Cryptography Library
|
Speck block cipher with a 128-bit block size (small-memory version). More...
#include <SpeckSmall.h>
Public Member Functions | |
SpeckSmall () | |
Constructs a small-memory Speck block cipher with no initial key. More... | |
bool | setKey (const uint8_t *key, size_t len) |
Sets the key to use for future encryption and decryption operations. More... | |
void | decryptBlock (uint8_t *output, const uint8_t *input) |
Decrypts a single block using this cipher. More... | |
void | clear () |
Clears all security-sensitive state from this block cipher. More... | |
Public Member Functions inherited from SpeckTiny | |
SpeckTiny () | |
Constructs a tiny-memory Speck block cipher with no initial key. More... | |
size_t | blockSize () const |
Size of a single block processed by this cipher, in bytes. More... | |
size_t | keySize () const |
Default size of the key for this block cipher, in bytes. More... | |
bool | setKey (const uint8_t *key, size_t len) |
Sets the key to use for future encryption and decryption operations. More... | |
void | encryptBlock (uint8_t *output, const uint8_t *input) |
Encrypts a single block using this cipher. More... | |
void | decryptBlock (uint8_t *output, const uint8_t *input) |
Decrypts a single block using this cipher. More... | |
void | clear () |
Clears all security-sensitive state from this block cipher. More... | |
Public Member Functions inherited from BlockCipher | |
BlockCipher () | |
Constructs a block cipher. | |
virtual | ~BlockCipher () |
Destroys this block cipher object. More... | |
Speck block cipher with a 128-bit block size (small-memory version).
This class differs from the Speck class in that the RAM requirements are vastly reduced. The key schedule is expanded round by round instead of being generated and stored by setKey(). The performance of encryption and decryption is slightly less because of this.
This class is useful when RAM is at a premium and reduced encryption performance is not a hindrance to the application. Even though the performance is reduced, this class is still faster than AES with equivalent key sizes.
The companion SpeckTiny class uses even less RAM but only supports the encryptBlock() operation. Block cipher modes like CTR, EAX, and GCM do not need the decryptBlock() operation, so SpeckTiny may be a better option than SpeckSmall for many applications.
See the documentation for the Speck class for more information on the Speck family of block ciphers.
References: https://en.wikipedia.org/wiki/Speck_%28cipher%29, http://eprint.iacr.org/2013/404
Definition at line 28 of file SpeckSmall.h.
SpeckSmall::SpeckSmall | ( | ) |
Constructs a small-memory Speck block cipher with no initial key.
This constructor must be followed by a call to setKey() before the block cipher can be used for encryption or decryption.
Definition at line 85 of file SpeckSmall.cpp.
|
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.
Implements BlockCipher.
Definition at line 582 of file SpeckSmall.cpp.
|
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. |
Implements BlockCipher.
Definition at line 261 of file SpeckSmall.cpp.
|
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.
Implements BlockCipher.
Definition at line 94 of file SpeckSmall.cpp.