ds.ov2.test
Class Exponent_perf_card

java.lang.Object
  extended by ds.ov2.test.Exponent_perf_card

public class Exponent_perf_card
extends Object

Methods for the vector_exp protocol.

CPP Preprocessing
This class uses the following cpp defines: PACKAGE, PUBLIC, ASSERT,
Execution Environment:
card
Author:
Hendrik Tews
Version:
$Revision: 1.12 $
Last Commit:
$Date: 2009-05-25 07:51:19 $ by $Author: tews $

Field Summary
 Bignat result
          The result.
private  RSA_exponent rsa_exponent
          The cipher used for exponentiations.
private  RSA_exponent square_exponent
          The cipher for the squarings if squared multiplication is used.
private  Bignat temp_1
          First temporary.
private  Bignat temp_2
          Second temporary.
private  Bignat temp_3
          Third temporary.
 
Constructor Summary
Exponent_perf_card(Bignats bignats)
          Constructor.
 
Method Summary
 void vector_exp_init(Modulus modulus, short variant, boolean keep_modulus)
          Initialization method of the vector_exp_init step.
 void vector_exp(Vector base, Vector exponent, Modulus modulus, short base_factor_size, Vector base_factors, Bignat one_or_correction, short variant, boolean doit)
          Computation method for the vector_exp_1 and vector_exp_2 steps.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rsa_exponent

private final RSA_exponent rsa_exponent
The cipher used for exponentiations. Alias of Bignats.rsa_exponent.


square_exponent

private final RSA_exponent square_exponent
The cipher for the squarings if squared multiplication is used. Alias of Bignats.square_exp.


result

public final Bignat result
The result. Alias of Bignats.r_1. Must contain the same reference as Exponent_perf_description.result.


temp_1

private final Bignat temp_1
First temporary. Alias of Bignats.r_2.


temp_2

private final Bignat temp_2
Second temporary. Alias of Bignats.r_3.


temp_3

private final Bignat temp_3
Third temporary. Alias of Bignats.r_4.

Constructor Detail

Exponent_perf_card

public Exponent_perf_card(Bignats bignats)
Constructor. Initializes all the aliases to bignats.

Parameters:
bignats - data allocation instance
Method Detail

vector_exp_init

public void vector_exp_init(Modulus modulus,
                            short variant,
                            boolean keep_modulus)
Initialization method of the vector_exp_init step. For the init step the protocol layer transfers all the data (most importantly bases, exponents, modulus and base factors) to the applet. This method initializes the ciphers to be used for exponentiation (if any).

Parameters:
modulus - modulus
variant - multi-power implementation to use
keep_modulus - true if the modulus is the same as in the last test and it therefore should not be installed again; false to reinstall the modulus in all the ciphers.

vector_exp

public void vector_exp(Vector base,
                       Vector exponent,
                       Modulus modulus,
                       short base_factor_size,
                       Vector base_factors,
                       Bignat one_or_correction,
                       short variant,
                       boolean doit)
Computation method for the vector_exp_1 and vector_exp_2 steps. Performs the computation if doit is true. Stores the moduluar multi-power bases[0]^exponent[0] * bases[1]^exponent[1] ... mod modulus in result.

Parameters:
base - the bases
exponent - the exponents
modulus - modulus
base_factor_size - number of bases for which base_factors contains precomputed products (only relevant for the PURE_JAVA variant)
base_factors - the precomputed products of the bases
one_or_correction - a montgomerized one or a suitable Montgomery correction factor
variant - the implementation variant to use, 0 for Exponent_perf_host.Vector_exponent_variant.PURE_JAVA, 1 for Exponent_perf_host.Vector_exponent_variant.MONT_RSA, 2 for Exponent_perf_host.Vector_exponent_variant.SQUARED_RSA
doit - if false skip to call to the multi-power method to measure the transmission overhead