Abstract base class for SKINNY block ciphers with 64-bit blocks. More...
#include <Skinny64.h>
Public Member Functions | |
virtual | ~Skinny64 () |
Destroys this Skinny-64 block cipher object after clearing sensitive information. | |
size_t | blockSize () const |
Size of a Skinny-64 block in bytes. 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... | |
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... | |
Protected Member Functions | |
Skinny64 (uint32_t *schedule, uint8_t rounds) | |
Constructs a Skinny-64 block cipher object. More... | |
void | setTK1 (const uint8_t *key, bool tweaked=false) |
Clears the key schedule and sets it to the schedule for TK1. More... | |
void | xorTK1 (const uint8_t *key) |
XOR's the key schedule with the schedule for TK1. More... | |
void | setTK2 (const uint8_t *key) |
XOR's the key schedule with the schedule for TK2. More... | |
void | setTK3 (const uint8_t *key) |
XOR's the key schedule with the schedule for TK3. More... | |
Abstract base class for SKINNY block ciphers with 64-bit blocks.
This class is abstract. The caller should instantiate Skinny64_64, Skinny64_128, or Skinny64_192 to create a SKINNY block cipher with a specific key size. Or instantiate Skinny64_128_Tweaked or Skinny64_192_Tweaked for a tweakable version of the SKINNY block cipher.
Reference: https://sites.google.com/site/skinnycipher/
Definition at line 28 of file Skinny64.h.
|
protected |
Constructs a Skinny-64 block cipher object.
schedule | Points to the schedule data structure in the subclass. |
rounds | The number of rounds to perform during encryption/decryption. |
Definition at line 109 of file Skinny64.cpp.
|
virtual |
Size of a Skinny-64 block in bytes.
Implements BlockCipher.
Definition at line 126 of file Skinny64.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.
Reimplemented in Skinny64_Tweaked.
Definition at line 639 of file Skinny64.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 499 of file Skinny64.cpp.
|
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. |
Implements BlockCipher.
Definition at line 359 of file Skinny64.cpp.
|
protected |
Clears the key schedule and sets it to the schedule for TK1.
key | Points to the 16 bytes of TK1. |
tweaked | Set to true if the subclass uses tweaks. |
Definition at line 701 of file Skinny64.cpp.
|
protected |
XOR's the key schedule with the schedule for TK2.
key | Points to the 16 bytes of TK2. |
Definition at line 895 of file Skinny64.cpp.
|
protected |
XOR's the key schedule with the schedule for TK3.
key | Points to the 16 bytes of TK3. |
Definition at line 967 of file Skinny64.cpp.
|
protected |
XOR's the key schedule with the schedule for TK1.
key | Points to the 16 bytes of TK1. |
This function is used to adjust the tweak for the tweakable versions of the SKINNY block cipher.
Definition at line 796 of file Skinny64.cpp.