Botan::HashFunction Class Reference

#include <hash.h>

Inheritance diagram for Botan::HashFunction:

Botan::BufferedComputation Botan::Adler32 Botan::Comb4P Botan::CRC24 Botan::CRC32 Botan::GOST_34_11 Botan::MD2 Botan::MDx_HashFunction Botan::Parallel Botan::Skein_512

List of all members.

Public Member Functions

virtual void clear ()=0
virtual HashFunctionclone () const =0
SecureVector< bytefinal ()
void final (byte out[])
 HashFunction (u32bit hash_len, u32bit block_len=0)
virtual std::string name () const =0
SecureVector< byteprocess (const std::string &in)
SecureVector< byteprocess (const MemoryRegion< byte > &in)
SecureVector< byteprocess (const byte in[], u32bit length)
void update (byte in)
void update (const std::string &str)
void update (const MemoryRegion< byte > &in)
void update (const byte in[], u32bit length)
virtual ~HashFunction ()

Public Attributes

const u32bit HASH_BLOCK_SIZE
const u32bit OUTPUT_LENGTH


Detailed Description

This class represents hash function (message digest) objects.

Definition at line 19 of file hash.h.


Constructor & Destructor Documentation

Botan::HashFunction::HashFunction ( u32bit  hash_len,
u32bit  block_len = 0 
) [inline]

Parameters:
hash_len the output length
block_len the internal block size (if applicable)

Definition at line 47 of file hash.h.

00047                                                           :
00048          BufferedComputation(hash_len), HASH_BLOCK_SIZE(block_len) {}

virtual Botan::HashFunction::~HashFunction (  )  [inline, virtual]

Definition at line 50 of file hash.h.

00050 {}


Member Function Documentation

virtual void Botan::HashFunction::clear (  )  [pure virtual]

virtual HashFunction* Botan::HashFunction::clone (  )  const [pure virtual]

SecureVector<byte> Botan::BufferedComputation::final (  )  [inline, inherited]

Complete the computation and retrieve the final result.

Returns:
SecureVector holding the result

Definition at line 72 of file buf_comp.h.

00073          {
00074          SecureVector<byte> output(OUTPUT_LENGTH);
00075          final_result(output);
00076          return output;
00077          }

void Botan::BufferedComputation::final ( byte  out[]  )  [inline, inherited]

virtual std::string Botan::HashFunction::name (  )  const [pure virtual]

SecureVector<byte> Botan::BufferedComputation::process ( const std::string &  in  )  [inline, inherited]

Update and finalize computation. Does the same as calling update() and final() consecutively.

Parameters:
in the input to process as a string
Returns:
the result of the call to final()

Definition at line 110 of file buf_comp.h.

00111          {
00112          update(in);
00113          return final();
00114          }

SecureVector<byte> Botan::BufferedComputation::process ( const MemoryRegion< byte > &  in  )  [inline, inherited]

Update and finalize computation. Does the same as calling update() and final() consecutively.

Parameters:
in the input to process
Returns:
the result of the call to final()

Definition at line 98 of file buf_comp.h.

References Botan::MemoryRegion< T >::size().

00099          {
00100          add_data(in, in.size());
00101          return final();
00102          }

SecureVector<byte> Botan::BufferedComputation::process ( const byte  in[],
u32bit  length 
) [inline, inherited]

Update and finalize computation. Does the same as calling update() and final() consecutively.

Parameters:
in the input to process as a byte array
length the length of the byte array
Returns:
the result of the call to final()

Definition at line 86 of file buf_comp.h.

Referenced by Botan::Randpool::add_entropy(), Botan::EME1::EME1(), Botan::RTSS_Share::split(), and Botan::Cert_Extension::Subject_Key_ID::Subject_Key_ID().

00087          {
00088          add_data(in, length);
00089          return final();
00090          }

void Botan::BufferedComputation::update ( byte  in  )  [inline, inherited]

Process a single byte.

Parameters:
in the byte to process

Definition at line 57 of file buf_comp.h.

00057 { add_data(&in, 1); }

void Botan::BufferedComputation::update ( const std::string &  str  )  [inline, inherited]

Add new input to process.

Parameters:
str the input to process as a std::string. Will be interpreted as a byte array based on the strings encoding.

Definition at line 48 of file buf_comp.h.

00049          {
00050          add_data(reinterpret_cast<const byte*>(str.data()), str.size());
00051          }

void Botan::BufferedComputation::update ( const MemoryRegion< byte > &  in  )  [inline, inherited]

Add new input to process.

Parameters:
in the input to process as a MemoryRegion

Definition at line 40 of file buf_comp.h.

References Botan::MemoryRegion< T >::size().

00040 { add_data(in, in.size()); }

void Botan::BufferedComputation::update ( const byte  in[],
u32bit  length 
) [inline, inherited]


Member Data Documentation


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

Generated on Fri Aug 13 16:20:58 2010 for Botan by  doxygen 1.5.8