1 /**************************************************************************
3 * Java Grande Forum Benchmark Suite - Thread Version 1.0 *
7 * Java Grande Benchmarking Project *
11 * Edinburgh Parallel Computing Centre *
13 * email: epcc-javagrande@epcc.ed.ac.uk *
16 * This version copyright (c) The University of Edinburgh, 2001. *
17 * All rights reserved. *
19 **************************************************************************/
20 /**************************************************************************
21 * Ported for DSTM Benchmark *
22 **************************************************************************/
29 public class JGFCryptBench extends IDEATest {
32 private int datasizes[];
34 global JGFInstrumentor instr;
36 public JGFCryptBench(int nthreads, JGFInstrumentor instr)
38 this.nthreads = nthreads;
40 datasizes = new int[3];
41 datasizes[0] = 3000000;
42 datasizes[1] = 20000000;
43 datasizes[2] = 50000000;
47 public void JGFsetsize(int size){
51 public void JGFinitialise(){
52 array_rows = datasizes[size];
56 public void JGFkernel(){
60 public void JGFvalidate(){
64 for (int i = 0; i < array_rows; i++){
65 error = (plain1 [i] != plain2 [i]);
67 System.printString("Validation failed");
68 System.printString("Original Byte " + i + " = " + plain1[i]);
69 System.printString("Encrypted Byte " + i + " = " + crypt1[i]);
70 System.printString("Decrypted Byte " + i + " = " + plain2[i]);
77 public void JGFtidyup(){
83 public void JGFrun(int size){
86 instr.addTimer("Section2:Crypt:Kernel", "Kbyte",size);
95 instr.addOpsToTimer("Section2:Crypt:Kernel", (2*array_rows)/1000.);
96 instr.printTimer("Section2:Crypt:Kernel");