| java.lang.Object org.apache.harmony.security.provider.crypto.SHA1Impl
SHA1Impl | public class SHA1Impl implements SHA1_Data(Code) | | This class contains methods providing SHA-1 functionality to use in classes.
The methods support the algorithm described in "SECURE HASH STANDARD", FIPS PUB 180-2,
"http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf"
The class contains two package level access methods, -
"void updateHash(int[], byte[], int, int)" and "void computeHash(int[])", -
performing the following operations.
The "updateHash(..)" method appends new bytes to existing ones
within limit of a frame of 64 bytes (16 words).
Once a length of accumulated bytes reaches the limit
the "computeHash(int[])" method is invoked on the frame to compute updated hash,
and the number of bytes in the frame is set to 0.
Thus, after appending all bytes, the frame contain only those bytes
that were not used in computing final hash value yet.
The "computeHash(..)" method generates a 160 bit hash value using
a 512 bit message stored in first 16 words of int[] array argument and
current hash value stored in five words, beginning HASH_OFFSET, of the array argument.
Computation is done according to SHA-1 algorithm.
The resulting hash value replaces the previous hash value in the array;
original bits of the message are not preserved.
|
Method Summary | |
static void | computeHash(int arrW) The method generates a 160 bit hash value using
a 512 bit message stored in first 16 words of int[] array argument and
current hash value stored in five words, beginning OFFSET+1, of the array argument. | static void | updateHash(int intArray, byte byteInput, int fromByte, int toByte) The method appends new bytes to existing ones
within limit of a frame of 64 bytes (16 words).
Once a length of accumulated bytes reaches the limit
the "computeHash(int[])" method is invoked on the array to compute updated hash,
and the number of bytes in the frame is set to 0.
Thus, after appending all bytes, the array contain only those bytes
that were not used in computing final hash value yet.
No checks on arguments passed to the method, that is,
a calling method is responsible for such checks. |
computeHash | static void computeHash(int arrW)(Code) | | The method generates a 160 bit hash value using
a 512 bit message stored in first 16 words of int[] array argument and
current hash value stored in five words, beginning OFFSET+1, of the array argument.
Computation is done according to SHA-1 algorithm.
The resulting hash value replaces the previous hash value in the array;
original bits of the message are not preserved.
No checks on argument supplied, that is,
a calling method is responsible for such checks.
In case of incorrect array passed to the method
either NPE or IndexOutOfBoundException gets thrown by JVM.
|
updateHash | static void updateHash(int intArray, byte byteInput, int fromByte, int toByte)(Code) | | The method appends new bytes to existing ones
within limit of a frame of 64 bytes (16 words).
Once a length of accumulated bytes reaches the limit
the "computeHash(int[])" method is invoked on the array to compute updated hash,
and the number of bytes in the frame is set to 0.
Thus, after appending all bytes, the array contain only those bytes
that were not used in computing final hash value yet.
No checks on arguments passed to the method, that is,
a calling method is responsible for such checks.
|
|
|