• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

Public Types | Public Member Functions | Protected Member Functions | List of all members
KMD4 Class Reference

#include <kmdcodec.h>

Public Types

typedef unsigned char Digest[16]
 

Public Member Functions

 KMD4 (const char *in, int len=-1)
 
 KMD4 (const TQByteArray &a)
 
 KMD4 (const TQCString &a)
 
void update (const char *in, int len=-1)
 
void update (const unsigned char *in, int len=-1)
 
void update (const TQByteArray &in)
 
void update (const TQCString &in)
 
bool update (TQIODevice &file)
 
void reset ()
 
const Digest & rawDigest ()
 
void rawDigest (KMD4::Digest &bin)
 
TQCString hexDigest ()
 
void hexDigest (TQCString &)
 
TQCString base64Digest ()
 
bool verify (const KMD4::Digest &digest)
 
bool verify (const TQCString &)
 

Protected Member Functions

void transform (TQ_UINT32 buf[4], TQ_UINT32 const in[16])
 
void finalize ()
 

Detailed Description

An adapted C++ implementation of the MD4 Message-Digest algorithm.

Since
3.4

The class usage is the same as KMD5.

Definition at line 577 of file kmdcodec.h.

Member Typedef Documentation

◆ Digest

typedef unsigned char KMD4::Digest[16]

Definition at line 581 of file kmdcodec.h.

Constructor & Destructor Documentation

◆ KMD4() [1/4]

KMD4::KMD4 ( )

Definition at line 1144 of file kmdcodec.cpp.

◆ KMD4() [2/4]

KMD4::KMD4 ( const char *  in,
int  len = -1 
)

Constructor that updates the digest for the given string.

Parameters
inC string or binary data
lenif negative, calculates the length by using strlen on the first parameter, otherwise it trusts the given length (does not stop on NUL byte).

Definition at line 1149 of file kmdcodec.cpp.

◆ KMD4() [3/4]

KMD4::KMD4 ( const TQByteArray &  a)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Same as above except it accepts a TQByteArray as its argument.

Definition at line 1155 of file kmdcodec.cpp.

◆ KMD4() [4/4]

KMD4::KMD4 ( const TQCString &  a)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Same as above except it accepts a TQCString as its argument.

Definition at line 1161 of file kmdcodec.cpp.

Member Function Documentation

◆ base64Digest()

TQCString KMD4::base64Digest ( )

Returns the value of the calculated message digest in a base64-encoded representation.

Definition at line 1348 of file kmdcodec.cpp.

◆ finalize()

void KMD4::finalize ( )
protected

finalizes the digest

Definition at line 1254 of file kmdcodec.cpp.

◆ hexDigest() [1/2]

TQCString KMD4::hexDigest ( )

Returns the value of the calculated message digest in a hexadecimal representation.

Definition at line 1325 of file kmdcodec.cpp.

◆ hexDigest() [2/2]

void KMD4::hexDigest ( TQCString &  s)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1338 of file kmdcodec.cpp.

◆ rawDigest() [1/2]

const KMD4::Digest & KMD4::rawDigest ( )
Returns
the raw representation of the digest

Definition at line 1313 of file kmdcodec.cpp.

◆ rawDigest() [2/2]

void KMD4::rawDigest ( KMD4::Digest &  bin)

Fills the given array with the binary representation of the message digest.

Use this method if you do not want to worry about making copy of the digest once you obtain it.

Parameters
binan array of 16 characters ( char[16] )

Definition at line 1319 of file kmdcodec.cpp.

◆ reset()

void KMD4::reset ( )

Calling this function will reset the calculated message digest.

Use this method to perform another message digest calculation without recreating the KMD4 object.

Definition at line 1368 of file kmdcodec.cpp.

◆ transform()

void KMD4::transform ( TQ_UINT32  buf[4],
TQ_UINT32 const  in[16] 
)
protected

Performs the real update work.

Note that length is implied to be 64.

Definition at line 1446 of file kmdcodec.cpp.

◆ update() [1/5]

void KMD4::update ( const char *  in,
int  len = -1 
)
inline

Updates the message to be digested.

Be sure to add all data before you read the digest. After reading the digest, you can not add more data!

Parameters
inmessage to be added to digest
lenthe length of the given message.

Definition at line 617 of file kmdcodec.h.

◆ update() [2/5]

void KMD4::update ( const TQByteArray &  in)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
inmessage to be added to the digest (TQByteArray).

Definition at line 1167 of file kmdcodec.cpp.

◆ update() [3/5]

void KMD4::update ( const TQCString &  in)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
inmessage to be added to the digest (TQCString).

Definition at line 1172 of file kmdcodec.cpp.

◆ update() [4/5]

void KMD4::update ( const unsigned char *  in,
int  len = -1 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1181 of file kmdcodec.cpp.

◆ update() [5/5]

bool KMD4::update ( TQIODevice &  file)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.reads the data from an I/O device, i.e.

from a file (TQFile).

NOTE that the file must be open for reading.

Parameters
filea pointer to FILE as returned by calls like f{d,re}open
Returns
false if an error occurred during reading.

Definition at line 1239 of file kmdcodec.cpp.

◆ verify() [1/2]

bool KMD4::verify ( const KMD4::Digest &  digest)

returns true if the calculated digest for the given message matches the given one.

Definition at line 1301 of file kmdcodec.cpp.

◆ verify() [2/2]

bool KMD4::verify ( const TQCString &  hexdigest)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1307 of file kmdcodec.cpp.


The documentation for this class was generated from the following files:
  • kmdcodec.h
  • kmdcodec.cpp

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.