ostore.archive
Class VHashTree

java.lang.Object
  |
  +--ostore.archive.VHashTree

public final class VHashTree
extends Object

A VHashTree is a tree (right now, binary) of hashes, where a parent node is the hash over the concatenation of its children.

Version:
$Id: VHashTree.java,v 1.16 2003/11/17 23:52:43 emilong Exp $
Author:
Hakim Weatherspoon

Nested Class Summary
static class VHashTree.TreeObj
           
 
Constructor Summary
VHashTree()
           
 
Method Summary
static Pair calculateHashes(FragmentBucket fb, Erasure e, byte[] fragHeaderArray, int[] intFrags, byte[] block, int origBlockSize, ByteArrayInputBuffer buffer, SecureHash blockVHash, VHashTree.TreeObj[] treeObjs)
          calculateHashes calculates the inactive verification tree for the input fragments and returns the topmost hash of that tree
static Pair calculateHashes(FragmentBucket fb, SecureHash blockVHash, SHA1NativeIF md, VHashTree.TreeObj[] treeObjs)
          calculateHashes calculates the inactive verification tree for the input fragments and returns the topmost hash of that tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VHashTree

public VHashTree()
Method Detail

calculateHashes

public static final Pair calculateHashes(FragmentBucket fb,
                                         Erasure e,
                                         byte[] fragHeaderArray,
                                         int[] intFrags,
                                         byte[] block,
                                         int origBlockSize,
                                         ByteArrayInputBuffer buffer,
                                         SecureHash blockVHash,
                                         VHashTree.TreeObj[] treeObjs)
                                  throws DigestException
calculateHashes calculates the inactive verification tree for the input fragments and returns the topmost hash of that tree

Parameters:
fb - bucket containing the fragments to calculate the verification tree over.
blockVHash - block vhash.
buffer - VHash buffer. length of two SecureHashes.
Returns:
the block-guid (first) and the topmost hash of the hash tree (second).
DigestException

calculateHashes

public static final Pair calculateHashes(FragmentBucket fb,
                                         SecureHash blockVHash,
                                         SHA1NativeIF md,
                                         VHashTree.TreeObj[] treeObjs)
                                  throws DigestException
calculateHashes calculates the inactive verification tree for the input fragments and returns the topmost hash of that tree

Parameters:
fb - bucket containing the fragments to calculate the verification tree over.
blockVHash - block vhash.
md - TODO
treeObjs - TODO
Returns:
the block-guid (first) and the topmost hash of the hash tree (second).
DigestException