KeccakTools
|
#include <padding.h>
Public Member Functions | |
virtual void | pad (unsigned int rate, MessageQueue &queue) const =0 |
virtual unsigned int | getPaddedSize (unsigned int rate, unsigned int inputSize) const =0 |
virtual string | getDescription () const =0 |
virtual bool | isRateValid (unsigned int rate) const |
Protected Member Functions | |
void | append10star (unsigned int blockSize, MessageQueue &queue) const |
Friends | |
ostream & | operator<< (ostream &a, const PaddingRule &pad) |
Abstract class implementing a padding rule.
void PaddingRule::append10star | ( | unsigned int | blockSize, |
MessageQueue & | queue | ||
) | const [protected] |
Method that appends a bit '1' then the minimum number of bits '0' to get a whole number of blocks. After calling this method, queue should contain a multiple of blockSize bits.
blockSize | The block size in bits to which to align. |
virtual string PaddingRule::getDescription | ( | ) | const [pure virtual] |
Abstract method that returns a string with a description of itself.
Implemented in SimplePadding, MultiRatePadding, and OldDiversifiedKeccakPadding.
virtual unsigned int PaddingRule::getPaddedSize | ( | unsigned int | rate, |
unsigned int | inputSize | ||
) | const [pure virtual] |
Abstract method to compute the size after padding.
rate | The block size in bits to which the padding must align. |
inputSize | The size in bits of the input message before padding. |
Implemented in SimplePadding, MultiRatePadding, and OldDiversifiedKeccakPadding.
bool PaddingRule::isRateValid | ( | unsigned int | rate | ) | const [virtual] |
Method to determine whether a given block size (or rate) is valid for the padding.
rate | The block size in bits. |
Reimplemented in OldDiversifiedKeccakPadding.
virtual void PaddingRule::pad | ( | unsigned int | rate, |
MessageQueue & | queue | ||
) | const [pure virtual] |
Abstract method to apply the padding on the given message queue.
rate | The block size in bits to which the padding must align. |
queue | The message bits to which the padding must be appended. |
Implemented in SimplePadding, MultiRatePadding, and OldDiversifiedKeccakPadding.
ostream& operator<< | ( | ostream & | a, |
const PaddingRule & | pad | ||
) | [friend] |
Method that prints a brief description of the padding rule.