Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

tigertree.c File Reference


Detailed Description

Implementation of the TigerTree algorithm.

Patterned after sha.c by A.M. Kuchling and others.

To use:

  1. allocate a TT_CONTEXT in your own code;
  2. tt_init(ttctx);
  3. tt_update(ttctx, buffer, length); as many times as necessary
  4. tt_digest(ttctx,resultptr);

Requires the tiger() function as defined in the reference implementation provided by the creators of the Tiger algorithm. See

http://www.cs.technion.ac.il/~biham/Reports/Tiger/

Note:
The TigerTree hash value cannot be calculated using a constant amount of memory; rather, the memory required grows with the (binary log of the) size of input. (Roughly, one more interim value must be remembered for each doubling of the input size.) This code reserves a counter and stack for input up to about 2^72 bytes in length. PASSING IN LONGER INPUT WILL LEAD TO A BUFFER OVERRUN AND UNDEFINED RESULTS. Of course, that would be over 4.7 trillion gigabytes of data, so problems are unlikely in practice anytime soon. :)
This file comes from http://sourceforge.net/projects/tigertree/

Inclusion in gtk-gnutella is:

Author:
Jeroen Asselman
Date:
2003
Copyright (C) 2001 Bitzi (aka Bitcollider) Inc. and Gordon Mohr Released into the public domain by same; permission is explicitly granted to copy, modify, and use freely.

THE WORK IS PROVIDED "AS IS," AND COMES WITH ABSOLUTELY NO WARRANTY, EXPRESS OR IMPLIED, TO THE EXTENT PERMITTED BY APPLICABLE LAW, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

(PD) 2001 The Bitzi Corporation Please see file COPYING or http://bitzi.com/publicdomain for more info.

#include "common.h"
#include "endian.h"
#include "misc.h"
#include "tigertree.h"
#include "override.h"

Functions

 RCSID ("$Id:tigertree.c, v 1.9 2005/10/28 17:35:26 cbiere Exp $")
void tt_endian (gchar *s)
void tt_init (TT_CONTEXT *ctx)
 Initialize the tigertree context.

void tt_compose (TT_CONTEXT *ctx)
void tt_block (TT_CONTEXT *ctx)
void tt_update (TT_CONTEXT *ctx, gchar *buffer, gint32 len)
void tt_final (TT_CONTEXT *ctx)
 No need to call this directly; tt_digest calls it for you.

void tt_digest (TT_CONTEXT *ctx, gchar *s)
void tt_copy (TT_CONTEXT *dest, TT_CONTEXT *src)
 This code untested; use at own risk.


Function Documentation

RCSID "$Id:tigertree.  c,
v 1.9 2005/10/28 17:35:26 cbiere Exp $" 
 

void tt_block TT_CONTEXT ctx  )  [inline, static]
 

void tt_compose TT_CONTEXT ctx  )  [inline, static]
 

void tt_copy TT_CONTEXT dest,
TT_CONTEXT src
 

This code untested; use at own risk.

void tt_digest TT_CONTEXT ctx,
gchar *  s
 

void tt_endian gchar *  s  )  [inline, static]
 

void tt_final TT_CONTEXT ctx  )  [inline, static]
 

No need to call this directly; tt_digest calls it for you.

void tt_init TT_CONTEXT ctx  ) 
 

Initialize the tigertree context.

void tt_update TT_CONTEXT ctx,
gchar *  buffer,
gint32  len
 


Generated on Sun Feb 12 10:50:08 2006 for Gtk-Gnutella by doxygen 1.3.6