|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectds.ov2.bignat.Fake_rsa_exponent
public class Fake_rsa_exponent
RSA_exponent_interface implementation for the host. Uses
BigInteger internally. Provides nothing more
than just BigInteger.modPow with a
strange interface.
This class makes it possible to use Vector.mont_rsa_exponent_mod and code that depends on it on the host,
for instance in a test frame.
As far as possible other code is written in terms of RSA_exponent_interface to avoid cpp trickery. However, when it
comes to constructor calls, there is no way around it. For those
few places the cpp macro RSA_EXPONENT
is used. It expands to either RSA_exponent or to
Fake_rsa_exponent.
For a number of general topics see also the package description.
| Field Summary | |
|---|---|
private BigInteger |
exponent
The configured exponent. |
private BigInteger |
modulus
The configured modulus. |
| Constructor Summary | |
|---|---|
Fake_rsa_exponent()
Non-allocating constructor. |
|
Fake_rsa_exponent(short key_byte_size)
Allocating constructor. |
|
| Method Summary | |
|---|---|
void |
allocate(short key_byte_size)
Empty method. |
void |
fixed_power(Bignat base,
Bignat result,
short offset)
Modular power with preconfigured modulus and exponent. |
void |
init_key(short key_size)
Empty method. |
void |
power(Bignat base,
Bignat exp,
Bignat result,
short offset)
Modular exponent. |
void |
set_exponent(Bignat exponent,
Bignat temp,
short offset)
Saves the exponent exponent for later use in modulus. |
void |
set_modulus(Bignat mod,
short offset)
Saves the modulus mod for later use in modulus. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private BigInteger modulus
set_modulus.
private BigInteger exponent
set_exponent.
| Constructor Detail |
|---|
public Fake_rsa_exponent()
public Fake_rsa_exponent(short key_byte_size)
non-allocating constructor and allocate as
prescribed, although they are all empty.
key_byte_size - ignored argument| Method Detail |
|---|
public void init_key(short key_size)
RSA_exponent_interface.
init_key in interface RSA_exponent_interfacekey_size - ignored argumentpublic void allocate(short key_byte_size)
RSA_exponent_interface.
allocate in interface RSA_exponent_interfacekey_byte_size - ignored argument
public void set_modulus(Bignat mod,
short offset)
mod for later use in modulus.
set_modulus in interface RSA_exponent_interfacemod - modulus to use later in exponentoffset - this argument is ignored in this class
public void set_exponent(Bignat exponent,
Bignat temp,
short offset)
exponent for later use in modulus.
set_exponent in interface RSA_exponent_interfaceexponent - exponent to use later in power
or fixed_powertemp - this argument is ignored in this classoffset - this argument is ignored in this class
public void fixed_power(Bignat base,
Bignat result,
short offset)
result to base^exp mod modulus,
where the modulus and exp must have been
configured before with set_modulus and
set_exponent, respectively.
fixed_power in interface RSA_exponent_interfacebase - result - reference for storing the resultoffset - this argument is ignored in this class
public void power(Bignat base,
Bignat exp,
Bignat result,
short offset)
result to base^exp (modulo modulus), where the modulus must have
been configured before with set_modulus.
Computations are done with BigInteger, data conversion
with Convert_serializable.
power in interface RSA_exponent_interfacebase - baseexp - exponentresult - gets the result base^exponent modulo modulusoffset - this argument is ignored in this class
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||