23 #ifndef CRYPTO_SKINNY128_h
24 #define CRYPTO_SKINNY128_h
26 #include "BlockCipher.h"
35 void encryptBlock(uint8_t *output,
const uint8_t *input);
36 void decryptBlock(uint8_t *output,
const uint8_t *input);
41 Skinny128(uint32_t *schedule, uint8_t rounds);
43 void setTK1(
const uint8_t *key,
bool tweaked =
false);
44 void xorTK1(
const uint8_t *key);
45 void setTK2(
const uint8_t *key);
46 void setTK3(
const uint8_t *key);
58 bool setTweak(
const uint8_t *tweak,
size_t len);
79 bool setKey(
const uint8_t *key,
size_t len);
82 uint32_t sched[40 * 2];
93 bool setKey(
const uint8_t *key,
size_t len);
96 uint32_t sched[48 * 2];
107 bool setKey(
const uint8_t *key,
size_t len);
110 uint32_t sched[48 * 2];
121 bool setKey(
const uint8_t *key,
size_t len);
124 uint32_t sched[56 * 2];
135 bool setKey(
const uint8_t *key,
size_t len);
138 uint32_t sched[56 * 2];
Skinny128_Tweaked(uint32_t *schedule, uint8_t rounds)
Constructs a tweakable Skinny-128 block cipher object.
SKINNY block cipher with a 128-bit block and a 256-bit key.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
size_t keySize() const
Size of a Skinny128_256 key in bytes.
void xorTK1(const uint8_t *key)
XOR's the key schedule with the schedule for TK1.
Abstract base class for block ciphers.
size_t keySize() const
Size of a Skinny128_384 key in bytes.
virtual ~Skinny128_256_Tweaked()
Destroys this tweakable Skinny-128 block cipher object after clearing sensitive information.
size_t keySize() const
Size of a Skinny128_256_Tweaked key in bytes.
void encryptBlock(uint8_t *output, const uint8_t *input)
Encrypts a single block using this cipher.
SKINNY block cipher with a 128-bit block, a 128-bit key, and a 128-bit tweak.
void setTK3(const uint8_t *key)
XOR's the key schedule with the schedule for TK3.
virtual ~Skinny128_Tweaked()
Destroys this tweakable Skinny-128 block cipher object after clearing sensitive information.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
SKINNY block cipher with a 128-bit block and a 384-bit key.
virtual ~Skinny128()
Destroys this Skinny-128 block cipher object after clearing sensitive information.
void clear()
Clears all security-sensitive state from this block cipher.
size_t keySize() const
Size of a Skinny128_128 key in bytes.
Abstract base class for SKINNY tweakable block ciphers with 128-bit blocks.
virtual ~Skinny128_384()
Destroys this Skinny-128 block cipher object after clearing sensitive information.
Skinny128_256()
Constructs a Skinny-128 block cipher with a 256-bit key.
SKINNY block cipher with a 128-bit block and a 128-bit key.
Skinny128_384_Tweaked()
Constructs a tweakable Skinny-128 block cipher with a 256-bit key and a 128-bit tweak.
Skinny128_256_Tweaked()
Constructs a tweakable Skinny-128 block cipher with a 128-bit key and a 128-bit tweak.
void setTK2(const uint8_t *key)
XOR's the key schedule with the schedule for TK2.
Abstract base class for SKINNY block ciphers with 128-bit blocks.
SKINNY block cipher with a 128-bit block, a 256-bit key, and a 128-bit tweak.
Skinny128_128()
Constructs a Skinny-128 block cipher with a 128-bit key.
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Skinny128(uint32_t *schedule, uint8_t rounds)
Constructs a Skinny-128 block cipher object.
void setTK1(const uint8_t *key, bool tweaked=false)
Clears the key schedule and sets it to the schedule for TK1.
virtual ~Skinny128_384_Tweaked()
Destroys this tweakable Skinny-128 block cipher object after clearing sensitive information.
size_t blockSize() const
Size of a Skinny-128 block in bytes.
void resetTweak()
Resets the tweak to all-zeroes.
virtual ~Skinny128_256()
Destroys this Skinny-128 block cipher object after clearing sensitive information.
size_t keySize() const
Size of a Skinny128_384_Tweaked key in bytes.
void decryptBlock(uint8_t *output, const uint8_t *input)
Decrypts a single block using this cipher.
virtual ~Skinny128_128()
Destroys this Skinny-128 block cipher object after clearing sensitive information.
Skinny128_384()
Constructs a Skinny-128 block cipher with a 384-bit key.
bool setTweak(const uint8_t *tweak, size_t len)
Sets the 128-bit tweak value for this block cipher.
void clear()
Clears all security-sensitive state from this block cipher.