|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.security.MessageDigestSpi | +--ostore.util.SHA1NativeIF
SHA1HashNativeIF
is an interface
to a
native
C
implementation of
a SHA-1
MessageDigest
.
The result of SHA1NativeIF
is used by the
SHA1Hash
and SHA1HashBuffer
class and by all entities which are SHA1 hashes.
(In the prototype, this means Guids and VHashes).
Field Summary | |
---|---|
static boolean |
available
available indicates if the C implementation
of SHA-1 is available. |
Constructor Summary | |
---|---|
SHA1NativeIF()
Construct according to the given fields. |
Method Summary | |
---|---|
byte[] |
engineDigest()
engineDigest completes the hash computation by
performing final operations such as padding. |
int |
engineDigest(byte[] buf,
int offset,
int len)
engineDigest completes the hash computation by
performing final operations such as padding. |
int |
engineGetDigestLength()
engineGetDigestLength returns the digest length in
bytes. |
void |
engineInit()
engineInit initializes the digest for further use. |
void |
engineReset()
engineReset resets the digest for further use. |
void |
engineUpdate(byte input)
engineUpdate updates the digest using the specified byte. |
void |
engineUpdate(byte[] input,
int offset,
int len)
engineUpdate updates the digest using the specified
array of bytes, starting at the specified offset. |
int |
engineUpdateAndDigest(byte[] buf,
int out_off,
int out_len,
byte[] input,
int in_off,
int in_len)
engineUpdateAndDigest in one call updates the
digest using the specified array of bytes, starting at the
specified offset. |
long |
testTput(int arrSz,
int iterations)
Tests the throughput of SHA1Native from entirely within C. |
Methods inherited from class java.security.MessageDigestSpi |
---|
clone |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static boolean available
available
indicates if the C
implementation
of SHA-1
is available.
Constructor Detail |
public SHA1NativeIF()
Method Detail |
public void engineInit()
engineInit
initializes the digest for further use.
public void engineReset()
engineReset
resets the digest for further use.
engineReset
in class MessageDigestSpi
public int engineGetDigestLength()
engineGetDigestLength
returns the digest length in
bytes.
engineGetDigestLength
in class MessageDigestSpi
public void engineUpdate(byte input)
engineUpdate
updates the digest using the specified byte.
engineUpdate
in class MessageDigestSpi
input
- The byte to use for the update.public void engineUpdate(byte[] input, int offset, int len)
engineUpdate
updates the digest using the specified
array of bytes, starting at the specified offset.
engineUpdate
in class MessageDigestSpi
input
- The array of bytes to use for the update.offset
- The offset to start from in the array of bytes.len
- The number of bytes to use, starting at
offset
.public byte[] engineDigest()
engineDigest
completes the hash computation by
performing final operations such as padding. Once
engineDigest
has been called, the engine should is
reset (see engineReset
).
engineDigest
in class MessageDigestSpi
public int engineDigest(byte[] buf, int offset, int len) throws DigestException
engineDigest
completes the hash computation by
performing final operations such as padding. Once
engineDigest
has been called, the engine is
reset (see engineReset
).
engineDigest
in class MessageDigestSpi
buf
- The output buffer in which to store the digest.offset
- Offset to start from in the output buffer.len
- Number of bytes within buf allotted for the digest.
The presence of this parameter is solely
for consistency in our API's. If the value of
this parameter is less than the actual digest
length, the method will throw a DigestException.
This parameter is ignored if its value is greater
than or equal to the actual digest length.
DigestException
- if an error occurs.public int engineUpdateAndDigest(byte[] buf, int out_off, int out_len, byte[] input, int in_off, int in_len) throws DigestException
engineUpdateAndDigest
in one call updates the
digest using the specified array of bytes, starting at the
specified offset. And completes the hash computation by
performing final operations such as padding. Once
engineUpdateAndDigest
has been called, the engine is
reset (see engineReset
).
buf
- The output buffer in which to store the digest.out_off
- Offset to start from in the output buffer.out_len
- Number of bytes within buf allotted for the digest.
The presence of this parameter is solely
for consistency in our API's. If the value of
this parameter is less than the actual digest
length, the method will throw a DigestException.
This parameter is ignored if its value is greater
than or equal to the actual digest length.input
- The array of bytes to use for the update.in_off
- The offset to start from in the array of bytes.in_len
- The number of bytes to use, starting at
offset
.
DigestException
- if an error occurs.public long testTput(int arrSz, int iterations)
arrSz
and times how long it
takes to hash iterations
of them.
arrSz
- The number of bytes to hashiterations
- The number of times to hash
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |