public void bruteForceWithAdditionalOracleEquations(int[] usedOracleEquations,BigInteger[] congs,BigInteger[] modulis,int pointer){
  if (result == null) {
    int[] eq=Arrays.copyOf(usedOracleEquations,usedOracleEquations.length);
    int maxValue=(pointer == usedOracleEquations.length - 1) ? (congs.length) : (usedOracleEquations[pointer + 1]);
    int minValue=usedOracleEquations[pointer];
    for (int i=minValue; i < maxValue; i++) {
      eq[pointer]=i;
      if (pointer > 0) {
        bruteForceWithAdditionalOracleEquations(eq,congs,modulis,(pointer - 1));
      }
 else {
        LOGGER.debug("Trying the following combination: {}",Arrays.toString(eq));
        BigInteger sqrtResult=computeCRTFromCombination(usedOracleEquations,congs,modulis);
        BigInteger r=MathHelper.bigIntSqRootFloor(sqrtResult);
        LOGGER.info("Guessing the following result: {}",r);
        if (oracle.isFinalSolutionCorrect(r)) {
          result=r;
        }
      }
    }
  }
}

public void bruteForceWithAdditionalOracleEquations ( int [ ] usedOracleEquations , BigInteger [ ] congs , BigInteger [ ] modulis , int pointer ) { if ( result == null ) { int [ ] eq = Arrays . copyOf ( usedOracleEquations , usedOracleEquations . length ) ; int maxValue = ( pointer == usedOracleEquations . length - 1 ) ? ( congs . length ) : ( usedOracleEquations [ pointer + 1 ] ) ; int minValue = usedOracleEquations [ pointer ] ; for ( int i = minValue ; i < maxValue ; i ++ ) { eq [ pointer ] = i ; if ( pointer > 0 ) { bruteForceWithAdditionalOracleEquations ( eq , congs , modulis , ( pointer - 1 ) ) ; } else { LOGGER . debug ( "Trying the following combination: {}" , Arrays . toString ( eq ) ) ; BigInteger sqrtResult = computeCRTFromCombination ( usedOracleEquations , congs , modulis ) ; BigInteger r = MathHelper . bigIntSqRootFloor ( sqrtResult ) ; LOGGER . info ( "Guessing the following result: {}" , r ) ; if ( oracle . isFinalSolutionCorrect ( r ) ) { result = r ; } } } } }
creates recursively all possible combinations of equations and tries to compute the server private key with crt .
