ds.ov2.test
Class Exponent_perf_test_stubs

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

public class Exponent_perf_test_stubs
extends Object

Stub code for running methods in the testframe on the host. Defines one stub method for each protocol step in Exponent_perf.id. This class is the test-frame alternative to Exponent_perf_stubs. It provides the same public interface, but instead of communicating with a Java Card and invoking methods there, it directly invokes the methods on the very same Java Virtual machine. This is of course only possible, if (almost) all of the applet code is available on the host. All CardChannel arguments in this class are unused.

Each stub method here performs the following actions:

  1. argument conversion (for instance from BigInteger to Bignat)
  2. running the specified action for this step
  3. result conversion
  4. and finally packages several results into one tuple object

CPP Preprocessing
no cpp preprocessing needed
Execution Environment:
host
Author:
idl compiler
Version:
automatically generated from Exponent_perf.id

Field Summary
private  PrintWriter out
          The output channel for debugging information of the OV-chip protocol layer.
private  Exponent_perf_description protocol_description
          A protocol description instance from Exponent_perf.id.
 
Constructor Summary
Exponent_perf_test_stubs(Exponent_perf_description d, PrintWriter o, boolean script)
          Stub constructor.
 
Method Summary
 void set_vector_length_call(CardChannel _cc, int _n1_host_arg, int _n2_host_arg)
          Call step set_vector_length of protocol Vector_length in the test environment.
 long vector_exp_1_call(CardChannel _cc)
          Call step vector_exp_1 of protocol Vector_exp in the test environment.
 long vector_exp_2_call(CardChannel _cc)
          Call step vector_exp_2 of protocol Vector_exp in the test environment.
 void vector_exp_choose_mod_call(CardChannel _cc, int _vector_exp_variant_host_arg)
          Call step vector_exp_choose_mod of protocol Vector_exp in the test environment.
 void vector_exp_init_call(CardChannel _cc, Host_vector _bignats_base_host_arg, Host_vector _bignats_exponent_host_arg, Host_modulus _vec_exp_modulus_host_arg, int _n1_host_arg, Host_vector _bignats_base_factors_host_arg, BigInteger _one_or_correction_host_arg, boolean _keep_modulus_host_arg)
          Call step vector_exp_init of protocol Vector_exp in the test environment.
 BigInteger vector_exp_result_call(CardChannel _cc)
          Call step vector_exp_result of protocol Vector_exp in the test environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

protocol_description

private Exponent_perf_description protocol_description
A protocol description instance from Exponent_perf.id. Used to access the host initializers, which are additional parameters for the APDU type constructors of arguments or results. Initialized in the constructor.


out

private PrintWriter out
The output channel for debugging information of the OV-chip protocol layer. Initialized in the constructor.

Constructor Detail

Exponent_perf_test_stubs

public Exponent_perf_test_stubs(Exponent_perf_description d,
                                PrintWriter o,
                                boolean script)
Stub constructor. In this test-frame alternative there are no Host_protocol data structures to initialize. Therefore this constructor only saves the first two arguments into object local fields. The argument script is only there for compatibility with Exponent_perf_stubs, it is ignored here.

Parameters:
d - protocol description instance for Exponent_perf.id
o - channel for printing debugging information, pass null for disabling debugging information
script - ignored here, controls printing of apdutool lines in Exponent_perf_stubs
Method Detail

set_vector_length_call

public void set_vector_length_call(CardChannel _cc,
                                   int _n1_host_arg,
                                   int _n2_host_arg)
Call step set_vector_length of protocol Vector_length in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Exponent_perf_stubs
_n1_host_arg - argument n1 to be converted to APDU_short
_n2_host_arg - argument n2 to be converted to APDU_short

vector_exp_choose_mod_call

public void vector_exp_choose_mod_call(CardChannel _cc,
                                       int _vector_exp_variant_host_arg)
Call step vector_exp_choose_mod of protocol Vector_exp in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Exponent_perf_stubs
_vector_exp_variant_host_arg - argument vector_exp_variant to be converted to APDU_short

vector_exp_init_call

public void vector_exp_init_call(CardChannel _cc,
                                 Host_vector _bignats_base_host_arg,
                                 Host_vector _bignats_exponent_host_arg,
                                 Host_modulus _vec_exp_modulus_host_arg,
                                 int _n1_host_arg,
                                 Host_vector _bignats_base_factors_host_arg,
                                 BigInteger _one_or_correction_host_arg,
                                 boolean _keep_modulus_host_arg)
Call step vector_exp_init of protocol Vector_exp in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Exponent_perf_stubs
_bignats_base_host_arg - argument bignats.base to be converted to Vector
_bignats_exponent_host_arg - argument bignats.exponent to be converted to Vector
_vec_exp_modulus_host_arg - argument vec_exp_modulus to be converted to Modulus
_n1_host_arg - argument n1 to be converted to APDU_short
_bignats_base_factors_host_arg - argument bignats.base_factors to be converted to Vector
_one_or_correction_host_arg - argument one_or_correction to be converted to Bignat
_keep_modulus_host_arg - argument keep_modulus to be converted to APDU_boolean

vector_exp_1_call

public long vector_exp_1_call(CardChannel _cc)
Call step vector_exp_1 of protocol Vector_exp in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Exponent_perf_stubs
Returns:
Duration of the call in nanoseconds. The measurement includes (de-)serialization but not the allocation of argument and result arrays.

vector_exp_2_call

public long vector_exp_2_call(CardChannel _cc)
Call step vector_exp_2 of protocol Vector_exp in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Exponent_perf_stubs
Returns:
Duration of the call in nanoseconds. The measurement includes (de-)serialization but not the allocation of argument and result arrays.

vector_exp_result_call

public BigInteger vector_exp_result_call(CardChannel _cc)
Call step vector_exp_result of protocol Vector_exp in the test environment.

Parameters:
_cc - ignored here, can be null, card channel in Exponent_perf_stubs
Returns:
result result converted from Bignat