![]() |
Quadcap Embeddable Database |
Inheritance diagram for com.quadcap.crypto.SHA1Digest:

I've run his test vectors through the code and they all pass.
Definition at line 76 of file SHA1Digest.java.
Public Member Functions | |
| SHA1Digest () | |
| Default constructor. | |
| void | init () |
| SHA1Init - Initialize new context. | |
| void | update (byte b) |
| Add one byte to the digest. | |
| void | update (byte[] b, int off, int len) |
| Implementation for arrays just wraps the primitive byte operation. | |
| void | update (byte[] buf) |
| And the full-array implementation is just a degenerate case of the array-subset implementation:. | |
| byte[] | digest () |
| Return the message digest for the accumulated bytes. | |
| String | getAlg () |
| Return a string that identifies this algorithm. | |
Static Public Member Functions | |
| void | main (String args[]) |
| This is a test program for the SHA1 algorithm. | |
Package Functions | |
| final int | rol (int value, int bits) |
| final int | blk0 (int i) |
| final int | blk (int i) |
| final void | R0 (int data[], int v, int w, int x, int y, int z, int i) |
| final void | R1 (int data[], int v, int w, int x, int y, int z, int i) |
| final void | R2 (int data[], int v, int w, int x, int y, int z, int i) |
| final void | R3 (int data[], int v, int w, int x, int y, int z, int i) |
| final void | R4 (int data[], int v, int w, int x, int y, int z, int i) |
| void | transform () |
| Hash a single 512-bit block. | |
Package Attributes | |
| int | dd [] = new int[5] |
Private Member Functions | |
| final void | finish () |
| Complete processing on the message digest. | |
| String | digout () |
| Print out the digest in a form that can be easily compared to the test vectors. | |
Private Attributes | |
| byte[] | digest = null |
| boolean | digestValid = false |
| int[] | state = new int[5] |
| long | count = 0 |
| int[] | block = new int[16] |
| int | blockIndex |
|
|
Default constructor.
Definition at line 93 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.init(). Referenced by com.quadcap.crypto.SHA1Digest.main(). |
|
|
Definition at line 206 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.blk(), and com.quadcap.crypto.SHA1Digest.block. Referenced by com.quadcap.crypto.SHA1Digest.blk(). |
|
|
Definition at line 200 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.blk0(), and com.quadcap.crypto.SHA1Digest.block. Referenced by com.quadcap.crypto.SHA1Digest.blk0(). |
|
|
Return the message digest for the accumulated bytes.
Implements com.quadcap.crypto.Digest. Definition at line 147 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.digestValid, com.quadcap.crypto.SHA1Digest.finish(), and com.quadcap.crypto.SHA1Digest.init(). |
|
|
Print out the digest in a form that can be easily compared to the test vectors.
Definition at line 339 of file SHA1Digest.java. Referenced by com.quadcap.crypto.SHA1Digest.main(). |
|
|
Complete processing on the message digest.
Definition at line 160 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.blockIndex, com.quadcap.crypto.SHA1Digest.count, com.quadcap.crypto.SHA1Digest.digestValid, and com.quadcap.crypto.SHA1Digest.state. Referenced by com.quadcap.crypto.SHA1Digest.digest(), and com.quadcap.crypto.SHA1Digest.main(). |
|
|
Return a string that identifies this algorithm.
Definition at line 181 of file SHA1Digest.java. |
|
|
SHA1Init - Initialize new context.
Implements com.quadcap.crypto.Digest. Definition at line 101 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.blockIndex, com.quadcap.crypto.SHA1Digest.count, com.quadcap.crypto.SHA1Digest.digest, com.quadcap.crypto.SHA1Digest.digestValid, and com.quadcap.crypto.SHA1Digest.state. Referenced by com.quadcap.crypto.SHA1Digest.digest(), com.quadcap.crypto.SHA1Digest.main(), and com.quadcap.crypto.SHA1Digest.SHA1Digest(). |
|
|
This is a test program for the SHA1 algorithm. It puts the three test vectors through the algorithm and prints out the results (they should match.) Then it runs the MessageDigest benchmark method to see how fast it is. on my P133 its about 110 - 120K bytes/second. It then compares it to MD5, which is about 150K bytes/second. Definition at line 367 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.digout(), com.quadcap.crypto.SHA1Digest.finish(), com.quadcap.crypto.SHA1Digest.init(), com.quadcap.crypto.SHA1Digest.main(), com.quadcap.crypto.SHA1Digest.SHA1Digest(), and com.quadcap.crypto.SHA1Digest.update(). Referenced by com.quadcap.crypto.SHA1Digest.main(). |
|
||||||||||||||||||||||||||||||||
|
Definition at line 212 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.R0(). Referenced by com.quadcap.crypto.SHA1Digest.R0(). |
|
||||||||||||||||||||||||||||||||
|
Definition at line 218 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.R1(). Referenced by com.quadcap.crypto.SHA1Digest.R1(). |
|
||||||||||||||||||||||||||||||||
|
Definition at line 224 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.R2(). Referenced by com.quadcap.crypto.SHA1Digest.R2(). |
|
||||||||||||||||||||||||||||||||
|
Definition at line 230 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.R3(). Referenced by com.quadcap.crypto.SHA1Digest.R3(). |
|
||||||||||||||||||||||||||||||||
|
Definition at line 237 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.R4(). Referenced by com.quadcap.crypto.SHA1Digest.R4(). |
|
||||||||||||
|
Definition at line 195 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.rol(). Referenced by com.quadcap.crypto.SHA1Digest.rol(). |
|
|
Hash a single 512-bit block. This is the core of the algorithm. Note that working with arrays is very inefficent in Java as it does a class cast check each time you store into the array. Definition at line 278 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.dd, and com.quadcap.crypto.SHA1Digest.state. Referenced by com.quadcap.crypto.SHA1Digest.update(). |
|
|
And the full-array implementation is just a degenerate case of the array-subset implementation:.
Implements com.quadcap.crypto.Digest. Definition at line 142 of file SHA1Digest.java. |
|
||||||||||||||||
|
Implementation for arrays just wraps the primitive byte operation.
Implements com.quadcap.crypto.Digest. Definition at line 134 of file SHA1Digest.java. |
|
|
Add one byte to the digest. When this is implemented all of the abstract class methods end up calling this method for types other than bytes. Implements com.quadcap.crypto.Digest. Definition at line 119 of file SHA1Digest.java. References com.quadcap.crypto.SHA1Digest.block, com.quadcap.crypto.SHA1Digest.blockIndex, com.quadcap.crypto.SHA1Digest.count, com.quadcap.crypto.SHA1Digest.transform(), and com.quadcap.crypto.SHA1Digest.update(). Referenced by com.quadcap.crypto.SHA1Digest.main(), and com.quadcap.crypto.SHA1Digest.update(). |
|
|
Definition at line 87 of file SHA1Digest.java. Referenced by com.quadcap.crypto.SHA1Digest.blk(), com.quadcap.crypto.SHA1Digest.blk0(), and com.quadcap.crypto.SHA1Digest.update(). |
|
|
Definition at line 88 of file SHA1Digest.java. Referenced by com.quadcap.crypto.SHA1Digest.finish(), com.quadcap.crypto.SHA1Digest.init(), and com.quadcap.crypto.SHA1Digest.update(). |
|
|
Definition at line 80 of file SHA1Digest.java. Referenced by com.quadcap.crypto.SHA1Digest.finish(), com.quadcap.crypto.SHA1Digest.init(), and com.quadcap.crypto.SHA1Digest.update(). |
|
|
Definition at line 268 of file SHA1Digest.java. Referenced by com.quadcap.crypto.SHA1Digest.transform(). |
|
|
Definition at line 77 of file SHA1Digest.java. Referenced by com.quadcap.crypto.SHA1Digest.init(). |
|
|
Definition at line 78 of file SHA1Digest.java. Referenced by com.quadcap.crypto.SHA1Digest.digest(), com.quadcap.crypto.SHA1Digest.finish(), and com.quadcap.crypto.SHA1Digest.init(). |
|
|
Definition at line 79 of file SHA1Digest.java. Referenced by com.quadcap.crypto.SHA1Digest.finish(), com.quadcap.crypto.SHA1Digest.init(), and com.quadcap.crypto.SHA1Digest.transform(). |