KeccakTools

MessageQueue Class Reference

#include <padding.h>

List of all members.

Public Member Functions

 MessageQueue (unsigned int aBlockSize)
void appendBit (int bitValue)
void appendByte (UINT8 byteValue)
void appendZeroes (unsigned int count)
void append (const UINT8 *input, unsigned int lengthInBits)
void append (const vector< UINT8 > &input, unsigned int lengthInBits)
unsigned int lastBlockSize () const
unsigned int blockCount () const
bool firstBlockIsWhole () const
const vector< UINT8 > & firstBlock () const
void removeFirstBlock ()
void clear ()

Detailed Description

Class representing a sequence of fixed-size blocks, except the last one, whose size can be smaller.


Constructor & Destructor Documentation

MessageQueue::MessageQueue ( unsigned int  aBlockSize)

The constructor.

Parameters:
aBlockSizeThe desired block size in bits.

Member Function Documentation

void MessageQueue::append ( const UINT8 input,
unsigned int  lengthInBits 
)

Method to append a number of bits to the sequence.

Parameters:
inputPointer to the bits to append. If the number of bits is not a multiple of 8, the last byte contains the last few bits in its least significant bits.
lengthInBitsThe number of bits to append.
void MessageQueue::append ( const vector< UINT8 > &  input,
unsigned int  lengthInBits 
)

Method to append a number of bits to the sequence.

Parameters:
inputVector containing the bytes to append. If the number of bits is not a multiple of 8, the last byte contains the last few bits in its least significant bits.
lengthInBitsThe number of bits to append.
void MessageQueue::appendBit ( int  bitValue)

Method to append one bit to the sequence.

Parameters:
bitValueThe value (0 or 1) of the bit to append.
void MessageQueue::appendByte ( UINT8  byteValue)

Method to append one byte to the sequence.

Parameters:
byteValueThe value (0x00…0xFF) of the byte to append.
void MessageQueue::appendZeroes ( unsigned int  count)

Method to append a series of bits with value '0'.

Parameters:
countThe number of zeroes to append.
unsigned int MessageQueue::blockCount ( ) const

Method that returns the number of blocks in the sequence.

Returns:
The number of blocks in the sequence.
void MessageQueue::clear ( )

Method to empty the sequence.

const vector< UINT8 > & MessageQueue::firstBlock ( ) const

Method that returns a reference to the first block of the sequence.

Returns:
A constant reference to the block represented as a vector of bytes. If the number of bits is not a multiple of 8, the last byte contains the last few bits in its least significant bits.
bool MessageQueue::firstBlockIsWhole ( ) const

Method that tells whether the first block has exactly blockSize bits.

Returns:
True iff the first block has exactly blockSize bits.
unsigned int MessageQueue::lastBlockSize ( ) const

Method that returns the size of the last block.

Returns:
The size of the last block in bits.
void MessageQueue::removeFirstBlock ( )

Method that removes the first block of the sequence.


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