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

tigertree.h File Reference


Detailed Description

Implementation of the TigerTree algorithm.

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.

#include "common.h"
#include "lib/tiger.h"
#include "lib/misc.h"

Go to the source code of this file.

Defines

#define TIGERSIZE   24
#define TTH_MAX_DEPTH   11
#define TTH_MAX_LEAVES   (1 << TTH_MAX_DEPTH)
#define TTH_BLOCKSIZE   1024

Typedefs

typedef TTH_CONTEXT TTH_CONTEXT

Functions

size_t tt_size (void)
void tt_check (void)
 Runs some test cases to check whether the implementation is alright.
void tt_init (TTH_CONTEXT *ctx, filesize_t filesize)
void tt_update (TTH_CONTEXT *ctx, gconstpointer data, size_t len)
void tt_digest (TTH_CONTEXT *ctx, struct tth *tth)
const struct tthtt_leaves (TTH_CONTEXT *ctx)
size_t tt_leave_count (TTH_CONTEXT *ctx)
tth tt_root_hash (const struct tth *src, size_t n_leaves)
size_t tt_compute_parents (struct tth *dst, const struct tth *src, size_t src_leaves)
filesize_t tt_node_count_at_depth (filesize_t filesize, unsigned depth)
size_t tt_good_node_count (filesize_t filesize)
filesize_t tt_good_slice_size (filesize_t filesize)
unsigned tt_full_depth (filesize_t filesize)
unsigned tt_good_depth (filesize_t filesize)


Define Documentation

#define TIGERSIZE   24
 

#define TTH_BLOCKSIZE   1024
 

#define TTH_MAX_DEPTH   11
 

#define TTH_MAX_LEAVES   (1 << TTH_MAX_DEPTH)
 


Typedef Documentation

typedef struct TTH_CONTEXT TTH_CONTEXT
 


Function Documentation

void tt_check void   ) 
 

Runs some test cases to check whether the implementation is alright.

size_t tt_compute_parents struct tth dst,
const struct tth src,
size_t  src_leaves
 

Parameters:
dst must be (src_leaves + 1) / 2 elements large.
src the nodes to compute the parents for.
src_leaves the number of 'src' nodes. return The number of parents.

void tt_digest TTH_CONTEXT ctx,
struct tth tth
 

unsigned tt_full_depth filesize_t  filesize  ) 
 

unsigned tt_good_depth filesize_t  filesize  ) 
 

size_t tt_good_node_count filesize_t  filesize  ) 
 

filesize_t tt_good_slice_size filesize_t  filesize  ) 
 

void tt_init TTH_CONTEXT ctx,
filesize_t  filesize
 

size_t tt_leave_count TTH_CONTEXT ctx  ) 
 

const struct tth* tt_leaves TTH_CONTEXT ctx  ) 
 

filesize_t tt_node_count_at_depth filesize_t  filesize,
unsigned  depth
 

struct tth tt_root_hash const struct tth src,
size_t  n_leaves
 

size_t tt_size void   ) 
 

void tt_update TTH_CONTEXT ctx,
gconstpointer  data,
size_t  len
 


Generated on Sat Jun 30 17:53:31 2007 for gtk-gnutella by  doxygen 1.3.9.1