rv = (*cipherInfo->cipher.symmkeyCipher)(cipherInfo->cx, cipherInfo->output.pBuf.data, &len, maxLen, cipherInfo->input.pBuf.data, cipherInfo->input.pBuf.len); TIMESTART(); for (i=0; i<cipherInfo->repetitions; i++) { (*cipherInfo->cipher.symmkeyCipher)(cipherInfo->cx, dummyOut, &len, maxLen, cipherInfo->input.pBuf.data, cipherInfo->input.pBuf.len);  } TIMEFINISH(cipherInfo->optime, 1.0);
TIMESTART(); rv = (*cipherInfo->cipher.symmkeyCipher)(cipherInfo->cx, cipherInfo->output.pBuf.data, &len, maxLen, cipherInfo->input.pBuf.data, cipherInfo->input.pBuf.len); TIMEFINISH(cipherInfo->optime, 1.0); CHECKERROR(rv, __LINE__); cipherInfo->repetitions = 0; if (cipherInfo->repetitionsToPerfom != 0) { TIMESTART(); for (i=0; i<cipherInfo->repetitionsToPerfom; i++, cipherInfo->repetitions++) { (*cipherInfo->cipher.symmkeyCipher)(cipherInfo->cx, dummyOut, &len, maxLen, cipherInfo->input.pBuf.data, cipherInfo->input.pBuf.len);  CHECKERROR(rv, __LINE__); } } else { int opsBetweenChecks = 0; TIMEMARK(cipherInfo->seconds); while (! (TIMETOFINISH())) { int j = 0; for (;j < opsBetweenChecks;j++) { (*cipherInfo->cipher.symmkeyCipher)(cipherInfo->cx, dummyOut, &len, maxLen, cipherInfo->input.pBuf.data, cipherInfo->input.pBuf.len); } cipherInfo->repetitions += j; } } TIMEFINISH(cipherInfo->optime, 1.0);
cipherDoOp(bltestCipherInfo *cipherInfo){    PRIntervalTime time1, time2;    SECStatus rv = SECSuccess;    int i, len;    int maxLen = cipherInfo->output.pBuf.len;    unsigned char *dummyOut;    if (cipherInfo->mode == bltestDSA)	return dsaOp(cipherInfo);#ifdef NSS_ENABLE_ECC    else if (cipherInfo->mode == bltestECDSA)	return ecdsaOp(cipherInfo);#endif    dummyOut = PORT_Alloc(maxLen);    if (is_symmkeyCipher(cipherInfo->mode)) {	rv = (*cipherInfo->cipher.symmkeyCipher)(cipherInfo->cx,						 cipherInfo->output.pBuf.data,						 &len, maxLen,						 cipherInfo->input.pBuf.data,						 cipherInfo->input.pBuf.len);	TIMESTART();	for (i=0; i<cipherInfo->repetitions; i++) {	    (*cipherInfo->cipher.symmkeyCipher)(cipherInfo->cx, dummyOut,						&len, maxLen,						cipherInfo->input.pBuf.data,						cipherInfo->input.pBuf.len);	}	TIMEFINISH(cipherInfo->optime, 1.0);    } else if (is_pubkeyCipher(cipherInfo->mode)) {	rv = (*cipherInfo->cipher.pubkeyCipher)(cipherInfo->cx,						&cipherInfo->output.pBuf,						&cipherInfo->input.pBuf);	TIMESTART();	for (i=0; i<cipherInfo->repetitions; i++) {	    SECItem dummy;	    dummy.data = dummyOut;	    dummy.len = maxLen;	    (*cipherInfo->cipher.pubkeyCipher)(cipherInfo->cx, &dummy,					       &cipherInfo->input.pBuf);	}	TIMEFINISH(cipherInfo->optime, 1.0);    } else if (is_hashCipher(cipherInfo->mode)) {	rv = (*cipherInfo->cipher.hashCipher)(cipherInfo->output.pBuf.data,					      cipherInfo->input.pBuf.data,					      cipherInfo->input.pBuf.len);	TIMESTART();	for (i=0; i<cipherInfo->repetitions; i++) {	    (*cipherInfo->cipher.hashCipher)(dummyOut,					     cipherInfo->input.pBuf.data,					     cipherInfo->input.pBuf.len);	}	TIMEFINISH(cipherInfo->optime, 1.0);    }    PORT_Free(dummyOut);    return rv;}