|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.fasteasytrade.JRandTest.Algo.SHA1test
Field Summary | |
(package private) int |
A
Shared variables between ProcessBlock method and rounds A, B, C, D, E redefines H[1..H.length] |
(package private) int |
B
Shared variables between ProcessBlock method and rounds A, B, C, D, E redefines H[1..H.length] |
(package private) int |
C
Shared variables between ProcessBlock method and rounds A, B, C, D, E redefines H[1..H.length] |
(package private) int |
D
Shared variables between ProcessBlock method and rounds A, B, C, D, E redefines H[1..H.length] |
(package private) int |
E
Shared variables between ProcessBlock method and rounds A, B, C, D, E redefines H[1..H.length] |
(package private) int[] |
H
working IV - the default is copied from int[] IH. |
private static char[] |
hex
Used to convert number to Hex strings |
(package private) int[] |
IH
default IV |
(package private) int |
K0
|
(package private) int |
K1
|
(package private) int |
K2
|
(package private) int |
K3
|
(package private) int[] |
Mblock
|
(package private) long |
Numblocks
|
private boolean |
reset
Wherever next update should start from scratch |
(package private) int |
SHA1_BITBLOCKLEN
|
(package private) int |
SHA1_BITHASHLEN
|
(package private) int |
SHA1_BYTEBLOCKLEN
|
(package private) int |
SHA1_BYTEHASHLEN
|
(package private) int |
SHA1_INT32BLOCKLEN
|
(package private) int |
SHA1_INT32HASHLEN
|
(package private) byte[] |
tbuf
temporary buffer to keep data if tail length of buffer is < SHA1_BYTEBLOCKLEN. |
static int[] |
TEST_0_HASH
First official test result |
static String |
TEST_0_STRING
First official test |
static int[] |
TEST_1_HASH
Second official test result |
static String |
TEST_1_STRING
Second official test |
static int[] |
TEST_2_HASH
Third official test result |
static String |
TEST_2_STRING
Third official test |
(package private) int[] |
Wbuff
working buffer for each round |
Constructor Summary | |
SHA1test()
default constructor - calls SHA1_Init() |
|
SHA1test(int[] IH)
|
Method Summary | |
(package private) void |
bshr(byte[] buffer,
int len)
right shift buffer 1 bit |
Object |
clone()
|
int[] |
digest32()
|
byte[] |
digest8()
|
(package private) void |
expand(int x)
|
(package private) int |
f1(int x,
int y,
int z)
|
(package private) int |
f2(int x,
int y,
int z)
Rounds 20-39 |
(package private) int |
f3(int x,
int y,
int z)
|
int[] |
getH()
|
byte[] |
getHAsBytes()
|
int[] |
getMblock()
|
byte[] |
getMblockAsBytes()
|
static void |
main(String[] args)
Method to self-test the class from command line. |
(package private) void |
ProcessBlock()
This is the routine that implements the SHA. |
(package private) int |
RotateLeft1(int x)
|
(package private) int |
RotateLeft30(int x)
|
(package private) int |
RotateLeft5(int x)
|
(package private) void |
Round2(int count)
|
(package private) void |
Round3(int count)
|
(package private) void |
Round4(int count)
|
static void |
selfTest()
Self test using standard tests and write to standard output the result. |
SHA1test |
SHA1_Final()
SHA1_Final does the hashing of the last block of the message. |
void |
SHA1_Init()
SHA initialization routine. |
void |
SHA1_Init2(int[] IH)
SHA initialization routine. |
SHA1test |
SHA1_Update(byte[] buffer)
SHA1_Update hashes full 512 bit blocks. |
(package private) void |
sub1Round1(int count)
|
(package private) void |
sub2Round1(int count)
|
static String |
toHex(byte[] v)
Formats a number in an hex string. |
(package private) void |
xor(byte[] A,
byte[] x,
byte[] y,
int l)
xor - xor one array into another |
(package private) void |
xor(int[] A,
int[] X,
byte[] Y,
int l)
xor - xor one array into another. |
(package private) void |
xor(int[] A,
int[] x,
int[] y,
int l)
xor - xor one array into another |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
final int K0
final int K1
final int K2
final int K3
final int SHA1_BITBLOCKLEN
final int SHA1_BYTEBLOCKLEN
final int SHA1_INT32BLOCKLEN
final int SHA1_BITHASHLEN
final int SHA1_BYTEHASHLEN
final int SHA1_INT32HASHLEN
final int[] IH
int[] H
int[] Mblock
long Numblocks
int A
A, B, C, D, E redefines H[1..H.length]
int B
A, B, C, D, E redefines H[1..H.length]
int C
A, B, C, D, E redefines H[1..H.length]
int D
A, B, C, D, E redefines H[1..H.length]
int E
A, B, C, D, E redefines H[1..H.length]
int[] Wbuff
byte[] tbuf
private boolean reset
private static char[] hex
public static final String TEST_0_STRING
public static final String TEST_1_STRING
public static final String TEST_2_STRING
public static final int[] TEST_0_HASH
public static final int[] TEST_1_HASH
public static final int[] TEST_2_HASH
Constructor Detail |
public SHA1test()
public SHA1test(int[] IH)
Method Detail |
public void SHA1_Init()
public void SHA1_Init2(int[] IH)
IH
- init vectorpublic SHA1test SHA1_Update(byte[] buffer)
public SHA1test SHA1_Final()
void ProcessBlock()
void xor(byte[] A, byte[] x, byte[] y, int l)
A
- result arrayx
- input array xy
- input array yl
- length of bytes to xorvoid xor(int[] A, int[] X, byte[] Y, int l)
int[] A = int[]X ^ byte[]y.
A
- result int arrayl
- length of bytes to xorvoid xor(int[] A, int[] x, int[] y, int l)
A
- result arrayx
- input array xy
- input array yl
- length of ints to xorvoid bshr(byte[] buffer, int len)
buffer
- data to be shift rightlen
- length of bufferint RotateLeft1(int x)
int RotateLeft5(int x)
int RotateLeft30(int x)
int f1(int x, int y, int z)
int f3(int x, int y, int z)
int f2(int x, int y, int z)
void expand(int x)
void sub1Round1(int count)
void sub2Round1(int count)
void Round2(int count)
void Round3(int count)
void Round4(int count)
public int[] getMblock()
public byte[] getMblockAsBytes()
public int[] getH()
public byte[] getHAsBytes()
public int[] digest32()
public byte[] digest8()
public Object clone()
public static final String toHex(byte[] v)
v
- number to format
public static void selfTest()
public static void main(String[] args)
args
- command line parameters
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |