net.i2p.crypto
Class SHA256Generator

java.lang.Object
  extended bynet.i2p.crypto.SHA256Generator

public final class SHA256Generator
extends java.lang.Object

Defines a wrapper for SHA-256 operation This is done. Takes data of any size and hashes it.

Author:
thecrypto,jrandom

Field Summary
(package private) static int[] H0
           
(package private) static int[] K
           
 
Constructor Summary
SHA256Generator(I2PAppContext context)
           
 
Method Summary
 SHA256EntryCache cache()
           
 Hash calculateHash(byte[] source)
          Calculate the SHA-256 has of the source
 Hash calculateHash(byte[] source, int start, int len)
           
 Hash calculateHash(byte[] source, int start, int len, SHA256EntryCache.CacheEntry cache)
           
 Hash calculateHash(byte[] source, SHA256EntryCache.CacheEntry cache)
           
static SHA256Generator getInstance()
           
static int getWordlength(int sourceLength)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

K

static final int[] K

H0

static final int[] H0
Constructor Detail

SHA256Generator

public SHA256Generator(I2PAppContext context)
Method Detail

getInstance

public static final SHA256Generator getInstance()

cache

public final SHA256EntryCache cache()

getWordlength

public static final int getWordlength(int sourceLength)

calculateHash

public final Hash calculateHash(byte[] source)
Calculate the SHA-256 has of the source

Parameters:
source - what to hash
Returns:
hash of the source

calculateHash

public final Hash calculateHash(byte[] source,
                                SHA256EntryCache.CacheEntry cache)

calculateHash

public final Hash calculateHash(byte[] source,
                                int start,
                                int len)

calculateHash

public final Hash calculateHash(byte[] source,
                                int start,
                                int len,
                                SHA256EntryCache.CacheEntry cache)