KeccakTools

PaddingRule Class Reference

#include <padding.h>

Inheritance diagram for PaddingRule:

List of all members.

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)

Detailed Description

Abstract class implementing a padding rule.


Member Function Documentation

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.

Parameters:
blockSizeThe 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.

Parameters:
rateThe block size in bits to which the padding must align.
inputSizeThe 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.

Parameters:
rateThe block size in bits.
Returns:
True iff the rate is valid.

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.

Parameters:
rateThe block size in bits to which the padding must align.
queueThe message bits to which the padding must be appended.

Implemented in SimplePadding, MultiRatePadding, and OldDiversifiedKeccakPadding.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  a,
const PaddingRule pad 
) [friend]

Method that prints a brief description of the padding rule.


The documentation for this class was generated from the following files: