ds.ov2.front
Class Hash_size
java.lang.Object
ds.ov2.front.Hash_size
public class Hash_size
- extends Object
Computes the size of the hash that is used in both Signature
and Host_signature
. The underlying digest SHA-1
produces always 160 bit hashes. For using smaller RSA keys (for
instance in the host test frame or in the Montgomerizing applet)
this means that hash does not fit into existing variables. To avoid
complications in these cases (where security is irrelevant anyways)
I restrict the hash size appropriately. This is done both in Signature
and Host_signature
by using only some last bytes
of the digest. This class computes the hash size. See Signature
for a more elaborated discussion of the hash size
problem.
- CPP Preprocessing
- This class uses the following cpp defines:
PACKAGE,
PUBLIC,
ASSERT
- Execution Environment:
- host, card
- Author:
- Hendrik Tews
- Version:
- $Revision: 1.10 $
- Last Commit:
- $Date: 2010-02-16 10:26:07 $ by $Author: tews $
Constructor Summary |
protected |
Hash_size()
Static class, object construction disabled. |
Method Summary |
static short |
hash_size(short short_bignat_size,
byte applet_id)
Compute the hash size, depending on the size for short
(exponent) bignats. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
digest_output_size
public static final short digest_output_size
- The output size that the SHA-1 digest produces when used in
Signature
and Host_signature
.
- See Also:
- Constant Field Values
Hash_size
protected Hash_size()
- Static class, object construction disabled.
hash_size
public static short hash_size(short short_bignat_size,
byte applet_id)
- Compute the hash size, depending on the size for short
(exponent) bignats. Normally the size should not exceed
2 * short_bignat_size -1
, but for the Montgomerizing
applet it is restricted to short_bignat_size
.
- Parameters:
short_bignat_size
- the size of short (exponent) bignats
in bytesapplet_id
- the applet ID, see RSA_data.applet_id
.
- Returns:
- size of the hash in bytes